#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);
int /*<<< orphan*/ printf(char *, unsigned long);
void printOutput(int n, unsigned long *cases) {
  int i;
  for (i = 0; i < n; i++) {
    unsigned long s = (unsigned long)ceil(0.5 * *(cases + i));
    printf("%lu\n", s);
  }
}


x86 assembly (clang, -O0):
<printOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a4 <printOutput+0x84>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   (%rax,%rcx,8),%xmm1
movaps 0xeba(%rip),%xmm0
punpckldq %xmm0,%xmm1
movapd 0xebe(%rip),%xmm0
subpd  %xmm0,%xmm1
movaps %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <printOutput+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printOutput>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1182 <printOutput+0x62>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xeed(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm1
unpcklps 0xeb3(%rip),%xmm1
subpd  0xebb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xeb7(%rip),%xmm0
call   1030 <ceil@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printOutput+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define void @printOutput(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
store i32 0, i32* %5
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i64*, i64** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %12, i64 %14
%16 = load i64, i64* %15
%17 = uitofp i64 %16 to double
%18 = fmul double 5.000000e-01, %17
%19 = call i64 @ceil(double %18)
store i64 %19, i64* %6
%20 = load i64, i64* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %20)
br label %22
22: ; preds = %11
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define void @printOutput(i32 %0, i64* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %14, %6 ]
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = uitofp i64 %9 to double
%11 = fmul double %10, 5.000000e-01
%12 = tail call i64 @ceil(double %11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %6, %2
ret void
}