xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help(char **prgname) {
  printf("Copyright (C) 2012 Marcus Jansson <mjansson256@yahoo.se>\n");
  printf("Usage: %s s\n", *prgname);
  printf("Where: ");
  printf("	s = nr of seconds to delay\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xf02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Copyright (C) 2012 Marcus Jansson <mjansson256@yahoo.se>\0A\00"
@.str.1 = [13 x i8] c"Usage: %s s\0A\00"
@.str.2 = [8 x i8] c"Where: \00"
@.str.3 = [29 x i8] c"\09s = nr of seconds to delay\0A\00"
define void @help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"Usage: %s s\0A\00"
@.str.2 = [8 x i8] c"Where: \00"
@str = [57 x i8] c"Copyright (C) 2012 Marcus Jansson <mjansson256@yahoo.se>\00"
@str.4 = [28 x i8] c"\09s = nr of seconds to delay\00"
define void @help(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
ret void
}
float t28_routine() { return 2.71; }


x86 assembly (clang, -O0):
<t28_routine>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<t28_routine>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @t28_routine() {
ret float 0x4005AE1480000000
}

LLVM IR (-O2):
define float @t28_routine() {
ret float 0x4005AE1480000000
}
__attribute__((no)) long trampoline_munmap(unsigned long n1, unsigned long n2) {
  long ret;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0x10"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       : "D"(n1), "S"(n2)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<trampoline_munmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x10010
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_munmap>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x10010
ret

LLVM IR (-O0):
define i64 @trampoline_munmap(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0x10\0A\091:\0A\09", "={ax},{di},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @trampoline_munmap(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0x10\0A\091:\0A\09", "={ax},{di},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
void gtk_menu_popdown() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_popdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x72() {
  Assert_real((isalnum(114)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              575, ("isalnum should be 1 for r"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x72>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x23f,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x72>:
push   %rax
mov    $0x72,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x23f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for r\00"
define void @t_isalnum_0x72() {
%1 = call i32 @isalnum(i32 114)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for r\00"
define void @t_isalnum_0x72() {
%1 = tail call i32 @isalnum(i32 114)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strtol(char const *, int /*<<< orphan*/, int);
int cstring_to_int(const char *s, int base) {
  return (s != 0) ? (int)strtol(s, 0, base) : 0;
}


x86 assembly (clang, -O0):
<cstring_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <cstring_to_int+0x30>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <strtol@plt>
mov    %eax,-0x10(%rbp)
jmp    114a <cstring_to_int+0x3a>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <cstring_to_int+0x3a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstring_to_int>:
test   %rdi,%rdi
je     1124 <cstring_to_int+0x14>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <strtol@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cstring_to_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i64 @strtol(i8* %8, i32 0, i32 %9)
%11 = trunc i64 %10 to i32
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %7
%14 = phi i32 [ %11, %7 ], [ 0, %12 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @cstring_to_int(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @strtol(i8* %0, i32 0, i32 %1)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
size_t step_left(const char *buf, size_t pos) {
  return (pos == 0 ? 0 : pos - 1);
}


x86 assembly (clang, -O0):
<step_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1122 <step_left+0x22>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    112e <step_left+0x2e>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<step_left>:
xor    %eax,%eax
sub    $0x1,%rsi
cmovae %rsi,%rax
ret

LLVM IR (-O0):
define i64 @step_left(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %11
8: ; preds = %2
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
br label %11
11: ; preds = %8, %7
%12 = phi i64 [ 0, %7 ], [ %10, %8 ]
ret i64 %12
}

LLVM IR (-O2):
define i64 @step_left(i8* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = add i64 %1, -1
%5 = select i1 %3, i64 0, i64 %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_brainfuck_comment() {
  test_parser_verify_parse(test_parser_sourcefile("brainfuck", " #comment"),
                           "brainfuck", "", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_brainfuck_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xebd(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_brainfuck_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rdx
lea    0xec6(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"brainfuck\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_brainfuck_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"brainfuck\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_brainfuck_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void function(const char *str) {
  char dummy[512] = {0};
  __asm__("lea %0, %%r8" : "=m"(dummy));
  char buffer[10];
  strcpy(buffer, str);
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
lea    -0x210(%rbp),%r8
lea    -0x21a(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
sub    $0x208,%rsp
mov    %rsp,%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   1030 <memset@plt>
lea    (%rsp),%r8
add    $0x208,%rsp
ret

LLVM IR (-O0):
define void @function(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
%4 = alloca [10 x i8]
store i8* %0, i8** %2
%5 = bitcast [512 x i8]* %3 to i8*
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @function(i8* nocapture readnone %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
ret void
}
int __arch_compare_and_swap(volatile long int *p, long int oldval,
                            long int newval) {
  return __sync_val_compare_and_swap(p, oldval, newval);
}


x86 assembly (clang, -O0):
<__arch_compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<__arch_compare_and_swap>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i32 @__arch_compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = cmpxchg i64* %7, i64 %8, i64 %9 seq_cst seq_cst
%11 = extractvalue { i64, i1 } %10, 0
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @__arch_compare_and_swap(i64* nocapture %0, i64 %1, i64 %2) {
%4 = cmpxchg i64* %0, i64 %1, i64 %2 seq_cst seq_cst
%5 = extractvalue { i64, i1 } %4, 0
%6 = trunc i64 %5 to i32
ret i32 %6
}
void *LoadSharedLibrary(const char *path, int flags) { return 0; }


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

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

LLVM IR (-O0):
define i8* @LoadSharedLibrary(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @LoadSharedLibrary(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
void CLStringObjectList_destruct(struct CLStringObjectList *self) {}


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

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

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

LLVM IR (-O2):
%struct.CLStringObjectList = type opaque
define void @CLStringObjectList_destruct(%struct.CLStringObjectList* nocapture %0) {
ret void
}
int SDL_imageFilterBitOrMMX(unsigned char *Src1, unsigned char *Src2,
                            unsigned char *Dest, unsigned int SrcLength) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterBitOrMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_imageFilterBitOrMMX>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @SDL_imageFilterBitOrMMX(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterBitOrMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
struct ListNode *addTwoNumbers(struct ListNode *, struct ListNode *);
struct ListNode *gen(int);
int /*<<< orphan*/ print(struct ListNode *);
int main() {
  struct ListNode *p, *q;
  p = gen(555);
  q = gen(555);
  struct ListNode *res;
  print(p);
  res = addTwoNumbers(p, q);
  print(res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x22b,%edi
call   1050 <gen@plt>
mov    %rax,-0x10(%rbp)
mov    $0x22b,%edi
call   1050 <gen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <print@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <addTwoNumbers@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x22b,%edi
call   1050 <gen@plt>
mov    %rax,%rbx
mov    $0x22b,%edi
call   1050 <gen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <addTwoNumbers@plt>
mov    %rax,%rdi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ListNode*
%3 = alloca %struct.ListNode*
%4 = alloca %struct.ListNode*
store i32 0, i32* %1
%5 = call %struct.ListNode* @gen(i32 555)
store %struct.ListNode* %5, %struct.ListNode** %2
%6 = call %struct.ListNode* @gen(i32 555)
store %struct.ListNode* %6, %struct.ListNode** %3
%7 = load %struct.ListNode*, %struct.ListNode** %2
%8 = call i32 @print(%struct.ListNode* %7)
%9 = load %struct.ListNode*, %struct.ListNode** %2
%10 = load %struct.ListNode*, %struct.ListNode** %3
%11 = call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %9, %struct.ListNode* %10)
store %struct.ListNode* %11, %struct.ListNode** %4
%12 = load %struct.ListNode*, %struct.ListNode** %4
%13 = call i32 @print(%struct.ListNode* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define i32 @main() {
%1 = tail call %struct.ListNode* @gen(i32 555)
%2 = tail call %struct.ListNode* @gen(i32 555)
%3 = tail call i32 @print(%struct.ListNode* %1)
%4 = tail call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %1, %struct.ListNode* %2)
%5 = tail call i32 @print(%struct.ListNode* %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ROR(int, int);
uint32_t sigma0(uint32_t x) { return ROR(x ^ ROR(x, 11) ^ ROR(x, 20), 2); }


x86 assembly (clang, -O0):
<sigma0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb,%esi
call   1030 <ROR@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x14,%esi
call   1030 <ROR@plt>
mov    -0x8(%rbp),%edi
xor    %eax,%edi
mov    $0x2,%esi
call   1030 <ROR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma0>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xb,%esi
call   1030 <ROR@plt>
mov    %eax,%ebp
xor    %ebx,%ebp
mov    %ebx,%edi
mov    $0x14,%esi
call   1030 <ROR@plt>
xor    %eax,%ebp
mov    %ebp,%edi
mov    $0x2,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ROR@plt>

LLVM IR (-O0):
define i32 @sigma0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ROR(i32 %4, i32 11)
%6 = xor i32 %3, %5
%7 = load i32, i32* %2
%8 = call i32 @ROR(i32 %7, i32 20)
%9 = xor i32 %6, %8
%10 = call i32 @ROR(i32 %9, i32 2)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sigma0(i32 %0) {
%2 = tail call i32 @ROR(i32 %0, i32 11)
%3 = xor i32 %2, %0
%4 = tail call i32 @ROR(i32 %0, i32 20)
%5 = xor i32 %3, %4
%6 = tail call i32 @ROR(i32 %5, i32 2)
ret i32 %6
}
int map_buttons(int b) {
  switch (b) {
  case 0x04:
    return (0);
  case 0x02:
    return (1);
  default:
    return (2);
  }
}


x86 assembly (clang, -O0):
<map_buttons>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     1138 <map_buttons+0x38>
jmp    111b <map_buttons+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
jne    1144 <map_buttons+0x44>
jmp    112c <map_buttons+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    114b <map_buttons+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    114b <map_buttons+0x4b>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_buttons>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    $0x2,%ecx
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @map_buttons(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 1, i32 2
%4 = icmp eq i32 %0, 4
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
void gtk_window_get_default_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_default_size() {
ret void
}
int clamp15(int i) { return ((i < 0) ? 0 : ((i > 15) ? 15 : i)); }


x86 assembly (clang, -O0):
<clamp15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <clamp15+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <clamp15+0x3e>
cmpl   $0xf,-0x4(%rbp)
jle    1132 <clamp15+0x32>
mov    $0xf,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <clamp15+0x38>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp15>:
cmp    $0xf,%edi
mov    $0xf,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp15(i32 %0) {
%2 = icmp slt i32 %0, 15
%3 = select i1 %2, i32 %0, i32 15
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
void foo_1_1_2_2_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_2_2_2_1() {
ret void
}
/* Type definitions */
struct kvm_msr_list {
  int nmsrs;
  int /*<<< orphan*/ *indices;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int msr_list_index(void *data, int n, __u32 *index) {
  struct kvm_msr_list *msrs = (struct kvm_msr_list *)data;
  if (n >= msrs->nmsrs) {
    return 1;
  }
  *index = msrs->indices[n];
  return 0;
}


x86 assembly (clang, -O0):
<msr_list_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jl     1132 <msr_list_index+0x32>
movl   $0x1,-0x4(%rbp)
jmp    114e <msr_list_index+0x4e>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msr_list_index>:
mov    $0x1,%eax
cmp    %esi,(%rdi)
jle    1117 <msr_list_index+0x17>
mov    0x8(%rdi),%rax
movslq %esi,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.kvm_msr_list = type { i32, i32* }
define i32 @msr_list_index(i8* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca %struct.kvm_msr_list*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to %struct.kvm_msr_list*
store %struct.kvm_msr_list* %10, %struct.kvm_msr_list** %8
%11 = load i32, i32* %6
%12 = load %struct.kvm_msr_list*, %struct.kvm_msr_list** %8
%13 = getelementptr inbounds %struct.kvm_msr_list, %struct.kvm_msr_list* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = icmp sge i32 %11, %14
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 1, i32* %4
br label %26
17: ; preds = %3
%18 = load %struct.kvm_msr_list*, %struct.kvm_msr_list** %8
%19 = getelementptr inbounds %struct.kvm_msr_list, %struct.kvm_msr_list* %18, i32 0, i32 1
%20 = load i32*, i32** %19
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = load i32*, i32** %7
store i32 %24, i32* %25
store i32 0, i32* %4
br label %26
26: ; preds = %17, %16
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @msr_list_index(i8* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, %1
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = bitcast i8* %8 to i32**
%10 = load i32*, i32** %9
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i32, i32* %10, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %14
14: ; preds = %3, %7
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %15
}
void GPMCReadTypeSelect(unsigned int baseAddr, unsigned int csNum,
                        unsigned int readType) {
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) &=
      ~(0x20000000u);
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) |=
      ((readType << (0x0000001Du)) & (0x20000000u));
}


x86 assembly (clang, -O0):
<GPMCReadTypeSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xdfffffff,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x1d,%edx
and    $0x20000000,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCReadTypeSelect>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x60,%eax
andl   $0xdfffffff,(%rax)
and    $0x1,%edx
shl    $0x1d,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCReadTypeSelect(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 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 96, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -536870913
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 29
%18 = and i32 %17, 536870912
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 96, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCReadTypeSelect(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 96
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -536870913
store volatile i32 %10, i32* %8
%11 = shl i32 %2, 29
%12 = and i32 %11, 536870912
%13 = load volatile i32, i32* %8
%14 = or i32 %13, %12
store volatile i32 %14, i32* %8
ret void
}
float flt_mul_sub(float a, float b, float c) { return (a * b) - c; }


x86 assembly (clang, -O0):
<flt_mul_sub>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_mul_sub>:
mulss  %xmm1,%xmm0
subss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @flt_mul_sub(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fneg float %9
%11 = call float @llvm.fmuladd.f32(float %7, float %8, float %10)
ret float %11
}

LLVM IR (-O2):
define float @flt_mul_sub(float %0, float %1, float %2) {
%4 = fneg float %2
%5 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %4)
ret float %5
}
int main(void) {
  int *x = malloc(4);
  assert(x);
  __asm__ __volatile__("finit\n\t"
                       "ffree %%st(0)\n\t"
                       "ffree %%st(1)\n\t"
                       "ffree %%st(2)\n\t"
                       "ffree %%st(3)\n\t"
                       "ffree %%st(4)\n\t"
                       "ffree %%st(5)\n\t"
                       "ffree %%st(6)\n\t"
                       "ffree %%st(7)\n\t"
                       "andb $128, (%0)\n\t"
                       "fldz\n\t"
                       "fldz\n\t"
                       "fucompp\n\t"
                       "fnstsw %%ax\n\t"
                       "sahf\n\t"
                       "jp .Lfoobar\n"
                       ".Lfoobar:\n\t"
                       "nop"
                       :
                       : "r"(x)
                       : "eax", "cc");
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x10(%rbp),%rcx
finit
ffree  %st(0)
ffree  %st(1)
ffree  %st(2)
ffree  %st(3)
ffree  %st(4)
ffree  %st(5)
ffree  %st(6)
ffree  %st(7)
andb   $0x80,(%rcx)
fldz
fldz
fucompp
fnstsw %ax
sahf
jp     1181 <main+0x51>
nop
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
finit
ffree  %st(0)
ffree  %st(1)
ffree  %st(2)
ffree  %st(3)
ffree  %st(4)
ffree  %st(5)
ffree  %st(6)
ffree  %st(7)
andb   $0x80,(%rbx)
fldz
fldz
fucompp
fnstsw %ax
sahf
jp     1169 <main+0x39>
nop
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i8* @malloc(i64 4)
%4 = bitcast i8* %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %5)
%7 = load i32*, i32** %2
%8 = load i32*, i32** %2
%9 = bitcast i32* %8 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%2 = bitcast i8* %1 to i32*
%3 = tail call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %2)
tail call void asm sideeffect "finit\0A\09ffree %st(0)\0A\09ffree %st(1)\0A\09ffree %st(2)\0A\09ffree %st(3)\0A\09ffree %st(4)\0A\09ffree %st(5)\0A\09ffree %st(6)\0A\09ffree %st(7)\0A\09andb $$128, ($0)\0A\09fldz\0A\09fldz\0A\09fucompp\0A\09fnstsw %ax\0A\09sahf\0A\09jp .Lfoobar\0A.Lfoobar:\0A\09nop", "r,~{eax},~{cc},~{dirflag},~{fpsr},~{flags}"(i32* %2)
tail call void @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ lksmith_postlock(int /*<<< orphan*/ *, int);
int lksmith_prelock(int /*<<< orphan*/ *, int);
int r_pthread_mutex_trylock(int /*<<< orphan*/ *);
int pthread_mutex_trylock(pthread_mutex_t *mutex) {
  int ret = lksmith_prelock(mutex, 1);
  if (ret)
    return ret;
  ret = r_pthread_mutex_trylock(mutex);
  lksmith_postlock(mutex, ret);
  return ret;
}


x86 assembly (clang, -O0):
<pthread_mutex_trylock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <lksmith_prelock@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1162 <pthread_mutex_trylock+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <pthread_mutex_trylock+0x50>
mov    -0x10(%rbp),%rdi
call   1040 <r_pthread_mutex_trylock@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <lksmith_postlock@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_trylock>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <lksmith_prelock@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    115a <pthread_mutex_trylock+0x2a>
mov    %rbx,%rdi
call   1040 <r_pthread_mutex_trylock@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <lksmith_postlock@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pthread_mutex_trylock(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @lksmith_prelock(i32* %5, i32 1)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %18
11: ; preds = %1
%12 = load i32*, i32** %3
%13 = call i32 @r_pthread_mutex_trylock(i32* %12)
store i32 %13, i32* %4
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = call i32 @lksmith_postlock(i32* %14, i32 %15)
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @pthread_mutex_trylock(i32* %0) {
%2 = tail call i32 @lksmith_prelock(i32* %0, i32 1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @r_pthread_mutex_trylock(i32* %0)
%6 = tail call i32 @lksmith_postlock(i32* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %8
}
int f(int x, int y) {
  switch (x) {
  case 0:
    x += y;
    break;
  case 1:
  case 2:
    x -= y * 2;
    return y;
  default:
    x -= y;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1131 <f+0x31>
jmp    111d <f+0x1d>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     113f <f+0x3f>
jmp    1158 <f+0x58>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <f+0x63>
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <f+0x69>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
sub    %esi,%eax
cmp    $0x3,%edi
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(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
switch i32 %6, label %17 [
i32 0, label %7
i32 1, label %11
i32 2, label %11
]
7: ; preds = %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, %8
store i32 %10, i32* %4
br label %21
11: ; preds = %2, %2
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 2
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %5
store i32 %16, i32* %3
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, %18
store i32 %20, i32* %4
br label %21
21: ; preds = %17, %7
%22 = load i32, i32* %4
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 3
%4 = sub nsw i32 %0, %1
%5 = select i1 %3, i32 %1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void help(const char *argv0) {
  printf("Usage: %s [OPTION]...\n"
         "batch plotting of RRD data files\n"
         "\n"
         "Mandatory arguments to long options are mandatory for short"
         " options too\n"
         "\n"
         " -d, --data-file=FILE       load graph information from FILE\n"
         "     --debug                print debug messages\n"
         " -n, --no-lazy              redraw every single graph\n"
         "     --help     display this help and exit\n"
         "     --version  display version information and exit\n"
         "\n"
         "Report bugs to <morten@rashbox.org>.\n",
         argv0);
}


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

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [428 x i8] c"Usage: %s [OPTION]...\0Abatch plotting of RRD data files\0A\0AMandatory arguments to long options are mandatory for short options too\0A\0A -d, --data-file=FILE load graph information from FILE\0A --debug print debug messages\0A -n, --no-lazy redraw every single graph\0A --help display this help and exit\0A --version display version information and exit\0A\0AReport bugs to <morten@rashbox.org>.\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([428 x i8], [428 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [428 x i8] c"Usage: %s [OPTION]...\0Abatch plotting of RRD data files\0A\0AMandatory arguments to long options are mandatory for short options too\0A\0A -d, --data-file=FILE load graph information from FILE\0A --debug print debug messages\0A -n, --no-lazy redraw every single graph\0A --help display this help and exit\0A --version display version information and exit\0A\0AReport bugs to <morten@rashbox.org>.\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([428 x i8], [428 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPC_Str1(unsigned char *, long long, long long);
void OPC_Halt(long long n) {
  OPC_Str1((unsigned char *)"__HALT(#)", (long long)10, n);
}


x86 assembly (clang, -O0):
<OPC_Halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
mov    $0xa,%esi
call   1030 <OPC_Str1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPC_Halt>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    $0xa,%esi
jmp    1030 <OPC_Str1@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"__HALT(#)\00"
define void @OPC_Halt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @OPC_Str1(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 10, i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"__HALT(#)\00"
define void @OPC_Halt(i64 %0) {
%2 = tail call i32 @OPC_Str1(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 10, i64 %0)
ret void
}
/* Type definitions */
struct IntTree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct IntTree *);
void DestroyInt(struct IntTree *_Tree) { free(_Tree); }


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

x86 assembly (clang, -O2):
<DestroyInt>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.IntTree = type { i32 }
define void @DestroyInt(%struct.IntTree* %0) {
%2 = alloca %struct.IntTree*
store %struct.IntTree* %0, %struct.IntTree** %2
%3 = load %struct.IntTree*, %struct.IntTree** %2
%4 = call i32 @free(%struct.IntTree* %3)
ret void
}

LLVM IR (-O2):
%struct.IntTree = type { i32 }
define void @DestroyInt(%struct.IntTree* nocapture %0) {
%2 = tail call i32 @free(%struct.IntTree* %0)
ret void
}
/* Type definitions */
struct stacka {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int iterator(void *context, struct stacka *stacka, void *data) {
  (void)context;
  (void)stacka;
  printf("%s ", (char *)data);
  return 0;
}


x86 assembly (clang, -O0):
<iterator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stacka = type { i32 }
@.str = [4 x i8] c"%s \00"
define i32 @iterator(i8* %0, %struct.stacka* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.stacka*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.stacka* %1, %struct.stacka** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.stacka*, %struct.stacka** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.stacka = type { i32 }
@.str = [4 x i8] c"%s \00"
define i32 @iterator(i8* nocapture readnone %0, %struct.stacka* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initialiser_signaux();
int /*<<< orphan*/ printf(char *, ...);
int socket_field(int);
int main(void) {
  printf("Light House - Ohpehra\r\n");
  initialiser_signaux();
  int sock4 = socket_field(4);
  printf("%d\n", sock4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <initialiser_signaux@plt>
mov    $0x4,%edi
call   1050 <socket_field@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%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
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <initialiser_signaux@plt>
mov    $0x4,%edi
call   1060 <socket_field@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Light House - Ohpehra\0D\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @initialiser_signaux()
%5 = call i32 @socket_field(i32 4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [23 x i8] c"Light House - Ohpehra\0D\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @initialiser_signaux()
%3 = tail call i32 @socket_field(i32 4)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int, char const *, char const *, long);
int /*<<< orphan*/ stderr;
void warning_trace(const char *assertion, const char *filename,
                   const char *func, unsigned line, long val) {
  if (!val)
    return;
  fprintf(stderr, "%s:%d: %s: Warning: assertion `%s` failed, value %ld\n",
          filename, line, func, assertion, val);
}


x86 assembly (clang, -O0):
<warning_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    113b <warning_trace+0x2b>
jmp    1167 <warning_trace+0x57>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    -0x28(%rbp),%rax
lea    0xea2(%rip),%rsi
mov    %rax,(%rsp)
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning_trace>:
test   %r8,%r8
je     113c <warning_trace+0x2c>
push   %rax
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%r9
mov    0x2eba(%rip),%rsi
mov    (%rsi),%edi
mov    %r8,(%rsp)
lea    0xecd(%rip),%rsi
mov    %rax,%r8
call   1030 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"%s:%d: %s: Warning: assertion `%s` failed, value %ld\0A\00"
define void @warning_trace(i8* %0, i8* %1, i8* %2, i32 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i64, i64* %10
%12 = icmp ne i64 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %5
br label %22
14: ; preds = %5
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %7
%17 = load i32, i32* %9
%18 = load i8*, i8** %8
%19 = load i8*, i8** %6
%20 = load i64, i64* %10
%21 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17, i8* %18, i8* %19, i64 %20)
br label %22
22: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"%s:%d: %s: Warning: assertion `%s` failed, value %ld\0A\00"
define void @warning_trace(i8* %0, i8* %1, i8* %2, i32 %3, i64 %4) {
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %3, i8* %2, i8* %0, i64 %4)
br label %10
10: ; preds = %5, %7
ret void
}
void parseClass() {}


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

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

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

LLVM IR (-O2):
define void @parseClass() {
ret void
}