xunge/DecIR huggingface dataset:
/* Variables and functions */
int lrand();
int rsize() {
  int rv = 8 << (lrand() % 15);
  rv = lrand() & (rv - 1);
  return rv;
}


x86 assembly (clang, -O0):
<rsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lrand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x8,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand@plt>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsize>:
push   %rbx
xor    %eax,%eax
call   1030 <lrand@plt>
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
shr    $0x3,%eax
add    %edx,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
mov    $0x8,%ebx
shl    %cl,%ebx
xor    %eax,%eax
call   1030 <lrand@plt>
add    $0xffffffff,%ebx
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rsize() {
%1 = alloca i32
%2 = call i32 (...) @lrand()
%3 = srem i32 %2, 15
%4 = shl i32 8, %3
store i32 %4, i32* %1
%5 = call i32 (...) @lrand()
%6 = load i32, i32* %1
%7 = sub nsw i32 %6, 1
%8 = and i32 %5, %7
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @rsize() {
%1 = tail call i32 (...) @lrand()
%2 = srem i32 %1, 15
%3 = shl nuw nsw i32 8, %2
%4 = tail call i32 (...) @lrand()
%5 = add nsw i32 %3, -1
%6 = and i32 %5, %4
ret i32 %6
}
unsigned long int cast_uint_ulong_fast(unsigned int x) {
  return (unsigned long int)x;
}


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

x86 assembly (clang, -O2):
<cast_uint_ulong_fast>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i64 @cast_uint_ulong_fast(i32 %0) {
%2 = zext i32 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ pcibios_write_config_byte(int /*<<< orphan*/, scalar_t__,
                                             int, int);
void set_dramc(void) {
  pcibios_write_config_byte(0, ((0x00 << 3) + 0), 0x57, 0x8);
}


x86 assembly (clang, -O0):
<set_dramc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x57,%edx
mov    $0x8,%ecx
call   1030 <pcibios_write_config_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_dramc>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x57,%edx
mov    $0x8,%ecx
jmp    1030 <pcibios_write_config_byte@plt>

LLVM IR (-O0):
define void @set_dramc() {
%1 = call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 87, i32 8)
ret void
}

LLVM IR (-O2):
define void @set_dramc() {
%1 = tail call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 87, i32 8)
ret void
}
int obterNivel(int velocidade, int nivelAtual) {
  if (velocidade < 10) {
    return ((1) > (nivelAtual) ? (1) : (nivelAtual));
  } else if (velocidade < 20) {
    return ((2) > (nivelAtual) ? (2) : (nivelAtual));
  } else {
    return 3;
  }
}


x86 assembly (clang, -O0):
<obterNivel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1140 <obterNivel+0x40>
mov    $0x1,%eax
cmp    -0xc(%rbp),%eax
jle    112f <obterNivel+0x2f>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <obterNivel+0x35>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <obterNivel+0x7d>
cmpl   $0x14,-0x8(%rbp)
jge    1176 <obterNivel+0x76>
mov    $0x2,%eax
cmp    -0xc(%rbp),%eax
jle    1165 <obterNivel+0x65>
mov    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    116b <obterNivel+0x6b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <obterNivel+0x7d>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<obterNivel>:
cmp    $0x9,%edi
jg     1110 <obterNivel+0x10>
test   %esi,%esi
mov    $0x1,%eax
cmovg  %esi,%eax
ret
mov    $0x3,%eax
cmp    $0x13,%edi
ja     1125 <obterNivel+0x25>
cmp    $0x3,%esi
mov    $0x2,%eax
cmovge %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @obterNivel(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 10
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp sgt i32 %1, 1
%6 = select i1 %5, i32 %1, i32 1
br label %12
7: ; preds = %2
%8 = icmp ult i32 %0, 20
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = icmp sgt i32 %1, 2
%11 = select i1 %10, i32 %1, i32 2
br label %12
12: ; preds = %7, %9, %4
%13 = phi i32 [ %6, %4 ], [ %11, %9 ], [ 3, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void display_usage(void) {
  fatal("Incorrect arguments \n\tsemEP  [-l left threshold] [-r right "
        "threshold] <left matrix>  <left vertices> <right matrix> <right "
        "vertices> <bipartite graph>\n");
}


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

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

LLVM IR (-O0):
@.str = [152 x i8] c"Incorrect arguments \0A\09semEP [-l left threshold] [-r right threshold] <left matrix> <left vertices> <right matrix> <right vertices> <bipartite graph>\0A\00"
define void @display_usage() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [152 x i8] c"Incorrect arguments \0A\09semEP [-l left threshold] [-r right threshold] <left matrix> <left vertices> <right matrix> <right vertices> <bipartite graph>\0A\00"
define void @display_usage() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
ret void
}
void vec2_scale(float *dst, float b) {
  dst[0] = dst[0] * b;
  dst[1] = dst[1] * b;
}


x86 assembly (clang, -O0):
<vec2_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_scale>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
mulss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @vec2_scale(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float, float* %4
%16 = fmul float %14, %15
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 1
store float %16, float* %18
ret void
}

LLVM IR (-O2):
define void @vec2_scale(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
ret void
}
void ScaleRowDown2Linear_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown2Linear_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_deposit_info(int amount, int balance) {
  printf("Depositing %d dollars.\n", amount);
  printf("Current balance %d dollars.\n", balance);
}


x86 assembly (clang, -O0):
<print_deposit_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_deposit_info>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Depositing %d dollars.\0A\00"
@.str.1 = [29 x i8] c"Current balance %d dollars.\0A\00"
define void @print_deposit_info(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 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Depositing %d dollars.\0A\00"
@.str.1 = [29 x i8] c"Current balance %d dollars.\0A\00"
define void @print_deposit_info(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
void vla(void) {
  int top;
  int l = 5;
  if (top) {
    l = 6;
  }
  int a[l];
  for (int i = 0; i < l - 1; i++) {
    a[i] = 42;
  }
}


x86 assembly (clang, -O0):
<vla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1120 <vla+0x20>
movl   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    117c <vla+0x7c>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x2a,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <vla+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vla() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32 5, i32* %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 6, i32* %2
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %3
%13 = alloca i32, i64 %11
store i64 %11, i64* %4
store i32 0, i32* %5
br label %14
14: ; preds = %23, %9
%15 = load i32, i32* %5
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %26
19: ; preds = %14
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %13, i64 %21
store i32 42, i32* %22
br label %23
23: ; preds = %19
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %14
26: ; preds = %14
%27 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @vla() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void test_malloc(void) {
  char *p;
  printf("test_malloc: entered\n");
  p = malloc(10);
  fprintf(stderr, "# got 0x%08x\n", (unsigned int)p);
  printf("test_malloc: leaving\n");
}


x86 assembly (clang, -O0):
<test_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_malloc>:
push   %rax
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    0x2e92(%rip),%rcx
mov    (%rcx),%edi
lea    0xea9(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"test_malloc: entered\0A\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"# got 0x%08x\0A\00"
@.str.2 = [22 x i8] c"test_malloc: leaving\0A\00"
define void @test_malloc() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %1
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %1
%6 = ptrtoint i8* %5 to i32
%7 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [14 x i8] c"# got 0x%08x\0A\00"
@str = [21 x i8] c"test_malloc: entered\00"
@str.3 = [21 x i8] c"test_malloc: leaving\00"
define void @test_malloc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = load i32, i32* @stderr
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kernelpanic(char *);
void secure_dabort() { kernelpanic("secure world dabort\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"secure world dabort\0A\00"
define void @secure_dabort() {
%1 = call i32 @kernelpanic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"secure world dabort\0A\00"
define void @secure_dabort() {
%1 = tail call i32 @kernelpanic(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strdup(char *);
scalar_t__ strlen(char *);
char *parse_mime_type(char *data, int *len) {
  char *mime_type = strdup(data);
  *len = (int)strlen(mime_type) + 1;
  return mime_type;
}


x86 assembly (clang, -O0):
<parse_mime_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_mime_type>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @parse_mime_type(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %10, 1
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @parse_mime_type(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i8* @strdup(i8* %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32l12(uint32_t x) { return (x << 12) | (x >> 20); }


x86 assembly (clang, -O0):
<rot32l12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xc,%eax
mov    -0x4(%rbp),%ecx
sar    $0x14,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32l12>:
mov    %edi,%eax
shl    $0xc,%eax
sar    $0x14,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32l12(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 12
%5 = load i32, i32* %2
%6 = ashr i32 %5, 20
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32l12(i32 %0) {
%2 = shl i32 %0, 12
%3 = ashr i32 %0, 20
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ kprintc(char const *, int);
void kprint(const char *string) { kprintc(string, 15); }


x86 assembly (clang, -O0):
<kprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xf,%esi
call   1030 <kprintc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint>:
mov    $0xf,%esi
jmp    1030 <kprintc@plt>

LLVM IR (-O0):
define void @kprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @kprintc(i8* %3, i32 15)
ret void
}

LLVM IR (-O2):
define void @kprint(i8* %0) {
%2 = tail call i32 @kprintc(i8* %0, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fsync(int);
int p1strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void p1putstr(int fd, char *s) {
  int n = p1strlen(s);
  write(fd, s, n);
  fsync(fd);
}


x86 assembly (clang, -O0):
<p1putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <p1strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1040 <fsync@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1putstr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1050 <p1strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fsync@plt>

LLVM IR (-O0):
define void @p1putstr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @p1strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @fsync(i32 %12)
ret void
}

LLVM IR (-O2):
define void @p1putstr(i32 %0, i8* %1) {
%3 = tail call i32 @p1strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = tail call i32 @fsync(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_memaccess_usage(void) {
  printf("\nUsage : uaputl.exe memaccess <ADDRESS> [value]\n");
  printf("\nRead/Write memory location");
  printf("\nADDRESS: Address of the memory location to be read/written");
  printf("\nValue  : Value to be written at that address\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_memaccess_usage>:
push   %rax
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf3c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"\0AUsage : uaputl.exe memaccess <ADDRESS> [value]\0A\00"
@.str.1 = [28 x i8] c"\0ARead/Write memory location\00"
@.str.2 = [60 x i8] c"\0AADDRESS: Address of the memory location to be read/written\00"
@.str.3 = [47 x i8] c"\0AValue : Value to be written at that address\0A\00"
define void @print_memaccess_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"\0ARead/Write memory location\00"
@.str.2 = [60 x i8] c"\0AADDRESS: Address of the memory location to be read/written\00"
@str = [48 x i8] c"\0AUsage : uaputl.exe memaccess <ADDRESS> [value]\00"
@str.4 = [46 x i8] c"\0AValue : Value to be written at that address\00"
define void @print_memaccess_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
char VCNL4000_readCmd(int);
int /*<<< orphan*/ VCNL4000_writeCmd(int, int);
int /*<<< orphan*/ usleep(int);
int getProximityMeasure() {
  char c = 0;
  VCNL4000_writeCmd(0x80 + 0x0, 1 << 3);
  usleep(500);
  c = VCNL4000_readCmd(0x80 + 0x7);
  int result = (int)c << 8;
  c = VCNL4000_readCmd(0x80 + 0x8);
  result |= (int)c;
  return result;
}


x86 assembly (clang, -O0):
<getProximityMeasure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x80,%edi
mov    $0x8,%esi
call   1040 <VCNL4000_writeCmd@plt>
mov    $0x1f4,%edi
call   1050 <usleep@plt>
mov    $0x87,%edi
call   1030 <VCNL4000_readCmd@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x88,%edi
call   1030 <VCNL4000_readCmd@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getProximityMeasure>:
push   %rbx
mov    $0x80,%edi
mov    $0x8,%esi
call   1040 <VCNL4000_writeCmd@plt>
mov    $0x1f4,%edi
call   1050 <usleep@plt>
mov    $0x87,%edi
call   1030 <VCNL4000_readCmd@plt>
movsbl %al,%ebx
shl    $0x8,%ebx
mov    $0x88,%edi
call   1030 <VCNL4000_readCmd@plt>
movsbl %al,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getProximityMeasure() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
%3 = call i32 @VCNL4000_writeCmd(i32 128, i32 8)
%4 = call i32 @usleep(i32 500)
%5 = call signext i8 @VCNL4000_readCmd(i32 135)
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 8
store i32 %8, i32* %2
%9 = call signext i8 @VCNL4000_readCmd(i32 136)
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = load i32, i32* %2
%13 = or i32 %12, %11
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @getProximityMeasure() {
%1 = tail call i32 @VCNL4000_writeCmd(i32 128, i32 8)
%2 = tail call i32 @usleep(i32 500)
%3 = tail call signext i8 @VCNL4000_readCmd(i32 135)
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 8
%6 = tail call signext i8 @VCNL4000_readCmd(i32 136)
%7 = sext i8 %6 to i32
%8 = or i32 %5, %7
ret i32 %8
}
void gdk_window_add_filter() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_add_filter() {
ret void
}
void freeMat(const int row, int **matrix) {
  for (int i = 0; i < row; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<freeMat>:
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    1151 <freeMat+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <freeMat+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <freeMat+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeMat+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeMat(i32 %0, i32** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i32** %1 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32*, i32** %1, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned char);
void cmp_m32_imm8(void *_m32, unsigned char imm8) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x83);
  put8(0x3D);
  put32((unsigned long)(m32));
  put8(imm8);
}


x86 assembly (clang, -O0):
<cmp_m32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x83,%edi
call   1030 <put8@plt>
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_m32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x83,%edi
call   1030 <put8@plt>
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_m32_imm8(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i8 zeroext -125)
%9 = call i32 @put8(i8 zeroext 61)
%10 = load i64*, i64** %5
%11 = ptrtoint i64* %10 to i64
%12 = call i32 @put32(i64 %11)
%13 = load i8, i8* %4
%14 = call i32 @put8(i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @cmp_m32_imm8(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -125)
%4 = tail call i32 @put8(i8 zeroext 61)
%5 = ptrtoint i8* %0 to i64
%6 = tail call i32 @put32(i64 %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cubeByReference(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int number = 5;
  printf("The original value of number is %d", number);
  cubeByReference(&number);
  printf("\nThe new value of number is %d\n", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <cubeByReference@plt>
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0xed0(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <cubeByReference@plt>
mov    0x4(%rsp),%esi
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The original value of number is %d\00"
@.str.1 = [32 x i8] c"\0AThe new value of number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @cubeByReference(i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The original value of number is %d\00"
@.str.1 = [32 x i8] c"\0AThe new value of number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = call i32 @cubeByReference(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void foo562(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo562(i32 %0) {
ret void
}
int main() {
  int i = 0;
  while (i) {
    int i = 5;
  }
  int a = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x5,-0xc(%rbp)
jmp    1112 <main+0x12>
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 5, i32* %3
br label %5
9: ; preds = %5
store i32 0, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ base_w(int *, int, unsigned char const *);
int /*<<< orphan*/ wots_checksum(int *, int *);
void chain_lengths(int *lengths, const unsigned char *msg) {
  base_w(lengths, (8 * 16 / 4), msg);
  wots_checksum(lengths + (8 * 16 / 4), lengths);
}


x86 assembly (clang, -O0):
<chain_lengths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x20,%esi
call   1040 <base_w@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <wots_checksum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chain_lengths>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    $0x20,%esi
call   1040 <base_w@plt>
lea    0x80(%rbx),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <wots_checksum@plt>

LLVM IR (-O0):
define void @chain_lengths(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @base_w(i32* %5, i32 32, i8* %6)
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 32
%10 = load i32*, i32** %3
%11 = call i32 @wots_checksum(i32* %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @chain_lengths(i32* %0, i8* %1) {
%3 = tail call i32 @base_w(i32* %0, i32 32, i8* %1)
%4 = getelementptr inbounds i32, i32* %0, i64 32
%5 = tail call i32 @wots_checksum(i32* %4, i32* %0)
ret void
}
/* Variables and functions */
double atof(char *);
double BGBDT_EntObj_ParseFloat(char *s) { return (atof(s)); }


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

x86 assembly (clang, -O2):
<BGBDT_EntObj_ParseFloat>:
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @BGBDT_EntObj_ParseFloat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @atof(i8* %3)
ret double %4
}

LLVM IR (-O2):
define double @BGBDT_EntObj_ParseFloat(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ remove_space(char *);
int /*<<< orphan*/ replace_minus(char *);
int /*<<< orphan*/ stdin;
void read_line(char *p) {
  if (fgets(p, 65535, stdin) == NULL) {
    p[0] = '\0';
    return;
  }
  remove_space(p);
  replace_minus(p);
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    $0xffff,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    1169 <read_line+0x39>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    117b <read_line+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <remove_space@plt>
mov    -0x8(%rbp),%rdi
call   1050 <replace_minus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    $0xffff,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     115d <read_line+0x2d>
mov    %rbx,%rdi
call   1030 <remove_space@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <replace_minus@plt>
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @read_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdin
%5 = call i32* @fgets(i8* %3, i32 65535, i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 0, i8* %9
br label %15
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @remove_space(i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 @replace_minus(i8* %13)
br label %15
15: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @read_line(i8* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32* @fgets(i8* %0, i32 65535, i32 %2)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8 0, i8* %0
br label %9
6: ; preds = %1
%7 = tail call i32 @remove_space(i8* %0)
%8 = tail call i32 @replace_minus(i8* %0)
br label %9
9: ; preds = %6, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ read_int_dec_or_hex(char *);
int /*<<< orphan*/ send_req(int, int, int /*<<< orphan*/, int);
int u_set_ival(int fd, char **argv) {
  uint32_t val;
  val = read_int_dec_or_hex(argv[0]);
  send_req(fd, 0x08, val, 1);
  return 0;
}


x86 assembly (clang, -O0):
<u_set_ival>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <read_int_dec_or_hex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    $0x8,%esi
mov    $0x1,%ecx
call   1030 <send_req@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_set_ival>:
push   %rbx
mov    %edi,%ebx
mov    (%rsi),%rdi
call   1040 <read_int_dec_or_hex@plt>
mov    %ebx,%edi
mov    $0x8,%esi
mov    %eax,%edx
mov    $0x1,%ecx
call   1030 <send_req@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @u_set_ival(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @read_int_dec_or_hex(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 @send_req(i32 %10, i32 8, i32 %11, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @u_set_ival(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @read_int_dec_or_hex(i8* %3)
%5 = tail call i32 @send_req(i32 %0, i32 8, i32 %4, i32 1)
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double exp2(double x) { return pow(2.0, x); }


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

x86 assembly (clang, -O2):
<exp2>:
jmp    1100 <exp2>

LLVM IR (-O0):
define double @exp2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double 2.000000e+00, double %3)
ret double %4
}

LLVM IR (-O2):
define double @exp2(double %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient) {
  return ((uint8_t)(direction << 7)) | ((uint8_t)(type << 5)) | (recipient);
}


x86 assembly (clang, -O0):
<bm_request_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x7,%eax
mov    -0x8(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_request_type>:
mov    %esi,%eax
shl    $0x7,%edi
shl    $0x5,%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @bm_request_type(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 7
%9 = load i32, i32* %5
%10 = shl i32 %9, 5
%11 = or i32 %8, %10
%12 = load i32, i32* %6
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @bm_request_type(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 7
%5 = shl i32 %1, 5
%6 = or i32 %5, %4
%7 = or i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigint(int signo) { exit(0); }


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigint>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigint(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_RECORD_OFF;
void cec_msg_record_off(struct cec_msg *msg) {
  msg->len = 2;
  msg->msg[1] = CEC_MSG_RECORD_OFF;
}


x86 assembly (clang, -O0):
<cec_msg_record_off>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_record_off>:
movl   $0x2,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_RECORD_OFF = global i32 0
define void @cec_msg_record_off(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = load i32, i32* @CEC_MSG_RECORD_OFF
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_RECORD_OFF = global i32 0
define void @cec_msg_record_off(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 2, i32* %2
%3 = load i32, i32* @CEC_MSG_RECORD_OFF
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sleep(int);
void sleepexit(int eval) {
  sleep(5);
  exit(eval);
}


x86 assembly (clang, -O0):
<sleepexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sleepexit>:
push   %rbx
mov    %edi,%ebx
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sleepexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sleep(i32 5)
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @sleepexit(i32 %0) {
%2 = tail call i32 @sleep(i32 5)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void foldLow(char *x) {
  for (; *x != '>'; x++) {
    if ((*x >= 'A') && (*x <= 'Z'))
      x[0] = (char)((int)(x[0]) + 32);
  }
}


x86 assembly (clang, -O0):
<foldLow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
je     1160 <foldLow+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114a <foldLow+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114a <foldLow+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    114f <foldLow+0x4f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <foldLow+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foldLow>:
mov    (%rdi),%al
cmp    $0x3e,%al
jne    1107 <foldLow+0x7>
ret
add    $0x1,%rdi
jmp    111b <foldLow+0x1b>
nopl   (%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
cmp    $0x3e,%al
je     1106 <foldLow+0x6>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <foldLow+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <foldLow+0x10>

LLVM IR (-O0):
define void @foldLow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %28, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 62
br i1 %7, label %8, label %31
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %27
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %18, label %27
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 32
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 0
store i8 %24, i8* %26
br label %27
27: ; preds = %18, %13, %8
br label %28
28: ; preds = %27
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %2
br label %3
31: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @foldLow(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 62
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 62
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
int XGetNormalHints() {}


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

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

LLVM IR (-O0):
define i32 @XGetNormalHints() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetNormalHints() {
ret i32 undef
}
/* Variables and functions */
unsigned int Reverse(unsigned int);
int isPalindrome(unsigned int n) {
  unsigned int r;
  r = Reverse(n);
  if (r == n)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <Reverse@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113e <isPalindrome+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <isPalindrome+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
push   %rbx
mov    %edi,%ebx
call   1030 <Reverse@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isPalindrome(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @Reverse(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = tail call i32 @Reverse(i32 %0)
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}