// File: tomfunkhouser[P]gaps/apps/scn2cam/scn2cam.cpp
// Function: CreateRoomCameras()
static void
CreateRoomCameras(void)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();
  int camera_count = 0;

  // Get useful variables
  RNScalar neardist = 0.01 * scene->BBox().DiagonalRadius();
  RNScalar fardist = 100 * scene->BBox().DiagonalRadius();
  RNScalar aspect = (RNScalar) height / (RNScalar) width;
  RNAngle yfov = atan(aspect * tan(xfov));
  int dim0 = (gravity_dimension + 1) % 3;
  int dim1 = (gravity_dimension + 2) % 3;
  int dim2 = gravity_dimension;

  // Create one camera per direction per room 
  for (int i = 0; i < scene->NNodes(); i++) {
    R3SceneNode *room_node = scene->Node(i);
    if (!IsRoom(room_node)) continue;
    R3Box room_bbox = room_node->BBox();
    if (room_bbox.IsEmpty()) continue;
    if (RNIsZero(room_bbox.Volume())) continue;

    // Compute viewpoint mask
    R2Grid viewpoint_mask;
    if (room_node->Name() && !strncmp(room_node->Name(), "Room#", 5)) {
      if (!ComputeViewpointMask(room_node, viewpoint_mask)) continue;
    }

    // Sample directions
    int nangles = (int) (RN_TWO_PI / angle_sampling + 0.5);
    RNScalar angle_spacing = (nangles > 1) ? RN_TWO_PI / nangles : RN_TWO_PI;
    for (int j = 0; j < nangles; j++) {
      // Choose one camera for each direction in each room
      R3Camera best_camera;

      // Sample positions
      for (RNScalar x = room_bbox.Min()[dim0]; x < room_bbox.Max()[dim0]; x += position_sampling) {
        for (RNScalar y = room_bbox.Min()[dim1]; y < room_bbox.Max()[dim1]; y += position_sampling) {
          // Compute position
          R2Point position;
          position[0] = x + position_sampling*RNRandomScalar();
          position[1] = y + position_sampling*RNRandomScalar();

          // Check viewpoint mask
          if (viewpoint_mask.NEntries() > 0) {
            // R2Point viewpoint_mask_position(position[1], position[0]); // ZX          
            // RNScalar viewpoint_mask_value = viewpoint_mask.WorldValue(viewpoint_mask_position);
            RNScalar viewpoint_mask_value = viewpoint_mask.WorldValue(position);
            if (viewpoint_mask_value < 0.5) continue;
          }

          // Compute viewpoint
          R3Point viewpoint;
          RNScalar h = eye_height + 2.0*(RNRandomScalar()-0.5) * eye_height_radius;
          viewpoint[dim0] = position[0];
          viewpoint[dim1] = position[1];
          viewpoint[dim2] = room_bbox.Min()[gravity_dimension] + h;
          if (!R3Contains(room_bbox, viewpoint)) continue;

          // Compute direction
          RNScalar angle = (j+RNRandomScalar()) * angle_spacing;
          R2Vector direction = R2posx_vector;
          direction.Rotate(angle);
          direction.Normalize();

          // Compute camera
          R3Vector towards;
          towards[dim0] = direction[0];
          towards[dim1] = direction[1];
          towards[dim2] = -0.2;
          towards.Normalize();
          R3Vector right = towards % R3xyz_triad[gravity_dimension];
          right.Normalize();
          R3Vector up = right % towards;
          up.Normalize();
          R3Camera camera(viewpoint, towards, up, xfov, yfov, neardist, fardist);

          // Compute score for camera
          camera.SetValue(SceneCoverageScore(camera, scene, room_node, TRUE));
          if (camera.Value() == 0) continue;
          if (camera.Value() < min_score) continue;

          // Remember best camera
          if (camera.Value() > best_camera.Value()) {
            best_camera = camera;
          }
        }
      }

      // Insert best camera for direction in room
      if (best_camera.Value() > 0) {
        if (print_debug) printf("ROOM %s %d : %g\n", room_node->Name(), j, best_camera.Value());
        char name[1024];
        sprintf(name, "%s_%d", room_node->Name(), j);
        Camera *camera = new Camera(best_camera, name);
        cameras.Insert(camera);
        camera_count++;
      }
    }
  }
        
  // Print statistics
  if (print_verbose) {
    printf("Created room cameras ...\n");
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Cameras = %d\n", camera_count++);
    fflush(stdout);
  }
}

// Assembly:
subq $0x888, %rsp            # imm = 0x888
leaq 0x878(%rsp), %rdi
callq 0x11bad0
leaq 0x878(%rsp), %rdi
callq 0x321a0
movl $0x0, 0x874(%rsp)
movq 0x203535(%rip), %rdi    # 0x22fc38
callq 0x32290
movq %rax, %rdi
callq 0x322b0
movaps %xmm0, %xmm1
movsd 0x18e905(%rip), %xmm0   # 0x1bb020
mulsd %xmm1, %xmm0
movsd %xmm0, 0x868(%rsp)
movq 0x203509(%rip), %rdi    # 0x22fc38
callq 0x32290
movq %rax, %rdi
callq 0x322b0
movaps %xmm0, %xmm1
movsd 0x18e8d1(%rip), %xmm0   # 0x1bb018
mulsd %xmm1, %xmm0
movsd %xmm0, 0x860(%rsp)
cvtsi2sdl 0x1fd330(%rip), %xmm0 # 0x229a8c
cvtsi2sdl 0x1fd324(%rip), %xmm1 # 0x229a88
divsd %xmm1, %xmm0
movsd %xmm0, 0x858(%rsp)
movsd 0x858(%rsp), %xmm0
movsd %xmm0, 0x130(%rsp)
movsd 0x1fd305(%rip), %xmm0   # 0x229a90
callq 0x234f0
movaps %xmm0, %xmm1
movsd 0x130(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x237e0
movsd %xmm0, 0x850(%rsp)
movl 0x1fd2d0(%rip), %eax    # 0x229a84
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0x84c(%rsp)
movl 0x1fd2b8(%rip), %eax    # 0x229a84
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0x848(%rsp)
movl 0x1fd2a0(%rip), %eax    # 0x229a84
movl %eax, 0x844(%rsp)
movl $0x0, 0x840(%rsp)
movl 0x840(%rsp), %eax
movl %eax, 0x12c(%rsp)
movq 0x20342d(%rip), %rdi    # 0x22fc38
callq 0x321c0
movl %eax, %ecx
movl 0x12c(%rsp), %eax
cmpl %ecx, %eax
jge 0x2d28c
movq 0x203410(%rip), %rdi    # 0x22fc38
movl 0x840(%rsp), %esi
callq 0x32430
movq %rax, 0x838(%rsp)
movq 0x838(%rsp), %rdi
callq 0x2fe80
cmpl $0x0, %eax
jne 0x2c853
jmp 0x2d25a
movq 0x838(%rsp), %rdi
callq 0x60be0
movq %rax, %rsi
leaq 0x800(%rsp), %rdi
movq %rdi, 0x120(%rsp)
callq 0xc4a10
movq 0x120(%rsp), %rdi
callq 0x35a30
movl %eax, 0x128(%rsp)
jmp 0x2c88e
movl 0x128(%rsp), %eax
cmpl $0x0, %eax
je 0x2c8c3
movl $0x4, 0x7f0(%rsp)
jmp 0x2d23c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
jmp 0x2d27d
leaq 0x800(%rsp), %rdi
callq 0xc6350
movsd %xmm0, 0x118(%rsp)
jmp 0x2c8db
movsd 0x118(%rsp), %xmm0
leaq 0x1fd99d(%rip), %rax    # 0x22a288
movsd (%rax), %xmm1
callq 0x33240
movl %eax, 0x114(%rsp)
jmp 0x2c8fd
movl 0x114(%rsp), %eax
cmpl $0x0, %eax
je 0x2c919
movl $0x4, 0x7f0(%rsp)
jmp 0x2d23c
leaq 0x720(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xf12b0
jmp 0x2c92c
movq 0x838(%rsp), %rdi
callq 0x32460
cmpq $0x0, %rax
je 0x2c9ba
movq 0x838(%rsp), %rdi
callq 0x32460
movq %rax, %rdi
leaq 0x18ee2c(%rip), %rsi    # 0x1bb782
movl $0x5, %edx
callq 0x23430
cmpl $0x0, %eax
jne 0x2c9ba
movq 0x838(%rsp), %rdi
leaq 0x720(%rsp), %rsi
callq 0x2ff10
movl %eax, 0x110(%rsp)
jmp 0x2c983
movl 0x110(%rsp), %eax
cmpl $0x0, %eax
jne 0x2c9b8
movl $0x4, 0x7f0(%rsp)
jmp 0x2d22f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
jmp 0x2d270
jmp 0x2c9ba
leaq 0x192c27(%rip), %rax    # 0x1bf5e8
movsd (%rax), %xmm0
divsd 0x203233(%rip), %xmm0   # 0x22fc00
movsd 0x18e65b(%rip), %xmm1   # 0x1bb030
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x71c(%rsp)
cmpl $0x1, 0x71c(%rsp)
jle 0x2ca11
leaq 0x192bf3(%rip), %rax    # 0x1bf5e8
movsd (%rax), %xmm0
cvtsi2sdl 0x71c(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%rsp)
jmp 0x2ca25
leaq 0x192bd0(%rip), %rax    # 0x1bf5e8
movsd (%rax), %xmm0
movsd %xmm0, 0x108(%rsp)
movsd 0x108(%rsp), %xmm0
movsd %xmm0, 0x710(%rsp)
movl $0x0, 0x70c(%rsp)
movl 0x70c(%rsp), %eax
cmpl 0x71c(%rsp), %eax
jge 0x2d224
leaq 0x678(%rsp), %rdi
callq 0x67570
jmp 0x2ca65
leaq 0x800(%rsp), %rdi
callq 0x33460
movq %rax, %rdi
movl 0x84c(%rsp), %esi
callq 0x33470
movsd %xmm0, 0x670(%rsp)
movsd 0x670(%rsp), %xmm0
movsd %xmm0, 0x100(%rsp)
leaq 0x800(%rsp), %rdi
callq 0x33490
movq %rax, %rdi
movl 0x84c(%rsp), %esi
callq 0x33470
movsd 0x100(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2d0ef
leaq 0x800(%rsp), %rdi
callq 0x33460
movq %rax, %rdi
movl 0x848(%rsp), %esi
callq 0x33470
movsd %xmm0, 0x668(%rsp)
movsd 0x668(%rsp), %xmm0
movsd %xmm0, 0xf8(%rsp)
leaq 0x800(%rsp), %rdi
callq 0x33490
movq %rax, %rdi
movl 0x848(%rsp), %esi
callq 0x33470
movsd 0xf8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2d0ce
leaq 0x658(%rsp), %rdi
callq 0x10e480
jmp 0x2cb40
movsd 0x670(%rsp), %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0x1fcf6e(%rip), %xmm0   # 0x229ac8
movsd %xmm0, 0xe8(%rsp)
callq 0x11f4d0
movsd %xmm0, 0xf0(%rsp)
jmp 0x2cb73
movsd 0xe0(%rsp), %xmm1
movsd 0xf0(%rsp), %xmm2
movsd 0xe8(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xc0(%rsp)
leaq 0x658(%rsp), %rdi
xorl %esi, %esi
callq 0x334a0
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x668(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0x1fcef3(%rip), %xmm0   # 0x229ac8
movsd %xmm0, 0xd0(%rsp)
callq 0x11f4d0
movsd %xmm0, 0xd8(%rsp)
jmp 0x2cbee
movsd 0xc8(%rsp), %xmm1
movsd 0xd8(%rsp), %xmm2
movsd 0xd0(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
leaq 0x658(%rsp), %rdi
movl $0x1, %esi
callq 0x334a0
movsd 0xb8(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x720(%rsp), %rdi
callq 0x33520
cmpl $0x0, %eax
jle 0x2cc97
leaq 0x720(%rsp), %rdi
leaq 0x658(%rsp), %rsi
callq 0x35af0
movsd %xmm0, 0xb0(%rsp)
jmp 0x2cc6b
movsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0x650(%rsp)
movsd 0x18e3ab(%rip), %xmm0   # 0x1bb030
ucomisd 0x650(%rsp), %xmm0
jbe 0x2cc95
jmp 0x2d0af
jmp 0x2cc97
leaq 0x638(%rsp), %rdi
callq 0xd9f30
jmp 0x2cca6
movsd 0x1fcdea(%rip), %xmm0   # 0x229a98
movsd %xmm0, 0xa0(%rsp)
callq 0x11f4d0
movsd %xmm0, 0xa8(%rsp)
jmp 0x2ccc7
movsd 0xa0(%rsp), %xmm1
movsd 0xa8(%rsp), %xmm0
movsd 0x18e367(%rip), %xmm2   # 0x1bb048
addsd %xmm2, %xmm0
addsd %xmm0, %xmm0
movsd 0x1fcdaf(%rip), %xmm2   # 0x229aa0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x630(%rsp)
leaq 0x658(%rsp), %rdi
movq %rdi, 0x70(%rsp)
xorl %esi, %esi
callq 0x334a0
movsd (%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movl 0x84c(%rsp), %esi
leaq 0x638(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x32510
movsd 0x68(%rsp), %xmm0
movq 0x70(%rsp), %rdi
movsd %xmm0, (%rax)
movl $0x1, %esi
callq 0x334a0
movq 0x90(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movl 0x848(%rsp), %esi
callq 0x32510
movsd 0x78(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x800(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x33460
movq %rax, %rdi
movl 0x1fcce9(%rip), %esi    # 0x229a84
callq 0x33470
movq 0x90(%rsp), %rdi
movsd 0x630(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x80(%rsp)
movl 0x844(%rsp), %esi
callq 0x32510
movsd 0x80(%rsp), %xmm0
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rsi
movsd %xmm0, (%rax)
callq 0x7e4d0
movl %eax, 0x9c(%rsp)
jmp 0x2cdf5
movl 0x9c(%rsp), %eax
cmpl $0x0, %eax
jne 0x2ce06
jmp 0x2d0af
cvtsi2sdl 0x70c(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
callq 0x11f4d0
movsd %xmm0, 0x60(%rsp)
jmp 0x2ce22
movsd 0x60(%rsp), %xmm1
movsd 0x58(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd 0x710(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x628(%rsp)
leaq 0x20cd59(%rip), %rsi    # 0x239ba8
leaq 0x618(%rsp), %rdi
callq 0x10efb0
jmp 0x2ce5e
movsd 0x628(%rsp), %xmm0
leaq 0x618(%rsp), %rdi
callq 0x10f4c0
jmp 0x2ce76
leaq 0x618(%rsp), %rdi
callq 0x10f3e0
jmp 0x2ce85
leaq 0x600(%rsp), %rdi
callq 0xdb090
jmp 0x2ce94
leaq 0x618(%rsp), %rdi
movq %rdi, 0x40(%rsp)
xorl %esi, %esi
callq 0x334c0
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movl 0x84c(%rsp), %esi
leaq 0x600(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x334e0
movsd 0x38(%rsp), %xmm0
movq 0x40(%rsp), %rdi
movsd %xmm0, (%rax)
movl $0x1, %esi
callq 0x334c0
movq 0x50(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movl 0x848(%rsp), %esi
callq 0x334e0
movsd 0x48(%rsp), %xmm0
movq 0x50(%rsp), %rdi
movsd %xmm0, (%rax)
movl 0x844(%rsp), %esi
callq 0x334e0
movq 0x50(%rsp), %rdi
movabsq $-0x4036666666666666, %rcx # imm = 0xBFC999999999999A
movq %rcx, (%rax)
callq 0xdb800
jmp 0x2cf33
movl 0x1fcb4b(%rip), %esi    # 0x229a84
leaq 0x20bb68(%rip), %rdi    # 0x238aa8
callq 0x32530
movq %rax, 0x30(%rsp)
jmp 0x2cf4c
movq 0x30(%rsp), %rdx
leaq 0x5e8(%rsp), %rdi
leaq 0x600(%rsp), %rsi
callq 0xdbee0
jmp 0x2cf68
leaq 0x5e8(%rsp), %rdi
callq 0xdb800
jmp 0x2cf77
leaq 0x5d0(%rsp), %rdi
leaq 0x5e8(%rsp), %rsi
leaq 0x600(%rsp), %rdx
callq 0xdbee0
jmp 0x2cf96
leaq 0x5d0(%rsp), %rdi
callq 0xdb800
jmp 0x2cfa5
movsd 0x1fcae3(%rip), %xmm0   # 0x229a90
movsd 0x850(%rsp), %xmm1
movsd 0x868(%rsp), %xmm2
movsd 0x860(%rsp), %xmm3
leaq 0x540(%rsp), %rdi
leaq 0x638(%rsp), %rsi
leaq 0x600(%rsp), %rdx
leaq 0x5d0(%rsp), %rcx
callq 0x67810
jmp 0x2cfef
movq 0x202c42(%rip), %rsi    # 0x22fc38
movq 0x838(%rsp), %rdx
leaq 0x540(%rsp), %rdi
movl $0x1, %ecx
callq 0x2f130
movsd %xmm0, 0x28(%rsp)
jmp 0x2d018
movsd 0x28(%rsp), %xmm0
leaq 0x540(%rsp), %rdi
callq 0x32350
leaq 0x540(%rsp), %rdi
callq 0x32550
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2d045
jp 0x2d045
jmp 0x2d0af
leaq 0x540(%rsp), %rdi
callq 0x32550
movaps %xmm0, %xmm1
movsd 0x202b93(%rip), %xmm0   # 0x22fbf0
ucomisd %xmm1, %xmm0
jbe 0x2d065
jmp 0x2d0af
leaq 0x540(%rsp), %rdi
callq 0x32550
movsd %xmm0, 0x20(%rsp)
leaq 0x678(%rsp), %rdi
callq 0x32550
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2d0ad
leaq 0x678(%rsp), %rdi
leaq 0x540(%rsp), %rsi
callq 0x68860
jmp 0x2d0ab
jmp 0x2d0ad
jmp 0x2d0af
movsd 0x1fca11(%rip), %xmm0   # 0x229ac8
addsd 0x668(%rsp), %xmm0
movsd %xmm0, 0x668(%rsp)
jmp 0x2caf0
jmp 0x2d0d0
movsd 0x1fc9f0(%rip), %xmm0   # 0x229ac8
addsd 0x670(%rsp), %xmm0
movsd %xmm0, 0x670(%rsp)
jmp 0x2ca8a
leaq 0x678(%rsp), %rdi
callq 0x32550
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2d20c
cmpl $0x0, 0x202aa8(%rip)    # 0x22fbb8
je 0x2d157
movq 0x838(%rsp), %rdi
callq 0x32460
movq %rax, 0x10(%rsp)
movl 0x70c(%rsp), %eax
movl %eax, 0x1c(%rsp)
leaq 0x678(%rsp), %rdi
callq 0x32550
movq 0x10(%rsp), %rsi
movl 0x1c(%rsp), %edx
leaq 0x18e63c(%rip), %rdi    # 0x1bb788
movb $0x1, %al
callq 0x23090
jmp 0x2d155
jmp 0x2d157
movq 0x838(%rsp), %rdi
callq 0x32460
movq %rax, %rdx
movl 0x70c(%rsp), %ecx
leaq 0x18e624(%rip), %rsi    # 0x1bb799
xorl %eax, %eax
leaq 0x140(%rsp), %rdi
callq 0x23150
movl $0x98, %edi
callq 0x239b0
movq %rax, 0x8(%rsp)
jmp 0x2d195
movq 0x8(%rsp), %rdi
leaq 0x678(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x32570
jmp 0x2d1b1
movq 0x8(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rsi
leaq 0x2029b3(%rip), %rdi    # 0x22fb80
callq 0x32370
jmp 0x2d1d4
movl 0x874(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x874(%rsp)
jmp 0x2d20c
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7f8(%rsp)
movl %eax, 0x7f4(%rsp)
movl $0x98, %esi
callq 0x239d0
jmp 0x2d270
jmp 0x2d20e
movl 0x70c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70c(%rsp)
jmp 0x2ca42
movl $0x0, 0x7f0(%rsp)
leaq 0x720(%rsp), %rdi
callq 0xf2760
leaq 0x800(%rsp), %rdi
callq 0x33500
movl 0x7f0(%rsp), %eax
testl %eax, %eax
je 0x2d258
jmp 0x2d256
jmp 0x2d25a
jmp 0x2d25a
movl 0x840(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x840(%rsp)
jmp 0x2c7f6
leaq 0x720(%rsp), %rdi
callq 0xf2760
leaq 0x800(%rsp), %rdi
callq 0x33500
jmp 0x2d2f6
cmpl $0x0, 0x202921(%rip)    # 0x22fbb4
je 0x2d2ee
leaq 0x18e503(%rip), %rdi    # 0x1bb79f
movb $0x0, %al
callq 0x23090
leaq 0x878(%rsp), %rdi
callq 0x11bb90
leaq 0x18e183(%rip), %rdi    # 0x1bb43a
movb $0x1, %al
callq 0x23090
movl 0x874(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x874(%rsp)
leaq 0x18e227(%rip), %rdi    # 0x1bb4ff
movb $0x0, %al
callq 0x23090
movq 0x1fbcaa(%rip), %rax    # 0x228f90
movq (%rax), %rdi
callq 0x23bc0
addq $0x888, %rsp            # imm = 0x888
retq
movq 0x7f8(%rsp), %rdi
callq 0x24250
nopw %cs:(%rax,%rax)