#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 ceil(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ printframe(int, int, int *);
int main() {
  int x = 1;
  int y = ceil(x / 8.0);
  printf("\nValue is %d\n", y);
  int frame[2][17] = {{255, 254, 252, 248, 240, 224, 192, 128, 0, 128, 192, 224,
                       240, 248, 252, 254, 255},
                      {0, 128, 192, 224, 240, 248, 252, 254, 255, 254, 252, 248,
                       240, 224, 192, 128, 0}};
  printframe(17, 16, (int *)frame);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x1,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x88,%edx
call   1060 <memcpy@plt>
lea    -0x90(%rbp),%rdx
mov    $0x11,%edi
mov    $0x10,%esi
call   1050 <printframe@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
xor    %edi,%edi
call   1030 <ceil@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeac(%rip),%rsi
mov    %rsp,%rbx
mov    $0x88,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
mov    $0x11,%edi
mov    $0x10,%esi
mov    %rbx,%rdx
call   1050 <printframe@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0AValue is %d\0A\00"
@__const.main.frame = [2 x [17 x i32]] [[17 x i32] [i32 255, i32 254, i32 252, i32 248, i32 240, i32 224, i32 192, i32 128, i32 0, i32 128, i32 192, i32 224, i32 240, i32 248, i32 252, i32 254, i32 255], [17 x i32] [i32 0, i32 128, i32 192, i32 224, i32 240, i32 248, i32 252, i32 254, i32 255, i32 254, i32 252, i32 248, i32 240, i32 224, i32 192, i32 128, i32 0]]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x [17 x i32]]
store i32 1, i32* %1
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 8.000000e+00
%7 = fptosi double %6 to i32
%8 = call i32 @ceil(i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = bitcast [2 x [17 x i32]]* %3 to i8*
%12 = getelementptr inbounds [2 x [17 x i32]], [2 x [17 x i32]]* %3, i64 0, i64 0
%13 = bitcast [17 x i32]* %12 to i32*
%14 = call i32 @printframe(i32 17, i32 16, i32* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AValue is %d\0A\00"
@__const.main.frame = [2 x [17 x i32]] [[17 x i32] [i32 255, i32 254, i32 252, i32 248, i32 240, i32 224, i32 192, i32 128, i32 0, i32 128, i32 192, i32 224, i32 240, i32 248, i32 252, i32 254, i32 255], [17 x i32] [i32 0, i32 128, i32 192, i32 224, i32 240, i32 248, i32 252, i32 254, i32 255, i32 254, i32 252, i32 248, i32 240, i32 224, i32 192, i32 128, i32 0]]
define i32 @main() {
%1 = alloca [2 x [17 x i32]]
%2 = tail call i32 @ceil(i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = bitcast [2 x [17 x i32]]* %1 to i8*
%5 = getelementptr inbounds [2 x [17 x i32]], [2 x [17 x i32]]* %1, i64 0, i64 0, i64 0
%6 = call i32 @printframe(i32 17, i32 16, i32* %5)
ret i32 0
}