xunge/DecIR huggingface dataset:
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ isspace(char);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int len, i;
  char *s = "Campos verdes";
  while (!isspace(s[0])) {
    s = corta_string(s);
  }
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116b <main+0x3b>
jmp    117d <main+0x4d>
mov    -0x18(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x18(%rbp)
jmp    114a <main+0x1a>
mov    -0x18(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x43,%edi
call   1050 <isspace@plt>
lea    0xebe(%rip),%rbx
test   %eax,%eax
jne    1167 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <corta_string@plt>
mov    %rax,%rbx
movsbl (%rax),%edi
call   1050 <isspace@plt>
test   %eax,%eax
je     1150 <main+0x20>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %4
br label %5
5: ; preds = %12, %0
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = call i32 @isspace(i8 signext %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i8*, i8** %4
%14 = call i8* @corta_string(i8* %13)
store i8* %14, i8** %4
br label %5
15: ; preds = %5
%16 = load i8*, i8** %4
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @isspace(i8 signext 67)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i8* [ %5, %3 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %0 ]
%5 = tail call i8* @corta_string(i8* %4)
%6 = load i8, i8* %5
%7 = tail call i32 @isspace(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3, %0
%10 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %0 ], [ %5, %3 ]
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/);
int shim_munlockall(void) { return (int)shim_enosys(0); }


x86 assembly (clang, -O0):
<shim_munlockall>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <shim_enosys@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_munlockall>:
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_munlockall() {
%1 = call i64 @shim_enosys(i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @shim_munlockall() {
%1 = tail call i64 @shim_enosys(i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_handler(int sig) { exit(EXIT_SUCCESS); }


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

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int checkTheChar(char theChar) {
  printf("%c", theChar);
  switch (theChar) {
  case 'd':
    return 0;
    break;
  case 'c':
    return 0;
    break;
  default:
    return 1;
    break;
  }
}


x86 assembly (clang, -O0):
<checkTheChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x63,%eax
je     1160 <checkTheChar+0x50>
jmp    1143 <checkTheChar+0x33>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
jne    116c <checkTheChar+0x5c>
jmp    1154 <checkTheChar+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1173 <checkTheChar+0x63>
movl   $0x0,-0x4(%rbp)
jmp    1173 <checkTheChar+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkTheChar>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x65(%rbx),%ecx
xor    %eax,%eax
cmp    $0xfe,%cl
setb   %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @checkTheChar(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = add i8 %0, -101
%4 = icmp ult i8 %3, -2
%5 = zext i1 %4 to i32
ret i32 %5
}
void free_char_tab(char **tab, int x) {
  int i;
  for (i = 0; i < 0; i++) {
    free(tab[i]);
  }
  free(tab);
}


x86 assembly (clang, -O0):
<free_char_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114f <free_char_tab+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_char_tab+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_char_tab(i8** nocapture %0, i32 %1) {
%3 = bitcast i8** %0 to i8*
tail call void @free(i8* %3)
ret void
}
int execute_vmsplice() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_vmsplice() {
ret i32 0
}
void gtk_table_attach() {}


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

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

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

LLVM IR (-O2):
define void @gtk_table_attach() {
ret void
}
int naturalSquare(int n, int *result) {
  int buffer = n;
  *result = 0;
  while (buffer != 0) {
    *result = *result + (buffer * buffer);
    buffer--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<naturalSquare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
cmpl   $0x0,-0x14(%rbp)
je     1148 <naturalSquare+0x48>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
add    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <naturalSquare+0x1b>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalSquare>:
test   %edi,%edi
je     1147 <naturalSquare+0x47>
mov    %edi,%eax
imul   %edi,%eax
lea    -0x1(%rdi),%r8d
lea    -0x2(%rdi),%edx
mov    %edx,%ecx
imul   %edi,%ecx
add    $0x1,%ecx
imul   %r8d,%ecx
add    %eax,%ecx
mov    $0x3,%eax
sub    %edi,%eax
sub    %edi,%eax
imul   %r8,%rdx
add    $0xfffffffd,%edi
imul   %rdx,%rdi
shr    %rdx
imul   %eax,%edx
add    %ecx,%edx
shr    %rdi
imul   $0x55555556,%edi,%eax
add    %edx,%eax
jmp    1149 <naturalSquare+0x49>
xor    %eax,%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @naturalSquare(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %28, label %4
4: ; preds = %2
%5 = mul i32 %0, %0
%6 = add i32 %0, -1
%7 = add i32 %0, -2
%8 = mul i32 %7, %0
%9 = add i32 %8, 1
%10 = mul i32 %6, %9
%11 = mul i32 %0, -2
%12 = add i32 %11, 3
%13 = zext i32 %6 to i33
%14 = zext i32 %7 to i33
%15 = mul i33 %13, %14
%16 = lshr i33 %15, 1
%17 = trunc i33 %16 to i32
%18 = mul i32 %12, %17
%19 = add i32 %0, -3
%20 = zext i32 %19 to i33
%21 = mul i33 %15, %20
%22 = lshr i33 %21, 1
%23 = trunc i33 %22 to i32
%24 = mul i32 %23, 1431655766
%25 = add i32 %5, %10
%26 = add i32 %25, %18
%27 = add i32 %26, %24
br label %28
28: ; preds = %4, %2
%29 = phi i32 [ %27, %4 ], [ 0, %2 ]
store i32 %29, i32* %1
ret i32 0
}
int test01(int a, int b, int c, int d) {
  int x = a == b;
  int y = c == d;
  return x == y;
}


x86 assembly (clang, -O0):
<test01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test01>:
cmp    %esi,%edi
setne  %al
cmp    %ecx,%edx
sete   %cl
xor    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test01(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = icmp eq i32 %15, %16
%18 = zext i1 %17 to i32
store i32 %18, i32* %10
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @test01(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = icmp eq i32 %2, %3
%7 = xor i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int fun551() { return 551; }


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

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

LLVM IR (-O0):
define i32 @fun551() {
ret i32 551
}

LLVM IR (-O2):
define i32 @fun551() {
ret i32 551
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void e4c_stack_trace_finalize(void *custom_data) { free(custom_data); }


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

LLVM IR (-O0):
define void @e4c_stack_trace_finalize(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 @e4c_stack_trace_finalize(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link(char *, char *);
int main(void) { link("foo", "bar"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"bar\00"
define i32 @main() {
%1 = call i32 @link(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"bar\00"
define i32 @main() {
%1 = tail call i32 @link(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_19int64_lowword_mem(long long *val) {
  return ((*val) & (0x19 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_19int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 25
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int _get_msr(int, int /*<<< orphan*/, unsigned long long *, int /*<<< orphan*/);
int get_msr_nowarn(int cpu, off_t offset, unsigned long long *msr) {
  return _get_msr(cpu, offset, msr, 0);
}


x86 assembly (clang, -O0):
<get_msr_nowarn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <_get_msr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msr_nowarn>:
xor    %ecx,%ecx
jmp    1030 <_get_msr@plt>

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

LLVM IR (-O2):
define i32 @get_msr_nowarn(i32 %0, i32 %1, i64* %2) {
%4 = tail call i32 @_get_msr(i32 %0, i32 %1, i64* %2, i32 0)
ret i32 %4
}
/* Variables and functions */
char *nvram_get(const char *name) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @nvram_get(i8* nocapture readnone %0) {
ret i8* null
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return (c - ('a' - 'A'));
  return (c);
}


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

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

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(void *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void my_print(void *key, void *data) { fputs(data, stdout); }


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

x86 assembly (clang, -O2):
<my_print>:
mov    %rsi,%rdi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @my_print(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @my_print(i8* nocapture readnone %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hola mundo!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hola mundo!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hola mundo!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int Quit(int argc, char **argv) { exit(0); }


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

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

LLVM IR (-O0):
define i32 @Quit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @Quit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
int SortComp(const void *x, const void *y) {
  const double *xx = (const double *)x;
  const double *yy = (const double *)y;
  if (*xx > *yy)
    return 1;
  else {
    if (*xx == *yy)
      return 0;
    else
      return -1;
  }
}


x86 assembly (clang, -O0):
<SortComp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    113e <SortComp+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    116d <SortComp+0x6d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1166 <SortComp+0x66>
jp     1166 <SortComp+0x66>
movl   $0x0,-0x4(%rbp)
jmp    116d <SortComp+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SortComp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm1,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @SortComp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp ogt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp oeq double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %26
25: ; preds = %18
store i32 -1, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @SortComp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = fcmp une double %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void foo743() {}


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

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

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

LLVM IR (-O2):
define void @foo743() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void test4() {
  int a = 5;
  while (a > 1)
    a -= 2;
  if (a > 1) {
    a = a + 56;
  }
  foo(a);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1137 <test4+0x27>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test4+0xf>
cmpl   $0x1,-0x4(%rbp)
jle    114a <test4+0x3a>
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test4() {
%1 = alloca i32
store i32 5, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sub nsw i32 %6, 2
store i32 %7, i32* %1
br label %2
8: ; preds = %2
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 56
store i32 %13, i32* %1
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %1
%16 = call i32 @foo(i32 %15)
ret void
}

LLVM IR (-O2):
define void @test4() {
%1 = tail call i32 @foo(i32 1)
ret void
}
unsigned xrop3_89_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_89_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_89_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %ecx,%edx
not    %ecx
or     %eax,%ecx
not    %eax
or     %eax,%edx
xor    $0xff,%edx
and    %edx,%ecx
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_89_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_89_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = or i32 %6, %7
%9 = xor i32 %8, 255
%10 = xor i32 %6, -1
%11 = or i32 %4, %10
%12 = and i32 %9, %11
%13 = and i32 %7, %5
%14 = or i32 %12, %13
ret i32 %14
}
void no_references_doHeavyWork(void) {}


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

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

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

LLVM IR (-O2):
define void @no_references_doHeavyWork() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void putStr(char *str) { printf("%s", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @putStr(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
const char *SkipUntilTab(const char *pSrc) {
  while (pSrc && (*pSrc)) {
    if (*pSrc == '\t') {
      break;
    }
    pSrc++;
  }
  return pSrc;
}


x86 assembly (clang, -O0):
<SkipUntilTab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <SkipUntilTab+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1138 <SkipUntilTab+0x38>
jmp    115e <SkipUntilTab+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    114d <SkipUntilTab+0x4d>
jmp    115e <SkipUntilTab+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <SkipUntilTab+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipUntilTab>:
test   %rdi,%rdi
je     1122 <SkipUntilTab+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
test   %cl,%cl
je     1124 <SkipUntilTab+0x24>
cmp    $0x9,%cl
je     1124 <SkipUntilTab+0x24>
add    $0x1,%rax
jmp    1110 <SkipUntilTab+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @SkipUntilTab(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 9, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ], [ %4, %3 ]
ret i8* %9
}
int main(void) {
  char ch;
  ch = '\b';
  ch = '\f';
  ch = '\r';
  ch = '\"';
  ch = '\'';
  ch = '\0';
  ch = '\\';
  ch = '\?';
  ch = '\a';
  ch = '\144';
  ch = '\x64';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x8,-0x5(%rbp)
movb   $0xc,-0x5(%rbp)
movb   $0xd,-0x5(%rbp)
movb   $0x22,-0x5(%rbp)
movb   $0x27,-0x5(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0x5c,-0x5(%rbp)
movb   $0x3f,-0x5(%rbp)
movb   $0x7,-0x5(%rbp)
movb   $0x64,-0x5(%rbp)
movb   $0x64,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 8, i8* %2
store i8 12, i8* %2
store i8 13, i8* %2
store i8 34, i8* %2
store i8 39, i8* %2
store i8 0, i8* %2
store i8 92, i8* %2
store i8 63, i8* %2
store i8 7, i8* %2
store i8 100, i8* %2
store i8 100, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void console_set_queues(struct os_eventq *avail_queue,
                        struct os_eventq *cmd_queue) {}


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

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

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

LLVM IR (-O2):
%struct.os_eventq = type opaque
define void @console_set_queues(%struct.os_eventq* nocapture %0, %struct.os_eventq* nocapture %1) {
ret void
}
void copyToStringOutParameter(const char *source, unsigned int length,
                              char **target, unsigned int *targetLength) {
  *target = (char *)malloc(sizeof(char) * (length + 1));
  memcpy(*target, source, length);
  (*target)[length] = 0;
  if (targetLength != 0x0) {
    *targetLength = length;
  }
}


x86 assembly (clang, -O0):
<copyToStringOutParameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
cmpq   $0x0,-0x20(%rbp)
je     118b <copyToStringOutParameter+0x6b>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyToStringOutParameter>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%r13d
mov    %rdi,%r12
lea    0x1(%r13),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,(%r15)
mov    %r13d,%r15d
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
test   %r14,%r14
je     1162 <copyToStringOutParameter+0x42>
mov    %r13d,(%r14)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @copyToStringOutParameter(i8* nocapture %0, i32 %1, i8** nocapture writeonly %2, i32* writeonly %3) {
%5 = add i32 %1, 1
%6 = zext i32 %5 to i64
%7 = tail call i8* @malloc(i64 %6)
store i8* %7, i8** %2
%8 = zext i32 %1 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %7, i8* align 1 %0, i64 %8, i1 false)
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8 0, i8* %9
%10 = icmp eq i32* %3, null
br i1 %10, label %12, label %11
11: ; preds = %4
store i32 %1, i32* %3
br label %12
12: ; preds = %11, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_SIGNATURE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_SIGNATURE_it;
OCSP_SIGNATURE *d2i_OCSP_SIGNATURE(OCSP_SIGNATURE **a, const unsigned char **in,
                                   long len) {
  return (OCSP_SIGNATURE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                         &OCSP_SIGNATURE_it);
}


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

x86 assembly (clang, -O2):
<d2i_OCSP_SIGNATURE>:
mov    0x2ec1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@OCSP_SIGNATURE_it = global i32 0
define i32* @d2i_OCSP_SIGNATURE(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @OCSP_SIGNATURE_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@OCSP_SIGNATURE_it = global i32 0
define i32* @d2i_OCSP_SIGNATURE(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @OCSP_SIGNATURE_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalpha(int ch) { return isupper(ch) || islower(ch); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @islower(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ print_0(char *);
int /*<<< orphan*/ println_2(int /*<<< orphan*/);
void log_0(char *msg_0, int32_t x_6) {
  print_0(msg_0);
  print_0(": ");
  println_2(x_6);
}


x86 assembly (clang, -O0):
<log_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <print_0@plt>
lea    0xec1(%rip),%rdi
call   1030 <print_0@plt>
mov    -0xc(%rbp),%edi
call   1040 <println_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_0>:
push   %rbx
mov    %esi,%ebx
call   1030 <print_0@plt>
lea    0xed1(%rip),%rdi
call   1030 <print_0@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <println_2@plt>

LLVM IR (-O0):
@.str = [3 x i8] c": \00"
define void @log_0(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @print_0(i8* %5)
%7 = call i32 @print_0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @println_2(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
define void @log_0(i8* %0, i32 %1) {
%3 = tail call i32 @print_0(i8* %0)
%4 = tail call i32 @print_0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @println_2(i32 %1)
ret void
}
/* Variables and functions */
float *extend_vector(float *, int, int);
float *retract_vector(float *v, int old_nl, int new_nh) {
  return extend_vector(v, old_nl, new_nh);
}


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

x86 assembly (clang, -O2):
<retract_vector>:
jmp    1030 <extend_vector@plt>

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

LLVM IR (-O2):
define float* @retract_vector(float* %0, i32 %1, i32 %2) {
%4 = tail call float* @extend_vector(float* %0, i32 %1, i32 %2)
ret float* %4
}
void seg_debug(char *str) {}


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

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

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

LLVM IR (-O2):
define void @seg_debug(i8* nocapture %0) {
ret void
}
int pft_file_permission(struct file *file, int mask) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @pft_file_permission(%struct.file* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ idc(int *);
int test03(int *p, int *x) {
  idc(p);
  if (p)
    ;
  return *p;
}


x86 assembly (clang, -O0):
<test03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <idc@plt>
cmpq   $0x0,-0x8(%rbp)
je     1139 <test03+0x29>
jmp    1139 <test03+0x29>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test03>:
push   %rbx
mov    %rdi,%rbx
call   1030 <idc@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test03(i32* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @idc(i32* %0)
%4 = load i32, i32* %0
ret i32 %4
}
int __attribute__((no)) ngt(int a, int b) { return -(a > b); }


x86 assembly (clang, -O0):
<ngt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngt>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @ngt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX0(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op9DM0X0(void) { STA16(AbsoluteIndexedXX0(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op9DM0X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9DM0X0>:
push   %rax
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op9DM0X0() {
%1 = call i32 @AbsoluteIndexedXX0(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op9DM0X0() {
%1 = tail call i32 @AbsoluteIndexedXX0(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}
void foo763() {}


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

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

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

LLVM IR (-O2):
define void @foo763() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void defaultErrorFunction(long error, const char *str) {
  fprintf(stderr, "Audio File Library: ");
  fprintf(stderr, "%s", str);
  fprintf(stderr, " [error %ld]\n", error);
}


x86 assembly (clang, -O0):
<defaultErrorFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaultErrorFunction>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ebe(%rip),%r15
mov    (%r15),%edi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xec7(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Audio File Library: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [14 x i8] c" [error %ld]\0A\00"
define void @defaultErrorFunction(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = load i64, i64* %3
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Audio File Library: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [14 x i8] c" [error %ld]\0A\00"
define void @defaultErrorFunction(i64 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 %0)
ret void
}