xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int /*<<< orphan*/);
int client_parse_command(char *command) {
  if (!strncmp(command, "/quit", strlen("/quit"))) {
    return 3;
  } else {
    return 255;
  }
}


x86 assembly (clang, -O0):
<client_parse_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1167 <client_parse_command+0x47>
movl   $0x3,-0x4(%rbp)
jmp    116e <client_parse_command+0x4e>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_parse_command>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
mov    $0x3,%ecx
mov    $0xff,%eax
cmove  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/quit\00"
define i32 @client_parse_command(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strncmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 3, i32* %2
br label %10
9: ; preds = %1
store i32 255, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"/quit\00"
define i32 @client_parse_command(i8* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 3, i32 255
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_uintptr_t;

/* Variables and functions */
scalar_t__ atomic_load(int /*<<< orphan*/ *);
void *stdatomic_read_ptr(atomic_uintptr_t *p) { return (void *)atomic_load(p); }


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

x86 assembly (clang, -O2):
<stdatomic_read_ptr>:
jmp    1030 <atomic_load@plt>

LLVM IR (-O0):
define i8* @stdatomic_read_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @atomic_load(i32* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @stdatomic_read_ptr(i32* %0) {
%2 = tail call i64 @atomic_load(i32* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int gamePrompt(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ startupInfo();
int main() {
  int hp = 100;
  startupInfo();
  printf("Health: %d\n", hp);
  hp = gamePrompt(hp);
  if (hp >= 200)
    puts("Congrats!, You WON!");
  else
    puts("You're dead. You suck at this clearly rigged game.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    $0x0,%al
call   1060 <startupInfo@plt>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <gamePrompt@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jl     1195 <main+0x55>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
jmp    11a1 <main+0x61>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <startupInfo@plt>
lea    0xeb1(%rip),%rdi
mov    $0x64,%esi
call   1050 <printf@plt>
mov    $0x64,%edi
call   1040 <gamePrompt@plt>
cmp    $0xc8,%eax
lea    0xe9d(%rip),%rax
lea    0xeaa(%rip),%rdi
cmovge %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Health: %d\0A\00"
@.str.1 = [20 x i8] c"Congrats!, You WON!\00"
@.str.2 = [51 x i8] c"You're dead. You suck at this clearly rigged game.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = call i32 (...) @startupInfo()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @gamePrompt(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 200
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Health: %d\0A\00"
@.str.1 = [20 x i8] c"Congrats!, You WON!\00"
@.str.2 = [51 x i8] c"You're dead. You suck at this clearly rigged game.\00"
define i32 @main() {
%1 = tail call i32 (...) @startupInfo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 100)
%3 = tail call i32 @gamePrompt(i32 100)
%4 = icmp sgt i32 %3, 199
%5 = select i1 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drawEventString();
int main() {
  drawEventString();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @drawEventString()
ret i32 0
}
/* Variables and functions */
char **lib();
void extern_bad() {
  int arr[10];
  char **p = lib();
  if (p != 0)
    arr[10] = 0;
  char *q = *p;
  if (q != 0)
    arr[20] = 0;
  int r = *q;
  if (r != 0)
    arr[30] = 0;
}


x86 assembly (clang, -O0):
<extern_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1030 <lib@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1135 <extern_bad+0x25>
movl   $0x0,-0x8(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1152 <extern_bad+0x42>
movl   $0x0,0x20(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     116d <extern_bad+0x5d>
movl   $0x0,0x48(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @extern_bad() {
%1 = tail call i8** (...) @lib()
ret void
}
void _barrier(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @_barrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @_barrier() {
fence seq_cst
ret void
}
__attribute__((no, noclone)) int fn3(char x, unsigned short y, int *ovf) {
  int res;
  *ovf = __builtin_add_overflow(x, y, &res);
  return res;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movsbl %cl,%ecx
movzwl %ax,%eax
add    %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
lea    (%rdi,%rsi,1),%eax
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i32 @fn3(i8 signext %0, i16 zeroext %1, i32* %2) {
%4 = alloca i8
%5 = alloca i16
%6 = alloca i32*
%7 = alloca i32
store i8 %0, i8* %4
store i16 %1, i16* %5
store i32* %2, i32** %6
%8 = load i8, i8* %4
%9 = load i16, i16* %5
%10 = sext i8 %8 to i32
%11 = zext i16 %9 to i32
%12 = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %10, i32 %11)
%13 = extractvalue { i32, i1 } %12, 1
%14 = extractvalue { i32, i1 } %12, 0
store i32 %14, i32* %7
%15 = zext i1 %13 to i32
%16 = load i32*, i32** %6
store i32 %15, i32* %16
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @fn3(i8 signext %0, i16 zeroext %1, i32* nocapture writeonly %2) {
%4 = sext i8 %0 to i32
%5 = zext i16 %1 to i32
%6 = add nsw i32 %5, %4
store i32 0, i32* %2
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ *memchr(char *, int, int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ sleep(int);
int thread_main(void *arg) {
  char buffer[1024];
  memset(buffer, 1, sizeof(buffer));
  sleep(2);
  return memchr(buffer, 1, sizeof(buffer)) == NULL;
}


x86 assembly (clang, -O0):
<thread_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x1,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
lea    -0x410(%rbp),%rdi
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <memchr@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <memchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @thread_main(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 1, i32 1024)
%6 = call i32 @sleep(i32 2)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32* @memchr(i8* %7, i32 1, i32 1024)
%9 = icmp eq i32* %8, null
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @thread_main(i8* nocapture readnone %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 1, i32 1024)
%5 = call i32 @sleep(i32 2)
%6 = call i32* @memchr(i8* %3, i32 1, i32 1024)
%7 = icmp eq i32* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}
void gtk_tool_item_set_is_important() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_set_is_important() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
main() {
  int num1 = 5, num2 = 8;
  func(num1, num2);
  printf("\n[Press any key to close]");
  getchar();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x8,%esi
call   1050 <func@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0A[Press any key to close]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
store i32 8, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @func(i32 %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0A[Press any key to close]\00"
define i32 @main() {
%1 = tail call i32 @func(i32 5, i32 8)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char);
void uart_send_char(char c) { uart_putc(c); }


x86 assembly (clang, -O0):
<uart_send_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <uart_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send_char>:
jmp    1030 <uart_putc@plt>

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

LLVM IR (-O2):
define void @uart_send_char(i8 signext %0) {
%2 = tail call i32 @uart_putc(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a;
  printf("Enter the number:");
  scanf("%d", &a);
  if (a % 2 == 0)
    printf("THe number is an even number");
  else
    printf("THe number is an odd number");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xecb(%rip),%rax
lea    0xee1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter the number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"THe number is an even number\00"
@.str.3 = [28 x i8] c"THe number is an odd number\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter the number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"THe number is an even number\00"
@.str.3 = [28 x i8] c"THe number is an odd number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void no_argument() {
  int i = 3;
  int j = 1345;
  printf("%d %d %d\n", i, j, j << i);
}


x86 assembly (clang, -O0):
<no_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x541,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_argument>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
mov    $0x541,%edx
mov    $0x2a08,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define void @no_argument() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3, i32 1345, i32 10760)
ret void
}
/* Variables and functions */
size_t build_query(char *, size_t, int, char const *, int);
size_t dns_build_ptr_query(char *buf, size_t size, const char *dn, int edns) {
  return build_query(buf, size, 12, dn, edns);
}


x86 assembly (clang, -O0):
<dns_build_ptr_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0xc,%edx
call   1030 <build_query@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_build_ptr_query>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    $0xc,%edx
jmp    1030 <build_query@plt>

LLVM IR (-O0):
define i64 @dns_build_ptr_query(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i64 @build_query(i8* %9, i64 %10, i32 12, i8* %11, i32 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @dns_build_ptr_query(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i64 @build_query(i8* %0, i64 %1, i32 12, i8* %2, i32 %3)
ret i64 %5
}
int int_clamp(int a, int min, int max) {
  if (a < min)
    return min;
  if (a > max)
    return max;
  return a;
}


x86 assembly (clang, -O0):
<int_clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <int_clamp+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <int_clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <int_clamp+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <int_clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
int test_imm_04uint8_mem(unsigned char *val) {
  return ((*val) & (0x04 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_04uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_04uint8_mem>:
testb  $0x4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_04uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 4
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gtk_tree_iter_free() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_iter_free() {
ret void
}
/* Variables and functions */
long rul__conrg_get_cur_block_index();
int /*<<< orphan*/ sprintf(char *, char *, char *, long);
char *gen_get_cur_css_name(void) {
  static char name_buffer[50];
  long bl_num;
  bl_num = rul__conrg_get_cur_block_index();
  sprintf(name_buffer, "%s%ld_cs_subset", "rul_", bl_num);
  return (name_buffer);
}


x86 assembly (clang, -O0):
<gen_get_cur_css_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rul__conrg_get_cur_block_index@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0x2f02(%rip),%rdi
lea    0xebb(%rip),%rsi
lea    0xec4(%rip),%rdx
call   1040 <sprintf@plt>
lea    0x2ee8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_get_cur_css_name>:
push   %rbx
xor    %eax,%eax
call   1030 <rul__conrg_get_cur_block_index@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rsi
lea    0xed3(%rip),%rdx
mov    %rbx,%rdi
mov    %rax,%rcx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@gen_get_cur_css_name.name_buffer = internal global [50 x i8] zeroinitializer
@.str = [16 x i8] c"%s%ld_cs_subset\00"
@.str.1 = [5 x i8] c"rul_\00"
define i8* @gen_get_cur_css_name() {
%1 = alloca i64
%2 = call i64 (...) @rul__conrg_get_cur_block_index()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @sprintf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gen_get_cur_css_name.name_buffer, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %3)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gen_get_cur_css_name.name_buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@gen_get_cur_css_name.name_buffer = internal global [50 x i8] zeroinitializer
@.str = [16 x i8] c"%s%ld_cs_subset\00"
@.str.1 = [5 x i8] c"rul_\00"
define i8* @gen_get_cur_css_name() {
%1 = tail call i64 (...) @rul__conrg_get_cur_block_index()
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @gen_get_cur_css_name.name_buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %1)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @gen_get_cur_css_name.name_buffer, i64 0, i64 0)
}
int subdir(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @subdir() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void another_function() { printf("Just another function\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Just another function\0A\00"
define void @another_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Just another function\00"
define void @another_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((always_)) int devtmpfs_create_node(struct device *dev) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @devtmpfs_create_node(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_GetTransportInfo(void *, char *,
                                                             char *, char *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPAVTransport_GetTransportInfo(void *upnptoken,
                                      unsigned int InstanceID) {
  printf("Invoke: UPnPAVTransport_GetTransportInfo(%u);\r\n", InstanceID);
  UPnPResponse_AVTransport_GetTransportInfo(upnptoken, "Sample String",
                                            "Sample String", "Sample String");
}


x86 assembly (clang, -O0):
<UPnPAVTransport_GetTransportInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xee7(%rip),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1040 <UPnPResponse_AVTransport_GetTransportInfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_GetTransportInfo>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rcx
mov    %rbx,%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
pop    %rbx
jmp    1040 <UPnPResponse_AVTransport_GetTransportInfo@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Invoke: UPnPAVTransport_GetTransportInfo(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPAVTransport_GetTransportInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_AVTransport_GetTransportInfo(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Invoke: UPnPAVTransport_GetTransportInfo(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPAVTransport_GetTransportInfo(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_AVTransport_GetTransportInfo(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int linearSearch(int arrayToSearch[], int numberOfElements, int elementToFind) {
  int searchPosition = -1;
  for (int i = 0; i < numberOfElements; i++) {
    if (arrayToSearch[i] == elementToFind) {
      searchPosition = i;
      break;
    }
  }
  return searchPosition;
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <linearSearch+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    1147 <linearSearch+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    115a <linearSearch+0x5a>
jmp    114c <linearSearch+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <linearSearch+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearSearch>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linearSearch+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linearSearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linearSearch+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linearSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int check(void *p) {
  if (!p)
    exit(1);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1131 <check+0x21>
mov    $0x1,%edi
call   1030 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %rdi,%rdi
je     1116 <check+0x6>
ret
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @check(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pop();
int /*<<< orphan*/ print();
int /*<<< orphan*/ push(int);
int main() {
  push(1);
  push(2);
  push(4);
  push(7);
  push(8);
  push(5);
  print();
  pop();
  print();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <push@plt>
mov    $0x2,%edi
call   1050 <push@plt>
mov    $0x4,%edi
call   1050 <push@plt>
mov    $0x7,%edi
call   1050 <push@plt>
mov    $0x8,%edi
call   1050 <push@plt>
mov    $0x5,%edi
call   1050 <push@plt>
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
call   1040 <pop@plt>
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @push(i32 1)
%3 = call i32 @push(i32 2)
%4 = call i32 @push(i32 4)
%5 = call i32 @push(i32 7)
%6 = call i32 @push(i32 8)
%7 = call i32 @push(i32 5)
%8 = call i32 (...) @print()
%9 = call i32 (...) @pop()
%10 = call i32 (...) @print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @push(i32 1)
%2 = tail call i32 @push(i32 2)
%3 = tail call i32 @push(i32 4)
%4 = tail call i32 @push(i32 7)
%5 = tail call i32 @push(i32 8)
%6 = tail call i32 @push(i32 5)
%7 = tail call i32 (...) @print()
%8 = tail call i32 (...) @pop()
%9 = tail call i32 (...) @print()
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t ChipInfo_GetUserId(void) {
  return ((*((volatile unsigned long *)(0x50001000 + 0x00000294))));
}


x86 assembly (clang, -O0):
<ChipInfo_GetUserId>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50001294,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChipInfo_GetUserId>:
mov    0x50001294,%rax
50
ret

LLVM IR (-O0):
define i64 @ChipInfo_GetUserId() {
%1 = load volatile i64, i64* inttoptr (i64 1342182036 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @ChipInfo_GetUserId() {
%1 = load volatile i64, i64* inttoptr (i64 1342182036 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void octave_destroy_glob_info_struct(void *glob_info) { free(glob_info); }


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

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

LLVM IR (-O2):
define void @octave_destroy_glob_info_struct(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void av_thread_message_queue_free() {}


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

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

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

LLVM IR (-O2):
define void @av_thread_message_queue_free() {
ret void
}
int tgetflag(char *bp) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @tgetflag(i8* nocapture readnone %0) {
ret i32 0
}
void init_serial() {}


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

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

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

LLVM IR (-O2):
define void @init_serial() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_free(void *);
void free(void *ptr) { c_free(ptr); }


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

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

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @c_free(i8* %0)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int comp(const void *s1, const void *s2) {
  return (strcmp(*(char **)s1, *(char **)s2));
}


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

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

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void decpff(int flag) {
  if (flag)
    sm("?18");
  else
    rm("?18");
}


x86 assembly (clang, -O0):
<decpff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <decpff+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <decpff+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decpff>:
test   %edi,%edi
je     1130 <decpff+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"?18\00"
define void @decpff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"?18\00"
define void @decpff(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void Handle_SIGINT() {
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<Handle_SIGINT>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Handle_SIGINT>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @Handle_SIGINT() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Handle_SIGINT() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void thing_1(void) {
  char *hello = "Greetings from your computer!";
  char bye_bye[] = "So long now!";
  char *b;
  b = bye_bye;
  puts(hello);
  puts(b);
}


x86 assembly (clang, -O0):
<thing_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xef4(%rip),%rax
mov    %rax,-0x15(%rbp)
mov    0xef2(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xeed(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x15(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x20(%rbp),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thing_1>:
sub    $0x18,%rsp
movabs $0x21776f6e20676e,%rax
mov    %rax,0xd(%rsp)
movabs $0x20676e6f6c206f53,%rax
6e 67 20
mov    %rax,0x8(%rsp)
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Greetings from your computer!\00"
@__const.thing_1.bye_bye = [13 x i8] c"So long now!\00"
define void @thing_1() {
%1 = alloca i8*
%2 = alloca [13 x i8]
%3 = alloca i8*
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = load i8*, i8** %1
%7 = call i32 @puts(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @puts(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Greetings from your computer!\00"
@__const.thing_1.bye_bye = [13 x i8] c"So long now!\00"
define void @thing_1() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* %2)
ret void
}
__attribute__((noipa)) int f3(int x) { return __builtin_clz(x) != 0; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
void yy_strcpy(s1, s2) char *s1;
const char *s2;
{
  while ((*(s1++) = *(s2++)))
    ;
}


x86 assembly (clang, -O0):
<yy_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <yy_strcpy+0x3b>
jmp    110c <yy_strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yy_strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <yy_strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @yy_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
double strtod(const char *str, char **end) {
  return ({
    extern __typeof__(strtod) module_libc_strtod;
    &module_libc_strtod;
  })(str, end);
}


x86 assembly (clang, -O0):
<strtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtod>:
jmp    1030 <module_libc_strtod@plt>

LLVM IR (-O0):
define double @strtod(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca double (i8*, i8**)*
store i8* %0, i8** %3
store i8** %1, i8*** %4
store double (i8*, i8**)* @module_libc_strtod, double (i8*, i8**)** %5
%6 = load double (i8*, i8**)*, double (i8*, i8**)** %5
%7 = load i8*, i8** %3
%8 = load i8**, i8*** %4
%9 = call double %6(i8* %7, i8** %8)
ret double %9
}

LLVM IR (-O2):
define double @strtod(i8* %0, i8** %1) {
%3 = tail call double @module_libc_strtod(i8* %0, i8** %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ imprimeArray(int);
int main() {
  int arr[10] = {4, 5, 8, 65, 333, 21, 65, 7, 54, 2};
  imprimeArray(9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    $0x9,%edi
call   1030 <imprimeArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 4, i32 5, i32 8, i32 65, i32 333, i32 21, i32 65, i32 7, i32 54, i32 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = call i32 @imprimeArray(i32 9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @imprimeArray(i32 9)
ret i32 0
}