xunge/DecIR huggingface dataset:
ssequal(substr, str) char *substr, *str;
{
  while (*substr)
    if (*substr++ != *str++)
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<ssequal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <ssequal+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <ssequal+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <ssequal+0x5d>
jmp    110c <ssequal+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssequal>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1127 <ssequal+0x27>
lea    0x1(%rax),%rdx
cmp    (%rsi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <ssequal+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ssequal(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %6, %11
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xcf() {
  Assert_real((isdigit(207) == 0),
              "/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_isdigit.c",
              1040, ("isdigit should be 0 for 0xcf"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xcf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcf,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x410,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x410,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xcf\00"
define void @t_isdigit_0xcf() {
%1 = call i64 @isdigit(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xcf\00"
define void @t_isdigit_0xcf() {
%1 = tail call i64 @isdigit(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_binder(char *);
int /*<<< orphan*/ stop_binder();
int /*<<< orphan*/ test_binder(int);
int main() {
  int i;
  start_binder("binder_test");
  for (i = 8080; i <= 8084; i++)
    test_binder(i);
  stop_binder();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <start_binder@plt>
movl   $0x1f90,-0x8(%rbp)
cmpl   $0x1f94,-0x8(%rbp)
jg     1175 <main+0x45>
mov    -0x8(%rbp),%edi
call   1030 <test_binder@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x22>
mov    $0x0,%al
call   1050 <stop_binder@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <start_binder@plt>
mov    $0x1f90,%edi
call   1030 <test_binder@plt>
mov    $0x1f91,%edi
call   1030 <test_binder@plt>
mov    $0x1f92,%edi
call   1030 <test_binder@plt>
mov    $0x1f93,%edi
call   1030 <test_binder@plt>
mov    $0x1f94,%edi
call   1030 <test_binder@plt>
xor    %eax,%eax
call   1050 <stop_binder@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"binder_test\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @start_binder(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 8080, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 8084
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @test_binder(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = call i32 (...) @stop_binder()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"binder_test\00"
define i32 @main() {
%1 = tail call i32 @start_binder(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test_binder(i32 8080)
%3 = tail call i32 @test_binder(i32 8081)
%4 = tail call i32 @test_binder(i32 8082)
%5 = tail call i32 @test_binder(i32 8083)
%6 = tail call i32 @test_binder(i32 8084)
%7 = tail call i32 (...) @stop_binder()
ret i32 0
}
/* Type definitions */
typedef unsigned int rgba;

/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned int);
void vga_set_palette(int i, unsigned int rgba) {
  unsigned int r, g, b;
  r = (rgba >> 16) & 0xff;
  g = (rgba >> 8) & 0xff;
  b = (rgba)&0xff;
  outb(0x3c8, i);
  outb(0x3c9, r >> 2);
  outb(0x3c9, g >> 2);
  outb(0x3c9, b >> 2);
}


x86 assembly (clang, -O0):
<vga_set_palette>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3c8,%edi
call   1030 <outb@plt>
mov    -0xc(%rbp),%esi
shr    $0x2,%esi
mov    $0x3c9,%edi
call   1030 <outb@plt>
mov    -0x10(%rbp),%esi
shr    $0x2,%esi
mov    $0x3c9,%edi
call   1030 <outb@plt>
mov    -0x14(%rbp),%esi
shr    $0x2,%esi
mov    $0x3c9,%edi
call   1030 <outb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_set_palette>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    %ebx,%ebp
shr    $0x12,%ebp
and    $0x3f,%ebp
mov    %ebx,%r14d
shr    $0xa,%r14d
and    $0x3f,%r14d
mov    $0x3c8,%edi
call   1030 <outb@plt>
mov    $0x3c9,%edi
mov    %ebp,%esi
call   1030 <outb@plt>
mov    $0x3c9,%edi
mov    %r14d,%esi
call   1030 <outb@plt>
shr    $0x2,%ebx
and    $0x3f,%ebx
mov    $0x3c9,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @vga_set_palette(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = lshr i32 %8, 16
%10 = and i32 %9, 255
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
store i32 %13, i32* %6
%14 = load i32, i32* %4
%15 = and i32 %14, 255
store i32 %15, i32* %7
%16 = load i32, i32* %3
%17 = call i32 @outb(i32 968, i32 %16)
%18 = load i32, i32* %5
%19 = lshr i32 %18, 2
%20 = call i32 @outb(i32 969, i32 %19)
%21 = load i32, i32* %6
%22 = lshr i32 %21, 2
%23 = call i32 @outb(i32 969, i32 %22)
%24 = load i32, i32* %7
%25 = lshr i32 %24, 2
%26 = call i32 @outb(i32 969, i32 %25)
ret void
}

LLVM IR (-O2):
define void @vga_set_palette(i32 %0, i32 %1) {
%3 = lshr i32 %1, 18
%4 = and i32 %3, 63
%5 = lshr i32 %1, 10
%6 = and i32 %5, 63
%7 = tail call i32 @outb(i32 968, i32 %0)
%8 = tail call i32 @outb(i32 969, i32 %4)
%9 = tail call i32 @outb(i32 969, i32 %6)
%10 = lshr i32 %1, 2
%11 = and i32 %10, 63
%12 = tail call i32 @outb(i32 969, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OAL_DELETE_SEMAPHORE();
signed int fc8180_spib_deinit(void *handle) {
  OAL_DELETE_SEMAPHORE();
  return 0;
}


x86 assembly (clang, -O0):
<fc8180_spib_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <OAL_DELETE_SEMAPHORE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fc8180_spib_deinit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @OAL_DELETE_SEMAPHORE()
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8180_spib_deinit(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @OAL_DELETE_SEMAPHORE()
ret i32 0
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sockaddr_un *);
void tow_unix_socket_address_free(struct sockaddr_un *socket_address) {
  free(socket_address);
}


x86 assembly (clang, -O0):
<tow_unix_socket_address_free>:
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):
<tow_unix_socket_address_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
define void @tow_unix_socket_address_free(%struct.sockaddr_un* nocapture %0) {
%2 = tail call i32 @free(%struct.sockaddr_un* %0)
ret void
}
int main(int argc, char **argv) {
  if (get_matrix())
    printf("%s : error in setting intial matrix \n", __func__);
  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 <get_matrix@plt>
cmp    $0x0,%eax
je     115b <main+0x3b>
lea    0xeb3(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <get_matrix@plt>
test   %eax,%eax
je     1141 <main+0x21>
lea    0xecd(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"%s : error in setting intial matrix \0A\00"
@__func__.main = [5 x i8] c"main\00"
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 (...) @get_matrix()
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"%s : error in setting intial matrix \0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_matrix()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ executeApplescriptToGetString(char *, char *, char *);
int strlen(char *);
int getCurrentPlaylist(char *name) {
  executeApplescriptToGetString("iTunes", "name of current playlist as string",
                                name);
  return strlen(name);
}


x86 assembly (clang, -O0):
<getCurrentPlaylist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xec9(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1030 <executeApplescriptToGetString@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentPlaylist>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %rbx,%rdx
call   1030 <executeApplescriptToGetString@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [35 x i8] c"name of current playlist as string\00"
define i32 @getCurrentPlaylist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @executeApplescriptToGetString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [35 x i8] c"name of current playlist as string\00"
define i32 @getCurrentPlaylist(i8* %0) {
%2 = tail call i32 @executeApplescriptToGetString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
void gtk_tree_view_get_hadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_hadjustment() {
ret void
}
void sig_ignore(int signum) {}


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

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

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

LLVM IR (-O2):
define void @sig_ignore(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foobar();
int main() {
  foobar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foobar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void error(const char *message) {
  fputs(message, stderr);
  fflush(stdout);
  exit(314);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x13a,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x13a,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @exit(i32 314)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 314)
unreachable
}
/* Variables and functions */
int bar(int, int);
int foo(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", foo(20, 10));
  printf("%d\n", bar(20, 10));
  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    $0x14,%edi
mov    $0xa,%esi
call   1050 <foo@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x14,%edi
mov    $0xa,%esi
call   1030 <bar@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
mov    $0xa,%esi
call   1050 <foo@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x14,%edi
mov    $0xa,%esi
call   1030 <bar@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
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 @foo(i32 20, i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @bar(i32 20, i32 10)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 20, i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @bar(i32 20, i32 10)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void integrity_inode_free(struct inode *inode) { return; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @integrity_inode_free(%struct.inode* nocapture %0) {
ret void
}
void stdout_setup(int rate) { return; }


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

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

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

LLVM IR (-O2):
define void @stdout_setup(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void matchoffprint(int off) {
  switch (off) {
  case -2:
    printf("X");
    break;
  case -1:
    printf("?");
    break;
  default:
    printf("%d", off);
    break;
  }
}


x86 assembly (clang, -O0):
<matchoffprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xfffffffe,%eax
je     1140 <matchoffprint+0x30>
jmp    112f <matchoffprint+0x1f>
mov    -0x8(%rbp),%eax
sub    $0xffffffff,%eax
je     1153 <matchoffprint+0x43>
jmp    1166 <matchoffprint+0x56>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1177 <matchoffprint+0x67>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1177 <matchoffprint+0x67>
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchoffprint>:
cmp    $0xffffffff,%edi
je     1136 <matchoffprint+0x16>
mov    %edi,%esi
cmp    $0xfffffffe,%edi
jne    1140 <matchoffprint+0x20>
mov    $0x58,%edi
jmp    1030 <putchar@plt>
mov    $0x3f,%edi
jmp    1030 <putchar@plt>
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"X\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [3 x i8] c"%d\00"
define void @matchoffprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 -2, label %4
i32 -1, label %6
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
define void @matchoffprint(i32 %0) {
switch i32 %0, label %6 [
i32 -2, label %2
i32 -1, label %4
]
2: ; preds = %1
%3 = tail call i32 @putchar(i32 88)
br label %8
4: ; preds = %1
%5 = tail call i32 @putchar(i32 63)
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %4, %2
ret void
}
/* Variables and functions */
char *malloc(int);
char *h() { return malloc(1); }


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

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

LLVM IR (-O0):
define i8* @h() {
%1 = call i8* @malloc(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @h() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
ret i8* %1
}
void ar9003_hw_rtt_enable(struct ath_hw *ah) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ath_hw = type opaque
define void @ar9003_hw_rtt_enable(%struct.ath_hw* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int main() {
  char *foo;
  char *bar;
  foo = (char *)malloc(10);
  bar = (char *)malloc(10);
  bar[2] = 'z';
  memcpy(foo, bar, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x7a,0x2(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
movb   $0x7a,0x2(%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0xa,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = call i64 @malloc(i32 10)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8 122, i8* %9
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @memcpy(i8* %10, i8* %11, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
%5 = getelementptr inbounds i8, i8* %4, i64 2
store i8 122, i8* %5
%6 = tail call i32 @memcpy(i8* %2, i8* %4, i32 10)
ret i32 0
}
/* Variables and functions */
int MenuFontToHandle(int);
int trap_R_Font_HeightPixels(int, float);
int CG_Text_Height(const char *text, float scale, int iMenuFont) {
  int iFontIndex = MenuFontToHandle(iMenuFont);
  return trap_R_Font_HeightPixels(iFontIndex, scale);
}


x86 assembly (clang, -O0):
<CG_Text_Height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <MenuFontToHandle@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
movss  -0xc(%rbp),%xmm0
call   1030 <trap_R_Font_HeightPixels@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_Text_Height>:
push   %rax
mov    %esi,%edi
movss  %xmm0,0x4(%rsp)
call   1040 <MenuFontToHandle@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <trap_R_Font_HeightPixels@plt>

LLVM IR (-O0):
define i32 @CG_Text_Height(i8* %0, float %1, i32 %2) {
%4 = alloca i8*
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store float %1, float* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @MenuFontToHandle(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load float, float* %5
%12 = call i32 @trap_R_Font_HeightPixels(i32 %10, float %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @CG_Text_Height(i8* nocapture readnone %0, float %1, i32 %2) {
%4 = tail call i32 @MenuFontToHandle(i32 %2)
%5 = tail call i32 @trap_R_Font_HeightPixels(i32 %4, float %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsrp(char *, void *);
void wsrp_1(void *v) { __builtin_arm_wsrp("sysreg", v); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"sysreg\00"
define void @wsrp_1(i8* %0) {
%2 = tail call i32 @__builtin_arm_wsrp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int rand();
void random1(int length, int size) {
  int i;
  for (i = 0; i < length; i++) {
    printf("%d ", rand() % size);
  }
  puts("");
}


x86 assembly (clang, -O0):
<random1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1178 <random1+0x48>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <random1+0x15>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random1>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1169 <random1+0x39>
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xebd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %r14,%rdi
mov    %edx,%esi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <random1+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [1 x i8] zeroinitializer
define void @random1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
%19 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @random1(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dec(int);
void cal_novalue(int a) { dec(a); }


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

x86 assembly (clang, -O2):
<cal_novalue>:
jmp    1030 <dec@plt>

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

LLVM IR (-O2):
define void @cal_novalue(i32 %0) {
%2 = tail call i32 @dec(i32 %0)
ret void
}
int hasDirectoryFlag(char *param) { return param[0] == '-' && param[1] == 'd'; }


x86 assembly (clang, -O0):
<hasDirectoryFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    112e <hasDirectoryFlag+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x64,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasDirectoryFlag>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
jne    1110 <hasDirectoryFlag+0x10>
xor    %eax,%eax
cmpb   $0x64,0x1(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @hasDirectoryFlag(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 100
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void _Z7in_hashPN4java4lang6ObjectE(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z7in_hashPN4java4lang6ObjectE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgldlb(int n) { ngen("%s\t%d(%%ebp),%%al", "movb", n); }


x86 assembly (clang, -O0):
<cgldlb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"%s\09%d(%%ebp),%%al\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgldlb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s\09%d(%%ebp),%%al\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgldlb(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rockchip_wifi_set_carddetect(unsigned int);
void sif_platform_rescan_card(unsigned insert) {
  rockchip_wifi_set_carddetect(insert);
}


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

x86 assembly (clang, -O2):
<sif_platform_rescan_card>:
jmp    1030 <rockchip_wifi_set_carddetect@plt>

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

LLVM IR (-O2):
define void @sif_platform_rescan_card(i32 %0) {
%2 = tail call i32 @rockchip_wifi_set_carddetect(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int somatorio(int);
void main(void) {
  int max = 5;
  printf("%d\n", somatorio(max));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <somatorio@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @somatorio(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int ismatch(char a, char b) {
  if (a == '{' && b == '}')
    return 1;
  else if (a == '(' && b == ')')
    return 1;
  else if (a == '[' && b == ']')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<ismatch>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7b,%eax
jne    1136 <ismatch+0x36>
movsbl -0x6(%rbp),%eax
cmp    $0x7d,%eax
jne    1136 <ismatch+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1189 <ismatch+0x89>
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
jne    115c <ismatch+0x5c>
movsbl -0x6(%rbp),%eax
cmp    $0x29,%eax
jne    115c <ismatch+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1189 <ismatch+0x89>
movsbl -0x5(%rbp),%eax
cmp    $0x5b,%eax
jne    1182 <ismatch+0x82>
movsbl -0x6(%rbp),%eax
cmp    $0x5d,%eax
jne    1182 <ismatch+0x82>
movl   $0x1,-0x4(%rbp)
jmp    1189 <ismatch+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismatch>:
mov    $0x1,%eax
cmp    $0x7b,%dil
jne    1112 <ismatch+0x12>
cmp    $0x7d,%sil
jne    1112 <ismatch+0x12>
ret
cmp    $0x28,%dil
jne    111e <ismatch+0x1e>
cmp    $0x29,%sil
je     1111 <ismatch+0x11>
xor    $0x5b,%dil
xor    $0x5d,%sil
xor    %eax,%eax
or     %dil,%sil
sete   %al
ret

LLVM IR (-O0):
define i32 @ismatch(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 123
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 125
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %3
br label %33
14: ; preds = %9, %2
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 40
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 41
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %33
23: ; preds = %18, %14
%24 = load i8, i8* %4
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 91
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = load i8, i8* %5
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 93
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 1, i32* %3
br label %33
32: ; preds = %27, %23
store i32 0, i32* %3
br label %33
33: ; preds = %32, %31, %22, %13
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @ismatch(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 123
%4 = icmp eq i8 %1, 125
%5 = and i1 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = icmp eq i8 %0, 40
%8 = icmp eq i8 %1, 41
%9 = and i1 %7, %8
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = icmp eq i8 %0, 91
%12 = icmp eq i8 %1, 93
%13 = and i1 %11, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %6, %2
%16 = phi i32 [ 1, %2 ], [ 1, %6 ], [ %14, %10 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void paintCellHorizontalBorder(int rowLength) {
  for (int i = 0; i < rowLength; i++) {
    printf("+-");
  }
  printf("+\n");
}


x86 assembly (clang, -O0):
<paintCellHorizontalBorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <paintCellHorizontalBorder+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <paintCellHorizontalBorder+0x12>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paintCellHorizontalBorder>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    114d <paintCellHorizontalBorder+0x2d>
mov    %edi,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <paintCellHorizontalBorder+0x20>
lea    0xeaf(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"+-\00"
@str = [2 x i8] c"+\00"
define void @paintCellHorizontalBorder(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %5
}
int strstructcmp(key, datum) const void *key, *datum;
{ return strcmp((char *)key, *(char **)datum); }


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

x86 assembly (clang, -O2):
<strstructcmp>:
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strstructcmp(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 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %5, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strstructcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Variables and functions */
void *brk(void *);
void *do_brk(void *addr) { return brk(addr); }


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

x86 assembly (clang, -O2):
<do_brk>:
jmp    1030 <brk@plt>

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

LLVM IR (-O2):
define i8* @do_brk(i8* %0) {
%2 = tail call i8* @brk(i8* %0)
ret i8* %2
}
/* Variables and functions */
int _kbhit();
int kbhit(void) { return _kbhit(); }


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

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

LLVM IR (-O0):
define i32 @kbhit() {
%1 = call i32 (...) @_kbhit()
ret i32 %1
}

LLVM IR (-O2):
define i32 @kbhit() {
%1 = tail call i32 (...) @_kbhit()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ exit(int);
int main(void) {
  char *av[1];
  av[0] = NULL;
  execv("/usr/local/vocp/bin/xfer_to_vocp.pl", av);
  exit(254);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <execv@plt>
mov    $0xfe,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execv@plt>
mov    $0xfe,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"/usr/local/vocp/bin/xfer_to_vocp.pl\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i8*]
store i32 0, i32* %1
%3 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
store i8* null, i8** %3
%4 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%5 = call i32 @execv(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = call i32 @exit(i32 254)
unreachable
}

LLVM IR (-O2):
@.str = [36 x i8] c"/usr/local/vocp/bin/xfer_to_vocp.pl\00"
define i32 @main() {
%1 = alloca [1 x i8*]
%2 = bitcast [1 x i8*]* %1 to i8*
%3 = getelementptr inbounds [1 x i8*], [1 x i8*]* %1, i64 0, i64 0
store i8* null, i8** %3
%4 = call i32 @execv(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @exit(i32 254)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int *t;
  int x;
  x = 10;
  t = &x;
  printf("adresse = %p valeur = %d\n", t, *t);
  *t = 5;
  printf("x=%d", x);
  printf("adresse = %p valeur = %d\n", t, t[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xedd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x5,0x4(%rsp)
lea    0xed1(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"adresse = %p valeur = %d\0A\00"
@.str.1 = [5 x i8] c"x=%d\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
store i32 10, i32* %2
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32* %3, i32 %5)
%7 = load i32*, i32** %1
store i32 5, i32* %7
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %1
%11 = load i32*, i32** %1
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32* %10, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"adresse = %p valeur = %d\0A\00"
@.str.1 = [5 x i8] c"x=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32* %1, i32 10)
store i32 5, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32* %1, i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int interleave_pthread_mutex_lock(pthread_mutex_t *mutex) {
  return pthread_mutex_lock(mutex);
}


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

x86 assembly (clang, -O2):
<interleave_pthread_mutex_lock>:
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @interleave_pthread_mutex_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret i32 %2
}