#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int FILENAME_MAX;
int /*<<< orphan*/ assert(int);
float atof(char *);
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
float *io_png_read_f32_rgb(char *, size_t *, size_t *);
int log(float);
float pow(int, int);
scalar_t__ round(int);
int /*<<< orphan*/ sift_add_gaussian_blur(float *, float *, int, int, float);
int /*<<< orphan*/ sift_oversample_bilin(float *, size_t, size_t, float *, int,
                                         int, float);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
float sqrt(float);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ subsample_by_intfactor(float *, float *, int, int, float);
int /*<<< orphan*/ thumbnail(float, float, float, float, float *, int, int, int,
                             char *);
float *xmalloc(int);
int main(int argc, char **argv) {
  if (argc != 14) {
    fprintf(stderr, " Illustrates: - the reference orientation computation \n");
    fprintf(stderr, "              - the descriptor computation \n");
    fprintf(stderr, "Usage: extract image,    \n");
    fprintf(stderr, "                   x, y, sigma, theta, \n");
    fprintf(stderr, "                               delta_min, sigma_min, "
                    "sigma_in, n_spo, \n");
    fprintf(stderr, "                                               "
                    "lambda_ori, lambda_descr, nhist, Name \n");
    fprintf(stderr, "\n");
    fprintf(stderr, "     outputs : - [Name]_thumbnail_ori_hist.png\n");
    fprintf(stderr, "               - [Name]_thumbnail_weighted_hists.png\n");
    fprintf(stderr, "\n");
    fprintf(stderr,
            "extract image x y sigma theta 0.5 0.8 0.5 3 1.5 6 4 Name \n");
    return -1;
  }
  char filename[FILENAME_MAX];
  size_t width, height;
  float *image = io_png_read_f32_rgb(argv[1], &width, &height);
  float x = atof(argv[2]);
  float y = atof(argv[3]);
  float sigma = atof(argv[4]);
  float theta = atof(argv[5]);
  float delta_min = atof(argv[6]);
  float sigma_min = atof(argv[7]);
  float sigma_in = atof(argv[8]);
  int nspo = atoi(argv[9]);
  float lambda_ori = atof(argv[10]);
  float lambda_descr = atof(argv[11]);
  int nhist = atoi(argv[12]);
  int oct, sca;
  int a = (int)(round(nspo * log(sigma / sigma_min) / 0.693147180559945309417));
  oct = (a - 1) / nspo;
  if (oct > -1) {
    sca = (a - 1) % nspo + 1;
  } else {
    oct = 0;
    sca = 0;
  }
  int width_seed = (int)(width / delta_min);
  int height_seed = (int)(height / delta_min);
  float *seed = xmalloc(width_seed * height_seed * sizeof(float));
  assert(delta_min <= 1);
  sift_oversample_bilin(image, width, height, seed, width_seed, height_seed,
                        delta_min);
  float delta_o = delta_min * pow(2, oct);
  int width_o = (int)((float)width_seed / pow(2, oct));
  int height_o = (int)((float)height_seed / pow(2, oct));
  float *im_o_s = xmalloc(width_o * height_o * sizeof(float));
  float sigma_o_s =
      delta_o * sigma_min / delta_min * pow(2, (float)sca / (float)nspo);
  float *im_temp = xmalloc(width_seed * height_seed * sizeof(float));
  float sig_blur = sqrt(sigma_o_s * sigma_o_s - sigma_in * sigma_in);
  sift_add_gaussian_blur(seed, im_temp, width_seed, height_seed, sig_blur);
  subsample_by_intfactor(im_temp, im_o_s, width_seed, height_seed, pow(2, oct));
  snprintf(filename, FILENAME_MAX, "%s_thumbnail_ori_hist.png", argv[13]);
  thumbnail(x / delta_o, y / delta_o, sigma / delta_o, 0.0, im_o_s, width_o,
            height_o, 3 * lambda_ori, filename);
  sprintf(filename, "%s_thumbnail_weighted_hists.png", argv[13]);
  thumbnail(x / delta_o, y / delta_o, sigma / delta_o, theta, im_o_s, width_o,
            height_o, (nhist + 1) * lambda_descr / nhist, filename);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xe,-0x8(%rbp)
je     1316 <main+0x116>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
lea    0xddd(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
lea    0xe00(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
lea    0xe18(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
lea    0xe1e(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
lea    0xe32(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d45(%rip),%rax
mov    (%rax),%edi
lea    0xe65(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d30(%rip),%rax
mov    (%rax),%edi
lea    0xddd(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edi
lea    0xd9e(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   10a0 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1885 <main+0x685>
mov    0x2ccb(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xb8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1050 <io_png_read_f32_rgb@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x54(%rbp)
mov    -0x10(%rbp),%rax
mov    0x48(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x50(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x58(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    0x60(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x64(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0xb0(%rbp)
movss  -0x44(%rbp),%xmm0
divss  -0x50(%rbp),%xmm0
call   10c0 <log@plt>
mov    %eax,%ecx
mov    -0xb0(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xbb1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10e0 <round@plt>
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x58(%rbp)
mov    %eax,-0x68(%rbp)
cmpl   $0xffffffff,-0x68(%rbp)
jle    148b <main+0x28b>
mov    -0x70(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x58(%rbp)
add    $0x1,%edx
mov    %edx,-0x6c(%rbp)
jmp    1499 <main+0x299>
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0xc0(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xbc(%rbp)
ff
js     14e2 <main+0x2e2>
movss  -0xc0(%rbp),%xmm0
ff
movss  %xmm0,-0xbc(%rbp)
ff
movss  -0xbc(%rbp),%xmm0
ff
movss  -0x4c(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x74(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0xc8(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xc4(%rbp)
ff
js     1543 <main+0x343>
movss  -0xc8(%rbp),%xmm0
ff
movss  %xmm0,-0xc4(%rbp)
ff
movss  -0xc4(%rbp),%xmm0
ff
divss  -0x4c(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x78(%rbp)
mov    -0x74(%rbp),%eax
imul   -0x78(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <xmalloc@plt>
mov    %rax,-0x80(%rbp)
movss  0xa95(%rip),%xmm0
ucomiss -0x4c(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x80(%rbp),%rcx
mov    -0x74(%rbp),%r8d
mov    -0x78(%rbp),%r9d
movss  -0x4c(%rbp),%xmm0
call   1040 <sift_oversample_bilin@plt>
movss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0xf0(%rbp)
ff
mov    -0x68(%rbp),%esi
mov    $0x2,%edi
call   10d0 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xf0(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
cvtsi2ssl -0x74(%rbp),%xmm0
movss  %xmm0,-0xec(%rbp)
ff
mov    -0x68(%rbp),%esi
mov    $0x2,%edi
call   10d0 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xec(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x88(%rbp)
cvtsi2ssl -0x78(%rbp),%xmm0
movss  %xmm0,-0xe8(%rbp)
ff
mov    -0x68(%rbp),%esi
mov    $0x2,%edi
call   10d0 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xe8(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x88(%rbp),%eax
imul   -0x8c(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <xmalloc@plt>
mov    %rax,-0x98(%rbp)
movss  -0x84(%rbp),%xmm0
ff
mulss  -0x50(%rbp),%xmm0
divss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0xe4(%rbp)
ff
cvtsi2ssl -0x6c(%rbp),%xmm0
cvtsi2ssl -0x58(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   10d0 <pow@plt>
movaps %xmm0,%xmm1
movss  -0xe4(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
mov    -0x74(%rbp),%eax
imul   -0x78(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <xmalloc@plt>
mov    %rax,-0xa8(%rbp)
movss  -0x9c(%rbp),%xmm0
ff
movss  -0x9c(%rbp),%xmm2
ff
movss  -0x54(%rbp),%xmm1
mulss  -0x54(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1100 <sqrt@plt>
movss  %xmm0,-0xac(%rbp)
ff
mov    -0x80(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    -0x74(%rbp),%edx
mov    -0x78(%rbp),%ecx
movss  -0xac(%rbp),%xmm0
ff
call   1080 <sift_add_gaussian_blur@plt>
mov    -0xa8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0xd0(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0x68(%rbp),%esi
mov    $0x2,%edi
call   10d0 <pow@plt>
mov    -0xe0(%rbp),%rdi
mov    -0xd8(%rbp),%rsi
mov    -0xd0(%rbp),%edx
mov    -0xcc(%rbp),%ecx
call   10b0 <subsample_by_intfactor@plt>
mov    -0xb8(%rbp),%rdi
mov    0x285c(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x68(%rax),%rcx
lea    0xa5c(%rip),%rdx
call   1060 <snprintf@plt>
mov    -0xb8(%rbp),%r8
movss  -0x3c(%rbp),%xmm0
divss  -0x84(%rbp),%xmm0
ff
movss  -0x40(%rbp),%xmm1
divss  -0x84(%rbp),%xmm1
ff
movss  -0x44(%rbp),%xmm2
divss  -0x84(%rbp),%xmm2
ff
mov    -0x98(%rbp),%rdi
mov    -0x88(%rbp),%esi
mov    -0x8c(%rbp),%edx
movss  0x81d(%rip),%xmm3
mulss  -0x5c(%rbp),%xmm3
cvttss2si %xmm3,%ecx
xorps  %xmm3,%xmm3
call   1120 <thumbnail@plt>
mov    -0xb8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x68(%rax),%rdx
lea    0xa01(%rip),%rsi
call   1110 <sprintf@plt>
mov    -0xb8(%rbp),%r8
movss  -0x3c(%rbp),%xmm0
divss  -0x84(%rbp),%xmm0
ff
movss  -0x40(%rbp),%xmm1
divss  -0x84(%rbp),%xmm1
ff
movss  -0x44(%rbp),%xmm2
divss  -0x84(%rbp),%xmm2
ff
movss  -0x48(%rbp),%xmm3
mov    -0x98(%rbp),%rdi
mov    -0x88(%rbp),%esi
mov    -0x8c(%rbp),%edx
mov    -0x64(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm4
mulss  -0x60(%rbp),%xmm4
cvtsi2ssl -0x64(%rbp),%xmm5
divss  %xmm5,%xmm4
cvttss2si %xmm4,%ecx
call   1120 <thumbnail@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
cmp    $0xe,%edi
jne    1345 <main+0x145>
mov    %rsi,%r13
mov    %rsp,-0xc8(%rbp)
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0xc0(%rbp)
mov    %rcx,%rsp
mov    0x8(%rsi),%rdi
lea    -0xa0(%rbp),%rsi
lea    -0x98(%rbp),%rdx
call   1050 <io_png_read_f32_rgb@plt>
mov    %rax,-0x48(%rbp)
mov    0x10(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x3c(%rbp)
mov    0x18(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x38(%rbp)
mov    0x20(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x34(%rbp)
mov    0x28(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x64(%rbp)
mov    0x30(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x2c(%rbp)
mov    0x38(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x30(%rbp)
mov    0x40(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x58(%rbp)
mov    0x48(%r13),%rdi
call   10f0 <atoi@plt>
mov    %eax,%ebx
mov    0x50(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x5c(%rbp)
mov    0x58(%r13),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x60(%rbp)
mov    0x60(%r13),%rdi
call   10f0 <atoi@plt>
mov    %rax,-0xb8(%rbp)
movss  -0x34(%rbp),%xmm0
divss  -0x30(%rbp),%xmm0
call   10c0 <log@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xce3(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   10e0 <round@plt>
add    $0xffffffff,%eax
cltd
mov    %ebx,-0x54(%rbp)
idiv   %ebx
add    $0x1,%edx
xor    %esi,%esi
test   %eax,%eax
jns    13ef <main+0x1ef>
xorpd  %xmm0,%xmm0
jmp    13f6 <main+0x1f6>
mov    0x2c8c(%rip),%rbx
mov    (%rbx),%edi
lea    0xcbf(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xce9(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd08(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd15(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd30(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xd6a(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xce9(%rip),%r14
mov    %r14,%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xda2(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdc4(%rip),%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xde2(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    16fe <main+0x4fe>
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
cmovns %eax,%esi
mov    -0xa0(%rbp),%rax
test   %rax,%rax
js     140c <main+0x20c>
cvtsi2ss %rax,%xmm1
jmp    1421 <main+0x221>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm1
divss  -0x2c(%rbp),%xmm1
cvttss2si %xmm1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x98(%rbp),%rax
test   %rax,%rax
js     1440 <main+0x240>
cvtsi2ss %rax,%xmm2
jmp    1455 <main+0x255>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm2
addss  %xmm2,%xmm2
movaps %xmm1,-0x80(%rbp)
divss  -0x2c(%rbp),%xmm2
movaps %xmm2,-0x90(%rbp)
mov    %esi,-0x50(%rbp)
cvttss2si %xmm2,%r12d
mov    -0x40(%rbp),%ebx
mov    %ebx,%r15d
imul   %r12d,%r15d
shl    $0x2,%r15d
mov    %r15d,%edi
movss  %xmm0,-0x4c(%rbp)
call   1070 <xmalloc@plt>
mov    %rax,%r14
movss  0xb75(%rip),%xmm0
xor    %edi,%edi
ucomiss -0x2c(%rbp),%xmm0
setae  %dil
call   1090 <assert@plt>
mov    -0xa0(%rbp),%rsi
mov    -0x98(%rbp),%rdx
mov    -0x48(%rbp),%rdi
mov    %r14,-0xa8(%rbp)
mov    %r14,%rcx
mov    %r12d,%r14d
mov    -0x50(%rbp),%r12d
mov    %ebx,%r8d
mov    %r14d,%r9d
movss  -0x2c(%rbp),%xmm0
call   1040 <sift_oversample_bilin@plt>
mov    $0x2,%edi
mov    %r12d,%esi
call   10d0 <pow@plt>
mulss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
cvttps2dq -0x80(%rbp),%xmm0
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,-0x80(%rbp)
mov    $0x2,%edi
mov    %r12d,%esi
call   10d0 <pow@plt>
movaps -0x80(%rbp),%xmm1
divss  %xmm0,%xmm1
cvttss2si %xmm1,%ebx
cvttps2dq -0x90(%rbp),%xmm0
ff
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,-0x90(%rbp)
mov    $0x2,%edi
mov    %r12d,%esi
call   10d0 <pow@plt>
movaps -0x90(%rbp),%xmm1
divss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
mov    %ebx,-0x90(%rbp)
mov    %ebx,%edi
mov    %eax,-0x80(%rbp)
imul   %eax,%edi
shl    $0x2,%edi
call   1070 <xmalloc@plt>
mov    %rax,-0xb0(%rbp)
movss  -0x30(%rbp),%xmm1
mulss  -0x48(%rbp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2ssl -0x54(%rbp),%xmm0
divss  -0x2c(%rbp),%xmm1
movss  %xmm1,-0x30(%rbp)
movss  -0x4c(%rbp),%xmm1
divss  %xmm0,%xmm1
cvttss2si %xmm1,%esi
mov    $0x2,%edi
call   10d0 <pow@plt>
mulss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    %r15d,%edi
call   1070 <xmalloc@plt>
mov    %rax,%r15
movss  -0x58(%rbp),%xmm0
mulss  %xmm0,%xmm0
movss  -0x2c(%rbp),%xmm1
mulss  %xmm1,%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ucomiss 0xa4c(%rip),%xmm1
jb     15cc <main+0x3cc>
sqrtss %xmm0,%xmm0
jmp    15d1 <main+0x3d1>
call   1100 <sqrt@plt>
mov    -0xa8(%rbp),%rdi
mov    %r15,%rsi
mov    -0x40(%rbp),%ebx
mov    %ebx,%edx
mov    %r14d,%ecx
call   1080 <sift_add_gaussian_blur@plt>
mov    $0x2,%edi
mov    %r12d,%esi
call   10d0 <pow@plt>
mov    %r15,%rdi
mov    -0xb0(%rbp),%r12
mov    %r12,%rsi
mov    %ebx,%edx
mov    %r14d,%ecx
call   10b0 <subsample_by_intfactor@plt>
mov    0x29d5(%rip),%rax
mov    (%rax),%esi
mov    0x68(%r13),%rcx
lea    0xbdd(%rip),%rdx
mov    -0xc0(%rbp),%rbx
mov    %rbx,%rdi
call   1060 <snprintf@plt>
movss  -0x3c(%rbp),%xmm1
movss  -0x48(%rbp),%xmm2
divss  %xmm2,%xmm1
movaps %xmm1,%xmm0
movss  %xmm1,-0x3c(%rbp)
movss  -0x38(%rbp),%xmm1
divss  %xmm2,%xmm1
movss  %xmm1,-0x38(%rbp)
movss  -0x34(%rbp),%xmm3
divss  %xmm2,%xmm3
movaps %xmm3,%xmm2
movss  %xmm3,-0x34(%rbp)
movss  -0x5c(%rbp),%xmm3
mulss  0x99b(%rip),%xmm3
cvttss2si %xmm3,%ecx
xorps  %xmm3,%xmm3
mov    %r12,%rdi
mov    -0x90(%rbp),%r14d
mov    %r14d,%esi
mov    -0x80(%rbp),%r15d
mov    %r15d,%edx
mov    %rbx,%r8
call   1120 <thumbnail@plt>
mov    0x68(%r13),%rdx
lea    0xb78(%rip),%rsi
mov    %rbx,%rdi
call   1110 <sprintf@plt>
mov    -0xb8(%rbp),%rcx
lea    0x1(%rcx),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
movss  -0x60(%rbp),%xmm2
mulss  %xmm0,%xmm2
divss  %xmm1,%xmm2
cvttss2si %xmm2,%ecx
movss  -0x3c(%rbp),%xmm0
movss  -0x38(%rbp),%xmm1
movss  -0x34(%rbp),%xmm2
movss  -0x64(%rbp),%xmm3
mov    %r12,%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %rbx,%r8
call   1120 <thumbnail@plt>
xor    %eax,%eax
mov    -0xc8(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c" Illustrates: - the reference orientation computation \0A\00"
@.str.1 = [45 x i8] c" - the descriptor computation \0A\00"
@.str.2 = [27 x i8] c"Usage: extract image, \0A\00"
@.str.3 = [41 x i8] c" x, y, sigma, theta, \0A\00"
@.str.4 = [72 x i8] c" delta_min, sigma_min, sigma_in, n_spo, \0A\00"
@.str.5 = [87 x i8] c" lambda_ori, lambda_descr, nhist, Name \0A\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [48 x i8] c" outputs : - [Name]_thumbnail_ori_hist.png\0A\00"
@.str.8 = [54 x i8] c" - [Name]_thumbnail_weighted_hists.png\0A\00"
@.str.9 = [59 x i8] c"extract image x y sigma theta 0.5 0.8 0.5 3 1.5 6 4 Name \0A\00"
@FILENAME_MAX = global i32 0
@.str.10 = [26 x i8] c"%s_thumbnail_ori_hist.png\00"
@.str.11 = [32 x i8] c"%s_thumbnail_weighted_hists.png\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca float*
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca i32
%19 = alloca float
%20 = alloca float
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca float*
%28 = alloca float
%29 = alloca i32
%30 = alloca i32
%31 = alloca float*
%32 = alloca float
%33 = alloca float*
%34 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%35 = load i32, i32* %4
%36 = icmp ne i32 %35, 14
br i1 %36, label %37, label %60
37: ; preds = %2
%38 = load i32, i32* @stderr
%39 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0))
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%52 = load i32, i32* @stderr
%53 = call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%58 = load i32, i32* @stderr
%59 = call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %3
br label %280
60: ; preds = %2
%61 = load i32, i32* @FILENAME_MAX
%62 = zext i32 %61 to i64
%63 = call i8* @llvm.stacksave()
store i8* %63, i8** %6
%64 = alloca i8, i64 %62
store i64 %62, i64* %7
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call float* @io_png_read_f32_rgb(i8* %67, i64* %8, i64* %9)
store float* %68, float** %10
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 2
%71 = load i8*, i8** %70
%72 = call float @atof(i8* %71)
store float %72, float* %11
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 3
%75 = load i8*, i8** %74
%76 = call float @atof(i8* %75)
store float %76, float* %12
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 4
%79 = load i8*, i8** %78
%80 = call float @atof(i8* %79)
store float %80, float* %13
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 5
%83 = load i8*, i8** %82
%84 = call float @atof(i8* %83)
store float %84, float* %14
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 6
%87 = load i8*, i8** %86
%88 = call float @atof(i8* %87)
store float %88, float* %15
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 7
%91 = load i8*, i8** %90
%92 = call float @atof(i8* %91)
store float %92, float* %16
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 8
%95 = load i8*, i8** %94
%96 = call float @atof(i8* %95)
store float %96, float* %17
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 9
%99 = load i8*, i8** %98
%100 = call i32 @atoi(i8* %99)
store i32 %100, i32* %18
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 10
%103 = load i8*, i8** %102
%104 = call float @atof(i8* %103)
store float %104, float* %19
%105 = load i8**, i8*** %5
%106 = getelementptr inbounds i8*, i8** %105, i64 11
%107 = load i8*, i8** %106
%108 = call float @atof(i8* %107)
store float %108, float* %20
%109 = load i8**, i8*** %5
%110 = getelementptr inbounds i8*, i8** %109, i64 12
%111 = load i8*, i8** %110
%112 = call i32 @atoi(i8* %111)
store i32 %112, i32* %21
%113 = load i32, i32* %18
%114 = load float, float* %13
%115 = load float, float* %16
%116 = fdiv float %114, %115
%117 = call i32 @log(float %116)
%118 = mul nsw i32 %113, %117
%119 = sitofp i32 %118 to double
%120 = fdiv double %119, 0x3FE62E42FEFA39EF
%121 = fptosi double %120 to i32
%122 = call i64 @round(i32 %121)
%123 = trunc i64 %122 to i32
store i32 %123, i32* %24
%124 = load i32, i32* %24
%125 = sub nsw i32 %124, 1
%126 = load i32, i32* %18
%127 = sdiv i32 %125, %126
store i32 %127, i32* %22
%128 = load i32, i32* %22
%129 = icmp sgt i32 %128, -1
br i1 %129, label %130, label %136
130: ; preds = %60
%131 = load i32, i32* %24
%132 = sub nsw i32 %131, 1
%133 = load i32, i32* %18
%134 = srem i32 %132, %133
%135 = add nsw i32 %134, 1
store i32 %135, i32* %23
br label %137
136: ; preds = %60
store i32 0, i32* %22
store i32 0, i32* %23
br label %137
137: ; preds = %136, %130
%138 = load i64, i64* %8
%139 = uitofp i64 %138 to float
%140 = load float, float* %15
%141 = fdiv float %139, %140
%142 = fptosi float %141 to i32
store i32 %142, i32* %25
%143 = load i64, i64* %9
%144 = uitofp i64 %143 to float
%145 = load float, float* %15
%146 = fdiv float %144, %145
%147 = fptosi float %146 to i32
store i32 %147, i32* %26
%148 = load i32, i32* %25
%149 = load i32, i32* %26
%150 = mul nsw i32 %148, %149
%151 = sext i32 %150 to i64
%152 = mul i64 %151, 4
%153 = trunc i64 %152 to i32
%154 = call float* @xmalloc(i32 %153)
store float* %154, float** %27
%155 = load float, float* %15
%156 = fcmp ole float %155, 1.000000e+00
%157 = zext i1 %156 to i32
%158 = call i32 @assert(i32 %157)
%159 = load float*, float** %10
%160 = load i64, i64* %8
%161 = load i64, i64* %9
%162 = load float*, float** %27
%163 = load i32, i32* %25
%164 = load i32, i32* %26
%165 = load float, float* %15
%166 = call i32 @sift_oversample_bilin(float* %159, i64 %160, i64 %161, float* %162, i32 %163, i32 %164, float %165)
%167 = load float, float* %15
%168 = load i32, i32* %22
%169 = call float @pow(i32 2, i32 %168)
%170 = fmul float %167, %169
store float %170, float* %28
%171 = load i32, i32* %25
%172 = sitofp i32 %171 to float
%173 = load i32, i32* %22
%174 = call float @pow(i32 2, i32 %173)
%175 = fdiv float %172, %174
%176 = fptosi float %175 to i32
store i32 %176, i32* %29
%177 = load i32, i32* %26
%178 = sitofp i32 %177 to float
%179 = load i32, i32* %22
%180 = call float @pow(i32 2, i32 %179)
%181 = fdiv float %178, %180
%182 = fptosi float %181 to i32
store i32 %182, i32* %30
%183 = load i32, i32* %29
%184 = load i32, i32* %30
%185 = mul nsw i32 %183, %184
%186 = sext i32 %185 to i64
%187 = mul i64 %186, 4
%188 = trunc i64 %187 to i32
%189 = call float* @xmalloc(i32 %188)
store float* %189, float** %31
%190 = load float, float* %28
%191 = load float, float* %16
%192 = fmul float %190, %191
%193 = load float, float* %15
%194 = fdiv float %192, %193
%195 = load i32, i32* %23
%196 = sitofp i32 %195 to float
%197 = load i32, i32* %18
%198 = sitofp i32 %197 to float
%199 = fdiv float %196, %198
%200 = fptosi float %199 to i32
%201 = call float @pow(i32 2, i32 %200)
%202 = fmul float %194, %201
store float %202, float* %32
%203 = load i32, i32* %25
%204 = load i32, i32* %26
%205 = mul nsw i32 %203, %204
%206 = sext i32 %205 to i64
%207 = mul i64 %206, 4
%208 = trunc i64 %207 to i32
%209 = call float* @xmalloc(i32 %208)
store float* %209, float** %33
%210 = load float, float* %32
%211 = load float, float* %32
%212 = load float, float* %17
%213 = load float, float* %17
%214 = fmul float %212, %213
%215 = fneg float %214
%216 = call float @llvm.fmuladd.f32(float %210, float %211, float %215)
%217 = call float @sqrt(float %216)
store float %217, float* %34
%218 = load float*, float** %27
%219 = load float*, float** %33
%220 = load i32, i32* %25
%221 = load i32, i32* %26
%222 = load float, float* %34
%223 = call i32 @sift_add_gaussian_blur(float* %218, float* %219, i32 %220, i32 %221, float %222)
%224 = load float*, float** %33
%225 = load float*, float** %31
%226 = load i32, i32* %25
%227 = load i32, i32* %26
%228 = load i32, i32* %22
%229 = call float @pow(i32 2, i32 %228)
%230 = call i32 @subsample_by_intfactor(float* %224, float* %225, i32 %226, i32 %227, float %229)
%231 = load i32, i32* @FILENAME_MAX
%232 = load i8**, i8*** %5
%233 = getelementptr inbounds i8*, i8** %232, i64 13
%234 = load i8*, i8** %233
%235 = call i32 @snprintf(i8* %64, i32 %231, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %234)
%236 = load float, float* %11
%237 = load float, float* %28
%238 = fdiv float %236, %237
%239 = load float, float* %12
%240 = load float, float* %28
%241 = fdiv float %239, %240
%242 = load float, float* %13
%243 = load float, float* %28
%244 = fdiv float %242, %243
%245 = load float*, float** %31
%246 = load i32, i32* %29
%247 = load i32, i32* %30
%248 = load float, float* %19
%249 = fmul float 3.000000e+00, %248
%250 = fptosi float %249 to i32
%251 = call i32 @thumbnail(float %238, float %241, float %244, float 0.000000e+00, float* %245, i32 %246, i32 %247, i32 %250, i8* %64)
%252 = load i8**, i8*** %5
%253 = getelementptr inbounds i8*, i8** %252, i64 13
%254 = load i8*, i8** %253
%255 = call i32 @sprintf(i8* %64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i8* %254)
%256 = load float, float* %11
%257 = load float, float* %28
%258 = fdiv float %256, %257
%259 = load float, float* %12
%260 = load float, float* %28
%261 = fdiv float %259, %260
%262 = load float, float* %13
%263 = load float, float* %28
%264 = fdiv float %262, %263
%265 = load float, float* %14
%266 = load float*, float** %31
%267 = load i32, i32* %29
%268 = load i32, i32* %30
%269 = load i32, i32* %21
%270 = add nsw i32 %269, 1
%271 = sitofp i32 %270 to float
%272 = load float, float* %20
%273 = fmul float %271, %272
%274 = load i32, i32* %21
%275 = sitofp i32 %274 to float
%276 = fdiv float %273, %275
%277 = fptosi float %276 to i32
%278 = call i32 @thumbnail(float %258, float %261, float %264, float %265, float* %266, i32 %267, i32 %268, i32 %277, i8* %64)
%279 = load i8*, i8** %6
br label %280
280: ; preds = %137, %37
%281 = load i32, i32* %3
ret i32 %281
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c" Illustrates: - the reference orientation computation \0A\00"
@.str.1 = [45 x i8] c" - the descriptor computation \0A\00"
@.str.2 = [27 x i8] c"Usage: extract image, \0A\00"
@.str.3 = [41 x i8] c" x, y, sigma, theta, \0A\00"
@.str.4 = [72 x i8] c" delta_min, sigma_min, sigma_in, n_spo, \0A\00"
@.str.5 = [87 x i8] c" lambda_ori, lambda_descr, nhist, Name \0A\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [48 x i8] c" outputs : - [Name]_thumbnail_ori_hist.png\0A\00"
@.str.8 = [54 x i8] c" - [Name]_thumbnail_weighted_hists.png\0A\00"
@.str.9 = [59 x i8] c"extract image x y sigma theta 0.5 0.8 0.5 3 1.5 6 4 Name \0A\00"
@FILENAME_MAX = global i32 0
@.str.10 = [26 x i8] c"%s_thumbnail_ori_hist.png\00"
@.str.11 = [32 x i8] c"%s_thumbnail_weighted_hists.png\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i64
%5 = icmp eq i32 %0, 14
br i1 %5, label %29, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = tail call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0))
br label %152
29: ; preds = %2
%30 = load i32, i32* @FILENAME_MAX
%31 = zext i32 %30 to i64
%32 = tail call i8* @llvm.stacksave()
%33 = alloca i8, i64 %31
%34 = bitcast i64* %3 to i8*
%35 = bitcast i64* %4 to i8*
%36 = getelementptr inbounds i8*, i8** %1, i64 1
%37 = load i8*, i8** %36
%38 = call float* @io_png_read_f32_rgb(i8* %37, i64* %3, i64* %4)
%39 = getelementptr inbounds i8*, i8** %1, i64 2
%40 = load i8*, i8** %39
%41 = call float @atof(i8* %40)
%42 = getelementptr inbounds i8*, i8** %1, i64 3
%43 = load i8*, i8** %42
%44 = call float @atof(i8* %43)
%45 = getelementptr inbounds i8*, i8** %1, i64 4
%46 = load i8*, i8** %45
%47 = call float @atof(i8* %46)
%48 = getelementptr inbounds i8*, i8** %1, i64 5
%49 = load i8*, i8** %48
%50 = call float @atof(i8* %49)
%51 = getelementptr inbounds i8*, i8** %1, i64 6
%52 = load i8*, i8** %51
%53 = call float @atof(i8* %52)
%54 = getelementptr inbounds i8*, i8** %1, i64 7
%55 = load i8*, i8** %54
%56 = call float @atof(i8* %55)
%57 = getelementptr inbounds i8*, i8** %1, i64 8
%58 = load i8*, i8** %57
%59 = call float @atof(i8* %58)
%60 = getelementptr inbounds i8*, i8** %1, i64 9
%61 = load i8*, i8** %60
%62 = call i32 @atoi(i8* %61)
%63 = getelementptr inbounds i8*, i8** %1, i64 10
%64 = load i8*, i8** %63
%65 = call float @atof(i8* %64)
%66 = getelementptr inbounds i8*, i8** %1, i64 11
%67 = load i8*, i8** %66
%68 = call float @atof(i8* %67)
%69 = getelementptr inbounds i8*, i8** %1, i64 12
%70 = load i8*, i8** %69
%71 = call i32 @atoi(i8* %70)
%72 = fdiv float %47, %56
%73 = call i32 @log(float %72)
%74 = mul nsw i32 %73, %62
%75 = sitofp i32 %74 to double
%76 = fdiv double %75, 0x3FE62E42FEFA39EF
%77 = fptosi double %76 to i32
%78 = call i64 @round(i32 %77)
%79 = trunc i64 %78 to i32
%80 = add nsw i32 %79, -1
%81 = sdiv i32 %80, %62
%82 = srem i32 %80, %62
%83 = icmp sgt i32 %81, -1
%84 = add nsw i32 %82, 1
%85 = sitofp i32 %84 to float
%86 = select i1 %83, float %85, float 0.000000e+00
%87 = select i1 %83, i32 %81, i32 0
%88 = load i64, i64* %3
%89 = uitofp i64 %88 to float
%90 = fdiv float %89, %53
%91 = fptosi float %90 to i32
%92 = load i64, i64* %4
%93 = uitofp i64 %92 to float
%94 = fdiv float %93, %53
%95 = fptosi float %94 to i32
%96 = shl i32 %91, 2
%97 = mul i32 %96, %95
%98 = call float* @xmalloc(i32 %97)
%99 = fcmp ole float %53, 1.000000e+00
%100 = zext i1 %99 to i32
%101 = call i32 @assert(i32 %100)
%102 = load i64, i64* %3
%103 = load i64, i64* %4
%104 = call i32 @sift_oversample_bilin(float* %38, i64 %102, i64 %103, float* %98, i32 %91, i32 %95, float %53)
%105 = call float @pow(i32 2, i32 %87)
%106 = fmul float %53, %105
%107 = sitofp i32 %91 to float
%108 = call float @pow(i32 2, i32 %87)
%109 = fdiv float %107, %108
%110 = fptosi float %109 to i32
%111 = sitofp i32 %95 to float
%112 = call float @pow(i32 2, i32 %87)
%113 = fdiv float %111, %112
%114 = fptosi float %113 to i32
%115 = shl i32 %110, 2
%116 = mul i32 %115, %114
%117 = call float* @xmalloc(i32 %116)
%118 = fmul float %56, %106
%119 = fdiv float %118, %53
%120 = sitofp i32 %62 to float
%121 = fdiv float %86, %120
%122 = fptosi float %121 to i32
%123 = call float @pow(i32 2, i32 %122)
%124 = fmul float %119, %123
%125 = call float* @xmalloc(i32 %97)
%126 = fneg float %59
%127 = fmul float %59, %126
%128 = call float @llvm.fmuladd.f32(float %124, float %124, float %127)
%129 = call float @sqrt(float %128)
%130 = call i32 @sift_add_gaussian_blur(float* %98, float* %125, i32 %91, i32 %95, float %129)
%131 = call float @pow(i32 2, i32 %87)
%132 = call i32 @subsample_by_intfactor(float* %125, float* %117, i32 %91, i32 %95, float %131)
%133 = load i32, i32* @FILENAME_MAX
%134 = getelementptr inbounds i8*, i8** %1, i64 13
%135 = load i8*, i8** %134
%136 = call i32 @snprintf(i8* %33, i32 %133, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %135)
%137 = fdiv float %41, %106
%138 = fdiv float %44, %106
%139 = fdiv float %47, %106
%140 = fmul float %65, 3.000000e+00
%141 = fptosi float %140 to i32
%142 = call i32 @thumbnail(float %137, float %138, float %139, float 0.000000e+00, float* %117, i32 %110, i32 %114, i32 %141, i8* %33)
%143 = load i8*, i8** %134
%144 = call i32 @sprintf(i8* %33, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0), i8* %143)
%145 = add nsw i32 %71, 1
%146 = sitofp i32 %145 to float
%147 = fmul float %68, %146
%148 = sitofp i32 %71 to float
%149 = fdiv float %147, %148
%150 = fptosi float %149 to i32
%151 = call i32 @thumbnail(float %137, float %138, float %139, float %50, float* %117, i32 %110, i32 %114, i32 %150, i8* %33)
br label %152
152: ; preds = %29, %6
%153 = phi i32 [ -1, %6 ], [ 0, %29 ]
ret i32 %153
}