xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Floyd();
int main(int argc, char *argv[]) {
  Floyd();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Floyd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @Floyd()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Floyd()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void assign(long a, int *b) {
  *b = (int)a;
  printf("inside assign\n");
}


x86 assembly (clang, -O0):
<assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign>:
mov    %edi,(%rsi)
lea    0xee7(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"inside assign\0A\00"
define void @assign(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32*, i32** %4
store i32 %6, i32* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"inside assign\00"
define void @assign(i64 %0, i32* nocapture writeonly %1) {
%3 = trunc i64 %0 to i32
store i32 %3, i32* %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void multToConstVec3f(float *a, float c) {
  a[0] *= c;
  a[1] *= c;
  a[2] *= c;
}


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

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

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

LLVM IR (-O2):
define void @multToConstVec3f(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
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nim_core_shutdown();
void test_str_teardown(void) { nim_core_shutdown(); }


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

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

LLVM IR (-O0):
define void @test_str_teardown() {
%1 = call i32 (...) @nim_core_shutdown()
ret void
}

LLVM IR (-O2):
define void @test_str_teardown() {
%1 = tail call i32 (...) @nim_core_shutdown()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help() {
  printf("use google stupid");
  return 0;
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"use google stupid\00"
define i32 @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"use google stupid\00"
define i32 @help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct TS_bits {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct TS_bits *);
void bits_free(struct TS_bits **bits) {
  struct TS_bits *bp = *bits;
  if (bp) {
    free(bp);
  }
  *bits = NULL;
}


x86 assembly (clang, -O0):
<bits_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113b <bits_free+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1121 <bits_free+0x11>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.TS_bits = type { i32 }
define void @bits_free(%struct.TS_bits** %0) {
%2 = alloca %struct.TS_bits**
%3 = alloca %struct.TS_bits*
store %struct.TS_bits** %0, %struct.TS_bits*** %2
%4 = load %struct.TS_bits**, %struct.TS_bits*** %2
%5 = load %struct.TS_bits*, %struct.TS_bits** %4
store %struct.TS_bits* %5, %struct.TS_bits** %3
%6 = load %struct.TS_bits*, %struct.TS_bits** %3
%7 = icmp ne %struct.TS_bits* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.TS_bits*, %struct.TS_bits** %3
%10 = call i32 @free(%struct.TS_bits* %9)
br label %11
11: ; preds = %8, %1
%12 = load %struct.TS_bits**, %struct.TS_bits*** %2
store %struct.TS_bits* null, %struct.TS_bits** %12
ret void
}

LLVM IR (-O2):
%struct.TS_bits = type { i32 }
define void @bits_free(%struct.TS_bits** nocapture %0) {
%2 = load %struct.TS_bits*, %struct.TS_bits** %0
%3 = icmp eq %struct.TS_bits* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(%struct.TS_bits* %2)
br label %6
6: ; preds = %4, %1
store %struct.TS_bits* null, %struct.TS_bits** %0
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void chrcat(char *str, char chr) {
  str = strchr(str, '\0');
  *str++ = chr;
  *str = '\0';
}


x86 assembly (clang, -O0):
<chrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrcat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @chrcat(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 0)
store i8* %6, i8** %3
%7 = load i8, i8* %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = load i8*, i8** %3
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @chrcat(i8* nocapture %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %1, i8* %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wdg_feed(int);
void reset() { wdg_feed(8); }


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <wdg_feed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
mov    $0x8,%edi
jmp    1030 <wdg_feed@plt>

LLVM IR (-O0):
define void @reset() {
%1 = call i32 @wdg_feed(i32 8)
ret void
}

LLVM IR (-O2):
define void @reset() {
%1 = tail call i32 @wdg_feed(i32 8)
ret void
}
/* Variables and functions */
size_t gotcha_strnlen(const char *s, size_t max_length) {
  size_t i;
  for (i = 0; s[i] && i < max_length; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<gotcha_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113c <gotcha_strnlen+0x3c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <gotcha_strnlen+0x4c>
jmp    1162 <gotcha_strnlen+0x62>
jmp    1151 <gotcha_strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <gotcha_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotcha_strnlen>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <gotcha_strnlen+0x22>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1110 <gotcha_strnlen+0x10>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @gotcha_strnlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp ult i64 %4, %1
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw i64 %4, 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ info_fun1();
int /*<<< orphan*/ info_fun2(char);
int /*<<< orphan*/ info_fun2bis(char);
int /*<<< orphan*/ info_fun2xxx(char, int, int);
int /*<<< orphan*/ info_fun2yyy(char, int, int);
int main(int argc, char **argv, char **envp) {
  info_fun1();
  (void)info_fun2('a');
  (void)info_fun2bis('b');
  (void)info_fun2xxx('c', 1, 2);
  (void)info_fun2yyy('d', 3, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <info_fun1@plt>
mov    $0x61,%edi
call   1060 <info_fun2@plt>
mov    $0x62,%edi
call   1050 <info_fun2bis@plt>
mov    $0x63,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1070 <info_fun2xxx@plt>
mov    $0x64,%edi
mov    $0x3,%esi
mov    $0x4,%edx
call   1040 <info_fun2yyy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <info_fun1@plt>
mov    $0x61,%edi
call   1060 <info_fun2@plt>
mov    $0x62,%edi
call   1050 <info_fun2bis@plt>
mov    $0x63,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1070 <info_fun2xxx@plt>
mov    $0x64,%edi
mov    $0x3,%esi
mov    $0x4,%edx
call   1040 <info_fun2yyy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 (...) @info_fun1()
%8 = call i32 @info_fun2(i8 signext 97)
%9 = call i32 @info_fun2bis(i8 signext 98)
%10 = call i32 @info_fun2xxx(i8 signext 99, i32 1, i32 2)
%11 = call i32 @info_fun2yyy(i8 signext 100, i32 3, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @info_fun1()
%5 = tail call i32 @info_fun2(i8 signext 97)
%6 = tail call i32 @info_fun2bis(i8 signext 98)
%7 = tail call i32 @info_fun2xxx(i8 signext 99, i32 1, i32 2)
%8 = tail call i32 @info_fun2yyy(i8 signext 100, i32 3, i32 4)
ret i32 0
}
/* Type definitions */
struct irRegister {
  int dummy;
};
struct irInstructionAllocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_exit_cond(struct irInstructionAllocator *,
                                 struct irRegister *, int /*<<< orphan*/ *);
void add_exit(struct irInstructionAllocator *ir, struct irRegister *exitValue) {
  add_exit_cond(ir, exitValue, NULL);
}


x86 assembly (clang, -O0):
<add_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <add_exit_cond@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_exit>:
xor    %edx,%edx
jmp    1030 <add_exit_cond@plt>

LLVM IR (-O0):
%struct.irInstructionAllocator = type { i32 }
%struct.irRegister = type { i32 }
define void @add_exit(%struct.irInstructionAllocator* %0, %struct.irRegister* %1) {
%3 = alloca %struct.irInstructionAllocator*
%4 = alloca %struct.irRegister*
store %struct.irInstructionAllocator* %0, %struct.irInstructionAllocator** %3
store %struct.irRegister* %1, %struct.irRegister** %4
%5 = load %struct.irInstructionAllocator*, %struct.irInstructionAllocator** %3
%6 = load %struct.irRegister*, %struct.irRegister** %4
%7 = call i32 @add_exit_cond(%struct.irInstructionAllocator* %5, %struct.irRegister* %6, i32* null)
ret void
}

LLVM IR (-O2):
%struct.irInstructionAllocator = type { i32 }
%struct.irRegister = type { i32 }
define void @add_exit(%struct.irInstructionAllocator* %0, %struct.irRegister* %1) {
%3 = tail call i32 @add_exit_cond(%struct.irInstructionAllocator* %0, %struct.irRegister* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawCFractalEquilateral(int, int, int, int,
                                           int /*<<< orphan*/);
int /*<<< orphan*/ readData();
void drawFractal() { drawCFractalEquilateral(150, 768, 768, 10, readData()); }


x86 assembly (clang, -O0):
<drawFractal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <readData@plt>
mov    %eax,%r8d
mov    $0x96,%edi
mov    $0x300,%edx
mov    $0xa,%ecx
mov    %edx,%esi
call   1040 <drawCFractalEquilateral@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawFractal>:
push   %rax
xor    %eax,%eax
call   1030 <readData@plt>
mov    $0x96,%edi
mov    $0x300,%esi
mov    $0x300,%edx
mov    $0xa,%ecx
mov    %eax,%r8d
pop    %rax
jmp    1040 <drawCFractalEquilateral@plt>

LLVM IR (-O0):
define void @drawFractal() {
%1 = call i32 (...) @readData()
%2 = call i32 @drawCFractalEquilateral(i32 150, i32 768, i32 768, i32 10, i32 %1)
ret void
}

LLVM IR (-O2):
define void @drawFractal() {
%1 = tail call i32 (...) @readData()
%2 = tail call i32 @drawCFractalEquilateral(i32 150, i32 768, i32 768, i32 10, i32 %1)
ret void
}
void dreamplug_init(void) {}


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

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

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

LLVM IR (-O2):
define void @dreamplug_init() {
ret void
}
const char *key_mouse2str(double x) {
  static const char *a[] = {"off", "on"};
  return a[x < 0];
}


x86 assembly (clang, -O0):
<key_mouse2str>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rcx
lea    0x2f0d(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_mouse2str>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@key_mouse2str.a = internal global [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0)]
@.str = [4 x i8] c"off\00"
@.str.1 = [3 x i8] c"on\00"
define i8* @key_mouse2str(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* @key_mouse2str.a, i64 0, i64 %6
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
@reltable.key_mouse2str = internal unnamed_addr constant [2 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([2 x i32]* @reltable.key_mouse2str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([2 x i32]* @reltable.key_mouse2str to i64)) to i32)]
@.str = [4 x i8] c"off\00"
@.str.1 = [3 x i8] c"on\00"
define i8* @key_mouse2str(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = zext i1 %2 to i64
%4 = shl i64 %3, 2
%5 = call i8* @llvm.load.relative.i64(i8* bitcast ([2 x i32]* @reltable.key_mouse2str to i8*), i64 %4)
ret i8* %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int ngaValidatePackedOpcodes(int32_t opcode) {
  int32_t raw = opcode;
  int32_t current;
  int valid = -1;
  int i;
  for (i = 0; i < 4; i++) {
    current = raw & 0xFF;
    if (!(current >= 0 && current <= 26))
      valid = 0;
    raw = raw >> 8;
  }
  return valid;
}


x86 assembly (clang, -O0):
<ngaValidatePackedOpcodes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1162 <ngaValidatePackedOpcodes+0x62>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1144 <ngaValidatePackedOpcodes+0x44>
cmpl   $0x1a,-0xc(%rbp)
jle    114b <ngaValidatePackedOpcodes+0x4b>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <ngaValidatePackedOpcodes+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngaValidatePackedOpcodes>:
movzbl %dil,%eax
cmp    $0x1b,%eax
setb   %al
mov    %edi,%ecx
and    $0xff00,%ecx
cmp    $0x1b00,%ecx
setb   %cl
and    %al,%cl
mov    %edi,%eax
and    $0xff0000,%eax
cmp    $0x1b0000,%eax
setb   %al
cmp    $0x1b000000,%edi
setb   %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @ngaValidatePackedOpcodes(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ult i32 %2, 27
%4 = and i32 %0, 65280
%5 = icmp ult i32 %4, 6912
%6 = and i1 %5, %3
%7 = and i32 %0, 16711680
%8 = icmp ult i32 %7, 1769472
%9 = and i1 %8, %6
%10 = icmp ult i32 %0, 452984832
%11 = and i1 %10, %9
%12 = sext i1 %11 to i32
ret i32 %12
}
int Operand_ar4_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_ar4_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int _amd_erase8(long, int, int);
int amd_erase16b(long base, int offset) { return _amd_erase8(base, offset, 2); }


x86 assembly (clang, -O0):
<amd_erase16b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%edx
call   1030 <_amd_erase8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<amd_erase16b>:
mov    $0x2,%edx
jmp    1030 <_amd_erase8@plt>

LLVM IR (-O0):
define i32 @amd_erase16b(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i32 @_amd_erase8(i64 %5, i32 %6, i32 2)
ret i32 %7
}

LLVM IR (-O2):
define i32 @amd_erase16b(i64 %0, i32 %1) {
%3 = tail call i32 @_amd_erase8(i64 %0, i32 %1, i32 2)
ret i32 %3
}
void nmi_handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<nmi_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <nmi_handler+0x9>
jmp    1109 <nmi_handler+0x9>

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

LLVM IR (-O0):
define void @nmi_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @nmi_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int pointercmp(const void *pointer1, const void *pointer2) {
  return (pointer1 != pointer2);
}


x86 assembly (clang, -O0):
<pointercmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointercmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @pointercmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pointercmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ia_setbit16(uint16_t word, int i) { return word | (1 << i); }


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

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

LLVM IR (-O0):
define i32 @ia_setbit16(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 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ia_setbit16(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f1();
int main() {
  if (f1() != 8)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f1@plt>
cmp    $0x8,%eax
je     1156 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f1@plt>
cmp    $0x8,%eax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = icmp ne i32 %2, 8
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = icmp eq i32 %1, 8
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sha3_256(int /*<<< orphan*/ *const, int,
                            int /*<<< orphan*/ const *, size_t const);
void SHA3_256(uint8_t *const ret, uint8_t const *data, const size_t size) {
  sha3_256(ret, 32, data, size);
}


x86 assembly (clang, -O0):
<SHA3_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
call   1030 <sha3_256@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA3_256>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x20,%esi
jmp    1030 <sha3_256@plt>

LLVM IR (-O0):
define void @SHA3_256(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = call i32 @sha3_256(i32* %7, i32 32, i32* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @SHA3_256(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @sha3_256(i32* %0, i32 32, i32* %1, i64 %2)
ret void
}
int ima_file_check(struct file *file, int mask) { return 0; }


x86 assembly (clang, -O0):
<ima_file_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.file = type opaque
define i32 @ima_file_check(%struct.file* %0, i32 %1) {
%3 = alloca %struct.file*
%4 = alloca i32
store %struct.file* %0, %struct.file** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.file = type opaque
define i32 @ima_file_check(%struct.file* nocapture readnone %0, i32 %1) {
ret i32 0
}
int test_imm_48int64_highword_reg(long long val) {
  return ((val >> 32) & (0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x48,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_48int64_highword_reg>:
movabs $0x4800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_48int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 72
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_48int64_highword_reg(i64 %0) {
%2 = and i64 %0, 309237645312
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
void *malloc(size_t);
void *Malloc(size_t size) {
  void *ptr;
  if ((ptr = malloc(size)) == NULL)
    err_sys("malloc error");
  return ptr;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <Malloc+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <err_sys@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"malloc error\00"
define i8* @Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"malloc error\00"
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int main(void) {
  char *str;
  str = (char *)malloc(15);
  strcpy(str, "tutorialspoint");
  printf("String = %s,  Address = %u\n", str, str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
call   1040 <malloc@plt>
movabs $0x6c6169726f747574,%rcx
69 61 6c
mov    %rcx,(%rax)
movabs $0x746e696f70736c,%rcx
mov    %rcx,0x7(%rax)
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"tutorialspoint\00"
@.str.1 = [28 x i8] c"String = %s, Address = %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i64 15)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strcpy(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"tutorialspoint\00"
@.str.1 = [28 x i8] c"String = %s, Address = %u\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(15) i8* @malloc(i64 15)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(15) %1, i8* align 1 dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 15, i1 false)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db_read();
int find_key(char const *);
int isset(const char *key) {
  db_read();
  return (find_key(key) != -1);
}


x86 assembly (clang, -O0):
<isset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <db_read@plt>
mov    -0x8(%rbp),%rdi
call   1040 <find_key@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isset>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <db_read@plt>
mov    %rbx,%rdi
call   1040 <find_key@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @db_read()
%4 = load i8*, i8** %2
%5 = call i32 @find_key(i8* %4)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isset(i8* %0) {
%2 = tail call i32 (...) @db_read()
%3 = tail call i32 @find_key(i8* %0)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
int calcu2__(int i1, int i2) { return ((i1 + i2) % 100) + 1; }


x86 assembly (clang, -O0):
<calcu2__>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcu2__>:
add    %esi,%edi
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @calcu2__(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 = add nsw i32 %5, %6
%8 = srem i32 %7, 100
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @calcu2__(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = srem i32 %3, 100
%5 = add nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ caddr(int);
int /*<<< orphan*/ cadr(int);
int /*<<< orphan*/ car(int);
int /*<<< orphan*/ gexpr(int /*<<< orphan*/);
int /*<<< orphan*/ library(int /*<<< orphan*/);
int /*<<< orphan*/ pulx();
int /*<<< orphan*/ pushd();
void binexpr(int e1) {
  gexpr(caddr(e1));
  pushd();
  gexpr(cadr(e1));
  pulx();
  library(car(e1));
}


x86 assembly (clang, -O0):
<binexpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <caddr@plt>
mov    %eax,%edi
call   1030 <gexpr@plt>
mov    $0x0,%al
call   1050 <pushd@plt>
mov    -0x4(%rbp),%edi
call   1080 <cadr@plt>
mov    %eax,%edi
call   1030 <gexpr@plt>
mov    $0x0,%al
call   1040 <pulx@plt>
mov    -0x4(%rbp),%edi
call   1090 <car@plt>
mov    %eax,%edi
call   1070 <library@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binexpr>:
push   %rbx
mov    %edi,%ebx
call   1060 <caddr@plt>
mov    %eax,%edi
call   1030 <gexpr@plt>
xor    %eax,%eax
call   1050 <pushd@plt>
mov    %ebx,%edi
call   1080 <cadr@plt>
mov    %eax,%edi
call   1030 <gexpr@plt>
xor    %eax,%eax
call   1040 <pulx@plt>
mov    %ebx,%edi
call   1090 <car@plt>
mov    %eax,%edi
pop    %rbx
jmp    1070 <library@plt>

LLVM IR (-O0):
define void @binexpr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @caddr(i32 %3)
%5 = call i32 @gexpr(i32 %4)
%6 = call i32 (...) @pushd()
%7 = load i32, i32* %2
%8 = call i32 @cadr(i32 %7)
%9 = call i32 @gexpr(i32 %8)
%10 = call i32 (...) @pulx()
%11 = load i32, i32* %2
%12 = call i32 @car(i32 %11)
%13 = call i32 @library(i32 %12)
ret void
}

LLVM IR (-O2):
define void @binexpr(i32 %0) {
%2 = tail call i32 @caddr(i32 %0)
%3 = tail call i32 @gexpr(i32 %2)
%4 = tail call i32 (...) @pushd()
%5 = tail call i32 @cadr(i32 %0)
%6 = tail call i32 @gexpr(i32 %5)
%7 = tail call i32 (...) @pulx()
%8 = tail call i32 @car(i32 %0)
%9 = tail call i32 @library(i32 %8)
ret void
}
/* Variables and functions */
int OPENSSL_isservice(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @OPENSSL_isservice() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xconfigurerequest_y(void *_p) {
  return (int)((XEvent *)_p)->xconfigurerequest.y;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xconfigurerequest_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xconfigurerequest_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xconfigurerequest_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void go_south_east(int *lat, int *lng) {
  *lat -= 1;
  *lng += 1;
}


x86 assembly (clang, -O0):
<go_south_east>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_south_east>:
addl   $0xffffffff,(%rdi)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @go_south_east(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* %5
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @go_south_east(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
store i32 %4, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int *foo() {
  int i;
  int array[5];
  printf("%p\n", array);
  for (i = 0; i < 5; i++) {
    array[i] = 42;
  }
  return array;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1153 <foo+0x43>
movslq -0x4(%rbp),%rax
movl   $0x2a,-0x20(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <foo+0x1f>
lea    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x20,%rsp
lea    0xee4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
define i32* @foo() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %1
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %10
store i32 42, i32* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %5
15: ; preds = %5
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
ret i32* %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32* @foo() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHelp() {
  printf("\nUsage: console -c <ip> -c <ip> -r <secs>\n"
         "\n"
         "  Options:\n"
         "\n"
         "    -r <secs>      refresh interval\n"
         "    -c <ip>        add computer\n"
         "    -h             print usage info\n"
         "    -v             verbose mode\n\n");
}


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

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

LLVM IR (-O0):
@.str = [193 x i8] c"\0AUsage: console -c <ip> -c <ip> -r <secs>\0A\0A Options:\0A\0A -r <secs> refresh interval\0A -c <ip> add computer\0A -h print usage info\0A -v verbose mode\0A\0A\00"
define void @printHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [192 x i8] c"\0AUsage: console -c <ip> -c <ip> -r <secs>\0A\0A Options:\0A\0A -r <secs> refresh interval\0A -c <ip> add computer\0A -h print usage info\0A -v verbose mode\0A\00"
define void @printHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([192 x i8], [192 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct mmlbuf {
  int dummy;
};

/* Variables and functions */
size_t mmlbuf_pos(struct mmlbuf *);
size_t mmlbuf_size(struct mmlbuf *);
size_t mmlbuf_left(struct mmlbuf *mmlbuf) {
  return mmlbuf_size(mmlbuf) - mmlbuf_pos(mmlbuf);
}


x86 assembly (clang, -O0):
<mmlbuf_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mmlbuf_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mmlbuf_pos@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmlbuf_left>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <mmlbuf_size@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <mmlbuf_pos@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.mmlbuf = type { i32 }
define i64 @mmlbuf_left(%struct.mmlbuf* %0) {
%2 = alloca %struct.mmlbuf*
store %struct.mmlbuf* %0, %struct.mmlbuf** %2
%3 = load %struct.mmlbuf*, %struct.mmlbuf** %2
%4 = call i64 @mmlbuf_size(%struct.mmlbuf* %3)
%5 = load %struct.mmlbuf*, %struct.mmlbuf** %2
%6 = call i64 @mmlbuf_pos(%struct.mmlbuf* %5)
%7 = sub i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.mmlbuf = type { i32 }
define i64 @mmlbuf_left(%struct.mmlbuf* %0) {
%2 = tail call i64 @mmlbuf_size(%struct.mmlbuf* %0)
%3 = tail call i64 @mmlbuf_pos(%struct.mmlbuf* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
void g_DUMMY_close_console(void) { ; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_close_console() {
ret void
}
/* Type definitions */
struct path {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
struct path *new_path_internal(char *, int);
struct path *new_path_from_abspath(char *path) {
  assert(((path) && path[0] == '/'));
  return new_path_internal(path, 1);
}


x86 assembly (clang, -O0):
<new_path_from_abspath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114c <new_path_from_abspath+0x2c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <new_path_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_path_from_abspath>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1134 <new_path_from_abspath+0x14>
xor    %edi,%edi
cmpb   $0x2f,(%rbx)
sete   %dil
jmp    1136 <new_path_from_abspath+0x16>
xor    %edi,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <new_path_internal@plt>

LLVM IR (-O0):
%struct.path = type { i32 }
define %struct.path* @new_path_from_abspath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %2
%16 = call %struct.path* @new_path_internal(i8* %15, i32 1)
ret %struct.path* %16
}

LLVM IR (-O2):
%struct.path = type { i32 }
define %struct.path* @new_path_from_abspath(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 47
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
%9 = tail call i32 @assert(i32 %8)
%10 = tail call %struct.path* @new_path_internal(i8* %0, i32 1)
ret %struct.path* %10
}
int ft_toupper(int c) {
  if (c > 96 && c < 123)
    return (c - 32);
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x60,-0x8(%rbp)
jle    1129 <ft_toupper+0x29>
cmpl   $0x7b,-0x8(%rbp)
jge    1129 <ft_toupper+0x29>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 96
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 123
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int sig) { printf("Signal recu\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Signal recu\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Signal recu\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}