xunge/DecIR huggingface dataset:
void radius_server_deinit(struct radius_server_data *data) {}


x86 assembly (clang, -O0):
<radius_server_deinit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_server_deinit>:
ret

LLVM IR (-O0):
%struct.radius_server_data = type opaque
define void @radius_server_deinit(%struct.radius_server_data* %0) {
%2 = alloca %struct.radius_server_data*
store %struct.radius_server_data* %0, %struct.radius_server_data** %2
ret void
}

LLVM IR (-O2):
%struct.radius_server_data = type opaque
define void @radius_server_deinit(%struct.radius_server_data* nocapture %0) {
ret void
}
double sinus(double f) {
  f = 3.14 * 30 / 180;
  asm volatile("fldl %0;"
               "fsin;"
               "fstpl %0;"
               : "+m"(f));
  printf("\nResult %10.3f", sinus(f));
  return f;
}


x86 assembly (clang, -O0):
<sinus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
fsin
fstpl  -0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sinus@plt>
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinus>:
push   %rax
movabs $0x3fe0bf258bf258bf,%rax
bf e0 3f
mov    %rax,(%rsp)
fldl   (%rsp)
fsin
fstpl  (%rsp)
call   1040 <sinus@plt>
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0AResult %10.3f\00"
define double @sinus(double %0) {
%2 = alloca double
store double %0, double* %2
store double 0x3FE0BF258BF258BF, double* %2
%3 = load double, double* %2
%4 = call double @sinus(double %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %4)
%6 = load double, double* %2
ret double %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0AResult %10.3f\00"
define double @sinus(double %0) {
%2 = alloca double
store double 0x3FE0BF258BF258BF, double* %2
%3 = call double @sinus(double undef)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %3)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ CompileArgument();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Put(void) {
  CompileArgument();
  WriteInstruction("call drpobj");
}


x86 assembly (clang, -O0):
<CR_Put>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CompileArgument@plt>
lea    0xece(%rip),%rdi
call   1040 <WriteInstruction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Put>:
push   %rax
xor    %eax,%eax
call   1030 <CompileArgument@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"call drpobj\00"
define void @CR_Put() {
%1 = call i32 (...) @CompileArgument()
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"call drpobj\00"
define void @CR_Put() {
%1 = tail call i32 (...) @CompileArgument()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo149() {}


x86 assembly (clang, -O0):
<foo149>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo149>:
ret

LLVM IR (-O0):
define void @foo149() {
ret void
}

LLVM IR (-O2):
define void @foo149() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void linkmaperr(void) { panic("linkmap"); }


x86 assembly (clang, -O0):
<linkmaperr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linkmaperr>:
lea    0xee9(%rip),%rdi
jmp    1030 <panic@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"linkmap\00"
define void @linkmaperr() {
%1 = call i32 @panic(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"linkmap\00"
define void @linkmaperr() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int punctuation(char c) {
  if (c != ' ' && c != '\t' && c != '\n' && c != '.')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<punctuation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     114a <punctuation+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     114a <punctuation+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     114a <punctuation+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     114a <punctuation+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <punctuation+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<punctuation>:
mov    $0x1,%eax
cmp    $0x2e,%dil
ja     1121 <punctuation+0x21>
movzbl %dil,%ecx
movabs $0x400100000600,%rdx
bt     %rcx,%rdx
jae    1121 <punctuation+0x21>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @punctuation(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 32
br i1 %6, label %7, label %20
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 46
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11, %7, %1
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @punctuation(i8 signext %0) {
switch i8 %0, label %3 [
i8 46, label %2
i8 32, label %2
i8 10, label %2
i8 9, label %2
]
2: ; preds = %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM1_BRK_TIM9_IRQHandler() { default_handler(); }


x86 assembly (clang, -O0):
<TIM1_BRK_TIM9_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <default_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIM1_BRK_TIM9_IRQHandler>:
xor    %eax,%eax
jmp    1030 <default_handler@plt>

LLVM IR (-O0):
define weak void @TIM1_BRK_TIM9_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM1_BRK_TIM9_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void radeon_bo_unmap(struct radeon_bo *bo) { return; }


x86 assembly (clang, -O0):
<radeon_bo_unmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<radeon_bo_unmap>:
ret

LLVM IR (-O0):
%struct.radeon_bo = type opaque
define void @radeon_bo_unmap(%struct.radeon_bo* %0) {
%2 = alloca %struct.radeon_bo*
store %struct.radeon_bo* %0, %struct.radeon_bo** %2
ret void
}

LLVM IR (-O2):
%struct.radeon_bo = type opaque
define void @radeon_bo_unmap(%struct.radeon_bo* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
int getc(FILE *stream) { fgetc(stream); }


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define i32 @getc(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @fgetc(i32* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @getc(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret i32 undef
}
int signum(float a) { return (a == 0) ? 0 : (a < 0 ? -1 : 1); }


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112a <signum+0x2a>
jp     112a <signum+0x2a>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <signum+0x45>
movss  -0x4(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomiss %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @signum(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp olt float %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 1
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 0, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @signum(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, i32 -1, i32 1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int equal(int *, int *, int);
int /*<<< orphan*/ sort(int *, int);
int test_sort_rand() {
  int array[] = {9, 4, 3, 8, 5};
  int expected[] = {9, 4, 8, 3, 5};
  sort(array, 5);
  return equal(expected, array, 5);
}


x86 assembly (clang, -O0):
<test_sort_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sort_rand>:
push   %rbx
sub    $0x40,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeef(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_sort_rand.array = [5 x i32] [i32 9, i32 4, i32 3, i32 8, i32 5]
@__const.test_sort_rand.expected = [5 x i32] [i32 9, i32 4, i32 8, i32 3, i32 5]
define i32 @test_sort_rand() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = call i32 @equal(i32* %7, i32* %8, i32 5)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_sort_rand.array = [5 x i32] [i32 9, i32 4, i32 3, i32 8, i32 5]
@__const.test_sort_rand.expected = [5 x i32] [i32 9, i32 4, i32 8, i32 3, i32 5]
define i32 @test_sort_rand() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @equal(i32* %7, i32* %5, i32 5)
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t uint32_decode(const uint8_t *p_encoded_data) {
  return ((((uint32_t)((uint8_t *)p_encoded_data)[0]) << 0) |
          (((uint32_t)((uint8_t *)p_encoded_data)[1]) << 8) |
          (((uint32_t)((uint8_t *)p_encoded_data)[2]) << 16) |
          (((uint32_t)((uint8_t *)p_encoded_data)[3]) << 24));
}


x86 assembly (clang, -O0):
<uint32_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_decode>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @uint32_decode(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 0
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
%14 = load i64*, i64** %2
%15 = getelementptr inbounds i64, i64* %14, i64 2
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 16
%19 = or i32 %13, %18
%20 = load i64*, i64** %2
%21 = getelementptr inbounds i64, i64* %20, i64 3
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = shl i32 %23, 24
%25 = or i32 %19, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @uint32_decode(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
int mm_init(void) { return 0; }


x86 assembly (clang, -O0):
<mm_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mm_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mm_init() {
ret i32 0
}
int size(char *string) {
  int i;
  for (i = 0; string[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <size+0x37>
jmp    1129 <size+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <size+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <size+0x10>
ret

LLVM IR (-O0):
define i32 @size(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @size(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ do_y_filter16(short *, short *, int, int, short *, int, int);
int gradY16(short *src, short *dst, int w, int h) {
  short mask[3] = {-1, 0, 1};
  do_y_filter16(src, dst, w, h, mask, 3, 1);
  return 1;
}


x86 assembly (clang, -O0):
<gradY16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x1e(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    -0x1e(%rbp),%r8
mov    $0x3,%r9d
movl   $0x1,(%rsp)
call   1030 <do_y_filter16@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gradY16>:
sub    $0x18,%rsp
movzwl 0xee9(%rip),%eax
mov    %ax,0x14(%rsp)
mov    0xeda(%rip),%eax
mov    %eax,0x10(%rsp)
movl   $0x1,(%rsp)
lea    0x10(%rsp),%r8
mov    $0x3,%r9d
call   1030 <do_y_filter16@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.gradY16.mask = [3 x i16] [i16 -1, i16 0, i16 1]
define i32 @gradY16(i16* %0, i16* %1, i32 %2, i32 %3) {
%5 = alloca i16*
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i16]
store i16* %0, i16** %5
store i16* %1, i16** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = bitcast [3 x i16]* %9 to i8*
%11 = load i16*, i16** %5
%12 = load i16*, i16** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = getelementptr inbounds [3 x i16], [3 x i16]* %9, i64 0, i64 0
%16 = call i32 @do_y_filter16(i16* %11, i16* %12, i32 %13, i32 %14, i16* %15, i32 3, i32 1)
ret i32 1
}

LLVM IR (-O2):
@__const.gradY16.mask = [3 x i16] [i16 -1, i16 0, i16 1]
define i32 @gradY16(i16* %0, i16* %1, i32 %2, i32 %3) {
%5 = alloca [3 x i16]
%6 = bitcast [3 x i16]* %5 to i8*
%7 = getelementptr inbounds [3 x i16], [3 x i16]* %5, i64 0, i64 0
%8 = call i32 @do_y_filter16(i16* %0, i16* %1, i32 %2, i32 %3, i16* %7, i32 3, i32 1)
ret i32 1
}
void vararg1_test() {
  vararg1(0);
  vararg1(1, (void *)0);
  vararg1(2, (void *)0, (void *)0);
  vararg1(2, (void *)&vararg1, (void *)0);
}


x86 assembly (clang, -O0):
<vararg1_test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x0,%al
call   1030 <vararg1@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <vararg1@plt>
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <vararg1@plt>
mov    $0x2,%edi
mov    0x2eac(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1030 <vararg1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vararg1_test>:
push   %rbx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <vararg1@plt>
mov    0x2ed7(%rip),%rbx
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <vararg1@plt>
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <vararg1@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <vararg1@plt>

LLVM IR (-O0):
define void @vararg1_test() {
%1 = call i32 (i32, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, ...)*)(i32 0)
%2 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, i8*, ...)*)(i32 1, i8* null)
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* null, i8* null)
%4 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* bitcast (i32 (...)* @vararg1 to i8*), i8* null)
ret void
}

LLVM IR (-O2):
define void @vararg1_test() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, ...)*)(i32 0)
%2 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, i8*, ...)*)(i32 1, i8* null)
%3 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* null, i8* null)
%4 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @vararg1 to i32 (i32, i8*, i8*, ...)*)(i32 2, i8* bitcast (i32 (...)* @vararg1 to i8*), i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imc(float, float);
int main() {
  float pesoBrutus = 122, alturaBrutus = 1.84, imcBrutus;
  float pesoOlivia = 45, alturaOlivia = 1.76, imcOlivia;
  imc(alturaBrutus, pesoBrutus);
  imc(alturaOlivia, pesoOlivia);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec3(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <imc@plt>
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <imc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
movss  0xee3(%rip),%xmm1
call   1030 <imc@plt>
movss  0xeda(%rip),%xmm0
movss  0xed6(%rip),%xmm1
call   1030 <imc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store float 1.220000e+02, float* %2
store float 0x3FFD70A3E0000000, float* %3
store float 4.500000e+01, float* %5
store float 0x3FFC28F5C0000000, float* %6
%8 = load float, float* %3
%9 = load float, float* %2
%10 = call i32 @imc(float %8, float %9)
%11 = load float, float* %6
%12 = load float, float* %5
%13 = call i32 @imc(float %11, float %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @imc(float 0x3FFD70A3E0000000, float 1.220000e+02)
%2 = tail call i32 @imc(float 0x3FFC28F5C0000000, float 4.500000e+01)
ret i32 0
}
void echo_sigpipe_handler(int signal) {}


x86 assembly (clang, -O0):
<echo_sigpipe_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_sigpipe_handler>:
ret

LLVM IR (-O0):
define void @echo_sigpipe_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @echo_sigpipe_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ term_move_r(int, int /*<<< orphan*/);
void term_move_x(int x) {
  putchar('\r');
  term_move_r(x, 0);
}


x86 assembly (clang, -O0):
<term_move_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <term_move_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_move_x>:
push   %rbx
mov    %edi,%ebx
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <term_move_r@plt>

LLVM IR (-O0):
define void @term_move_x(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @putchar(i8 signext 13)
%4 = load i32, i32* %2
%5 = call i32 @term_move_r(i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
define void @term_move_x(i32 %0) {
%2 = tail call i32 @putchar(i8 signext 13)
%3 = tail call i32 @term_move_r(i32 %0, i32 0)
ret void
}
void GB_LXOR_f_FP32(float *z, const float *x, const float *y) {
  (*z) = (((*x) != 0) != ((*y) != 0));
}


x86 assembly (clang, -O0):
<GB_LXOR_f_FP32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
movss  (%rcx),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %cl
setp   %dl
or     %dl,%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_LXOR_f_FP32>:
xorps  %xmm0,%xmm0
ucomiss (%rsi),%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomiss (%rdx),%xmm0
setp   %al
setne  %dl
or     %al,%dl
xor    %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GB_LXOR_f_FP32(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = load float, float* %7
%9 = fcmp une float %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = fcmp une float %12, 0.000000e+00
%14 = zext i1 %13 to i32
%15 = icmp ne i32 %10, %14
%16 = zext i1 %15 to i32
%17 = sitofp i32 %16 to float
%18 = load float*, float** %4
store float %17, float* %18
ret void
}

LLVM IR (-O2):
define void @GB_LXOR_f_FP32(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = fcmp une float %4, 0.000000e+00
%6 = load float, float* %2
%7 = fcmp une float %6, 0.000000e+00
%8 = xor i1 %5, %7
%9 = uitofp i1 %8 to float
store float %9, float* %0
ret void
}
unsigned int tf_I(unsigned int c) { return c / 3; }


x86 assembly (clang, -O0):
<tf_I>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_I>:
mov    %edi,%ecx
mov    $0xaaaaaaab,%eax
imul   %rcx,%rax
shr    $0x21,%rax
ret

LLVM IR (-O0):
define i32 @tf_I(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 3
ret i32 %4
}

LLVM IR (-O2):
define i32 @tf_I(i32 %0) {
%2 = udiv i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ banktitle(char *);
void obank() { banktitle("    Welcome to the First National Bank of Ularn."); }


x86 assembly (clang, -O0):
<obank>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <banktitle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<obank>:
lea    0xee9(%rip),%rdi
jmp    1030 <banktitle@plt>

LLVM IR (-O0):
@.str = [49 x i8] c" Welcome to the First National Bank of Ularn.\00"
define void @obank() {
%1 = call i32 @banktitle(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c" Welcome to the First National Bank of Ularn.\00"
define void @obank() {
%1 = tail call i32 @banktitle(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}
void am_init(void) {}


x86 assembly (clang, -O0):
<am_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_init>:
ret

LLVM IR (-O0):
define void @am_init() {
ret void
}

LLVM IR (-O2):
define void @am_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Write(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void not_found(int sockfd) {
  char msg[] = "HTTP/1.1 404 NOT FOUND\r\n"
               "Server: Anywhere\r\n"
               "Content-Type: text/plain\r\n"
               "\r\n"
               "not found\r\n";
  Write(sockfd, msg, strlen(msg));
}


x86 assembly (clang, -O0):
<not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x52,%edx
call   1050 <memcpy@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x6c(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rsi
mov    %eax,%edx
call   1040 <Write@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found>:
push   %rbp
push   %rbx
sub    $0x58,%rsp
mov    %edi,%ebp
movaps 0xf11(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea1(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0xa,0x50(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <Write@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.not_found.msg = [82 x i8] c"HTTP/1.1 404 NOT FOUND\0D\0AServer: Anywhere\0D\0AContent-Type: text/plain\0D\0A\0D\0Anot found\0D\0A\00"
define void @not_found(i32 %0) {
%2 = alloca i32
%3 = alloca [82 x i8]
store i32 %0, i32* %2
%4 = bitcast [82 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @Write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
@__const.not_found.msg = [82 x i8] c"HTTP/1.1 404 NOT FOUND\0D\0AServer: Anywhere\0D\0AContent-Type: text/plain\0D\0A\0D\0Anot found\0D\0A\00"
define void @not_found(i32 %0) {
%2 = alloca [82 x i8]
%3 = getelementptr inbounds [82 x i8], [82 x i8]* %2, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @Write(i32 %0, i8* %3, i32 %4)
ret void
}
void rule_dgp_act_copy(const struct XCSF *xcsf, struct Cl *dest,
                       const struct Cl *src) {
  (void)xcsf;
  (void)dest;
  (void)src;
}


x86 assembly (clang, -O0):
<rule_dgp_act_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rule_dgp_act_copy>:
ret

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_act_copy(%struct.XCSF* %0, %struct.Cl* %1, %struct.Cl* %2) {
%4 = alloca %struct.XCSF*
%5 = alloca %struct.Cl*
%6 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %4
store %struct.Cl* %1, %struct.Cl** %5
store %struct.Cl* %2, %struct.Cl** %6
%7 = load %struct.XCSF*, %struct.XCSF** %4
%8 = load %struct.Cl*, %struct.Cl** %5
%9 = load %struct.Cl*, %struct.Cl** %6
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_act_copy(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, %struct.Cl* nocapture %2) {
ret void
}
void FastStepRobot(struct Robot *robot) {}


x86 assembly (clang, -O0):
<FastStepRobot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastStepRobot>:
ret

LLVM IR (-O0):
%struct.Robot = type opaque
define void @FastStepRobot(%struct.Robot* %0) {
%2 = alloca %struct.Robot*
store %struct.Robot* %0, %struct.Robot** %2
ret void
}

LLVM IR (-O2):
%struct.Robot = type opaque
define void @FastStepRobot(%struct.Robot* nocapture %0) {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ putchar(char);
void Char_input(void) {
  char c;
  c = getchar();
  putchar(c);
  printf("\nSimon: %c\n", c);
}


x86 assembly (clang, -O0):
<Char_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
lea    0xeae(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Char_input>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\0ASimon: %c\0A\00"
define void @Char_input() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call i32 @putchar(i8 signext %3)
%5 = load i8, i8* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0ASimon: %c\0A\00"
define void @Char_input() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i32 @putchar(i8 signext %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %1)
ret void
}
/* Variables and functions */
size_t randgen(int);
char rand_letter_upcase(void) {
  return "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[randgen(26)];
}


x86 assembly (clang, -O0):
<rand_letter_upcase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
call   1030 <randgen@plt>
mov    %rax,%rcx
lea    0xed8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_letter_upcase>:
push   %rax
mov    $0x1a,%edi
call   1030 <randgen@plt>
lea    0xede(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define signext i8 @rand_letter_upcase() {
%1 = call i64 @randgen(i32 26)
%2 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %1
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define signext i8 @rand_letter_upcase() {
%1 = tail call i64 @randgen(i32 26)
%2 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %1
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  sleep(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 2)
ret i32 0
}
char *uptospace(char *s) {
  while (*s != 0 && *s > ' ')
    s++;
  return (s);
}


x86 assembly (clang, -O0):
<uptospace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <uptospace+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <uptospace+0x3d>
jmp    114e <uptospace+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <uptospace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptospace>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
jg     1110 <uptospace+0x10>
ret

LLVM IR (-O0):
define i8* @uptospace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 32
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @uptospace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp sgt i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
int ls_cost_nm3_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_cost_nm3_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_cost_nm3_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_cost_nm3_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_cost_nm3_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_cost_nm3_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm3_work>:
test   %rdi,%rdi
je     110b <ls_cost_nm3_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <ls_cost_nm3_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_cost_nm3_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_cost_nm3_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ls_cost_nm3_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 2, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 1, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @ls_cost_nm3_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
char *fgaj_yellow(int c) { return c ? "[1;33m" : ""; }


x86 assembly (clang, -O0):
<fgaj_yellow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef6(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgaj_yellow>:
test   %edi,%edi
lea    0xefe(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[1;33m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @fgaj_yellow(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[1;33m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @fgaj_yellow(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int /*<<< orphan*/ reverse_memcpy(void *, void *, int);
void int32_to_bytes(int32_t source, unsigned char bytes[4], int switch_endian) {
  void *dest_ptr = (void *)bytes;
  void *source_ptr = (void *)&source;
  if (switch_endian) {
    reverse_memcpy(dest_ptr, source_ptr, 4);
  } else {
    memcpy(dest_ptr, source_ptr, 4);
  }
}


x86 assembly (clang, -O0):
<int32_to_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1163 <int32_to_bytes+0x43>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   1030 <reverse_memcpy@plt>
jmp    1175 <int32_to_bytes+0x55>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int32_to_bytes>:
push   %rax
mov    %rsi,%rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
test   %edx,%edx
je     1140 <int32_to_bytes+0x20>
mov    $0x4,%edx
call   1030 <reverse_memcpy@plt>
pop    %rax
ret
mov    $0x4,%edx
call   1040 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @int32_to_bytes(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
store i8* %9, i8** %7
%10 = bitcast i32* %4 to i8*
store i8* %10, i8** %8
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @reverse_memcpy(i8* %14, i8* %15, i32 4)
br label %21
17: ; preds = %3
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = call i32 @memcpy(i8* %18, i8* %19, i32 4)
br label %21
21: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
define void @int32_to_bytes(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = bitcast i32* %4 to i8*
%6 = icmp eq i32 %2, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = call i32 @reverse_memcpy(i8* %1, i8* %5, i32 4)
br label %11
9: ; preds = %3
%10 = call i32 @memcpy(i8* %1, i8* %5, i32 4)
br label %11
11: ; preds = %9, %7
ret void
}
int op_div(int a, int b) { return (a / b); }


x86 assembly (clang, -O0):
<op_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @op_div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_coex_config_usage(void) {
  printf("\nUsage : coex_config [CONFIG_FILE]\n");
  printf("\nIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is "
         "performed.\n");
  return;
}


x86 assembly (clang, -O0):
<print_coex_config_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_coex_config_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0AUsage : coex_config [CONFIG_FILE]\0A\00"
@.str.1 = [79 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
define void @print_coex_config_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"\0AUsage : coex_config [CONFIG_FILE]\00"
@str.2 = [78 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\00"
define void @print_coex_config_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double my_asin(double);
double my_acos(double x) { return 3.141592653589793 / 2 - my_asin(x); }


x86 assembly (clang, -O0):
<my_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <my_asin@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_acos>:
push   %rax
call   1030 <my_asin@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @my_acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @my_asin(double %3)
%5 = fsub double 0x3FF921FB54442D18, %4
ret double %5
}

LLVM IR (-O2):
define double @my_acos(double %0) {
%2 = tail call double @my_asin(double %0)
%3 = fsub double 0x3FF921FB54442D18, %2
ret double %3
}
/* Variables and functions */
int(Memento_breakAt)(int i) { return 0; }


x86 assembly (clang, -O0):
<Memento_breakAt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memento_breakAt>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Memento_breakAt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @Memento_breakAt(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void not_ioctl(int i) { foo(1); }


x86 assembly (clang, -O0):
<not_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_ioctl>:
mov    $0x1,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @not_ioctl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @foo(i32 1)
ret void
}

LLVM IR (-O2):
define void @not_ioctl(i32 %0) {
%2 = tail call i32 @foo(i32 1)
ret void
}
void intel_fbdev_initial_config_async(struct drm_device *dev) {}


x86 assembly (clang, -O0):
<intel_fbdev_initial_config_async>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_fbdev_initial_config_async>:
ret

LLVM IR (-O0):
%struct.drm_device = type opaque
define void @intel_fbdev_initial_config_async(%struct.drm_device* %0) {
%2 = alloca %struct.drm_device*
store %struct.drm_device* %0, %struct.drm_device** %2
ret void
}

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @intel_fbdev_initial_config_async(%struct.drm_device* nocapture %0) {
ret void
}
void mem_cgroup_uncharge_cache_page(struct page *page) {}


x86 assembly (clang, -O0):
<mem_cgroup_uncharge_cache_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_cgroup_uncharge_cache_page>:
ret

LLVM IR (-O0):
%struct.page = type opaque
define void @mem_cgroup_uncharge_cache_page(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @mem_cgroup_uncharge_cache_page(%struct.page* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse_recur(char *, int /*<<< orphan*/, int);
void reverse(char s[]) {
  int i = 0;
  while (s[i] != '\0') {
    i++;
  }
  reverse_recur(s, 0, i - 1);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1146 <reverse+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <reverse+0x13>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse_recur@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <reverse+0x10>
add    $0xfffffffe,%edx
xor    %esi,%esi
jmp    1030 <reverse_recur@plt>

LLVM IR (-O0):
define void @reverse(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 1
%19 = call i32 @reverse_recur(i8* %16, i32 0, i32 %18)
ret void
}

LLVM IR (-O2):
define void @reverse(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nsw i32 %9, -1
%11 = tail call i32 @reverse_recur(i8* %0, i32 0, i32 %10)
ret void
}