#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 */
scalar_t__ ceil(double);
void adjustSpatialResolution(float fieldOfView, int *imageDimension,
                             float *spatialResolution) {
  *imageDimension = (int)ceil(10.0 * fieldOfView / (*spatialResolution));
  *imageDimension += (*imageDimension) % 2;
  *spatialResolution = 10.0f * fieldOfView / *imageDimension;
}


x86 assembly (clang, -O0):
<adjustSpatialResolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
add    (%rax),%edx
mov    %edx,(%rax)
movss  0xe8b(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustSpatialResolution>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xeda(%rip),%xmm0
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %eax,%edx
sub    %ecx,%edx
add    %eax,%edx
mov    %edx,(%r14)
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
movss  0x4(%rsp),%xmm1
mulss  0xea3(%rip),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @adjustSpatialResolution(float %0, i32* %1, float* %2) {
%4 = alloca float
%5 = alloca i32*
%6 = alloca float*
store float %0, float* %4
store i32* %1, i32** %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fmul double 1.000000e+01, %8
%10 = load float*, float** %6
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = fdiv double %9, %12
%14 = call i64 @ceil(double %13)
%15 = trunc i64 %14 to i32
%16 = load i32*, i32** %5
store i32 %15, i32* %16
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = srem i32 %18, 2
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = add nsw i32 %21, %19
store i32 %22, i32* %20
%23 = load float, float* %4
%24 = fmul float 1.000000e+01, %23
%25 = load i32*, i32** %5
%26 = load i32, i32* %25
%27 = sitofp i32 %26 to float
%28 = fdiv float %24, %27
%29 = load float*, float** %6
store float %28, float* %29
ret void
}

LLVM IR (-O2):
define void @adjustSpatialResolution(float %0, i32* nocapture writeonly %1, float* nocapture %2) {
%4 = fpext float %0 to double
%5 = fmul double %4, 1.000000e+01
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fdiv double %5, %7
%9 = tail call i64 @ceil(double %8)
%10 = trunc i64 %9 to i32
%11 = srem i32 %10, 2
%12 = add nsw i32 %11, %10
store i32 %12, i32* %1
%13 = fmul float %0, 1.000000e+01
%14 = sitofp i32 %12 to float
%15 = fdiv float %13, %14
store float %15, float* %2
ret void
}