+unsigned int fn_598b4(struct s_59b78 *r11_data, unsigned int r10_arg2)
+{
+ unsigned int r1;
+ unsigned int r2;
+ unsigned int r6;
+ unsigned int r7;
+
+ fprintf(stderr,"%s\n", __func__);
+
+ r1 = r10_arg2 - 1;
+ r6 = 1 << r1;
+
+ r7 = 0;
+ do {
+ r1 = r11_data->y;
+ if (r1 == 0x80) {
+ r1 = fn_597c8(r11_data);
+ }
+ r11_data->x = r1;
+ r1 = r11_data->y;
+ r2 = r11_data->x;
+ r1 = r1 & r2;
+ if (r1 != 0)
+ r7 = r7 | r6;
+
+ r6 = r6 >> 1;
+
+ r2 = r11_data->y;
+ r2 = r2 >> 1;
+ r11_data->y = r2;
+
+ r1 = r11_data->y;
+ if(r1 == 0) {
+ r11_data->y = 0x80;
+ }
+ } while (r6 != 0);
+
+ return r7;
+}
+