xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int rd_grib_rec2(int /*<<< orphan*/ *, long, unsigned char **, unsigned char **,
                 float **, int *, int *, int *);
int rd_grib_rec(FILE *input, long int pos, unsigned char **pds,
                unsigned char **gds, float **data, int *ndata) {
  int scale10, scale2;
  return rd_grib_rec2(input, pos, pds, gds, data, ndata, &scale10, &scale2);
}


x86 assembly (clang, -O0):
<rd_grib_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x34(%rbp),%r10
lea    -0x38(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <rd_grib_rec2@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_grib_rec>:
push   %rax
mov    %rsp,%rax
lea    0x4(%rsp),%r10
push   %rax
push   %r10
call   1030 <rd_grib_rec2@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rd_grib_rec(i32* %0, i64 %1, i8** %2, i8** %3, float** %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i8**
%10 = alloca i8**
%11 = alloca float**
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %7
store i64 %1, i64* %8
store i8** %2, i8*** %9
store i8** %3, i8*** %10
store float** %4, float*** %11
store i32* %5, i32** %12
%15 = load i32*, i32** %7
%16 = load i64, i64* %8
%17 = load i8**, i8*** %9
%18 = load i8**, i8*** %10
%19 = load float**, float*** %11
%20 = load i32*, i32** %12
%21 = call i32 @rd_grib_rec2(i32* %15, i64 %16, i8** %17, i8** %18, float** %19, i32* %20, i32* %13, i32* %14)
ret i32 %21
}

LLVM IR (-O2):
define i32 @rd_grib_rec(i32* %0, i64 %1, i8** %2, i8** %3, float** %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %7 to i8*
%10 = bitcast i32* %8 to i8*
%11 = call i32 @rd_grib_rec2(i32* %0, i64 %1, i8** %2, i8** %3, float** %4, i32* %5, i32* %7, i32* %8)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ debugMain();
int /*<<< orphan*/ deviceReset();
void doTest() {
  deviceReset();
  debugMain();
}


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

x86 assembly (clang, -O2):
<doTest>:
push   %rax
xor    %eax,%eax
call   1030 <deviceReset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <debugMain@plt>

LLVM IR (-O0):
define void @doTest() {
%1 = call i32 (...) @deviceReset()
%2 = call i32 (...) @debugMain()
ret void
}

LLVM IR (-O2):
define void @doTest() {
%1 = tail call i32 (...) @deviceReset()
%2 = tail call i32 (...) @debugMain()
ret void
}
int alloutput_ign_hook() { return -1; }


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

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

LLVM IR (-O0):
define i32 @alloutput_ign_hook() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @alloutput_ign_hook() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void die(const char *message) {
  fprintf(stderr, message);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ctl_biased_fat(void *, unsigned char);
void fctl_biased_fat(void *d, float f) {
  ctl_biased_fat(d, (unsigned char)(f * 127.0));
}


x86 assembly (clang, -O0):
<fctl_biased_fat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
call   1030 <ctl_biased_fat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fctl_biased_fat>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
jmp    1030 <ctl_biased_fat@plt>

LLVM IR (-O0):
define void @fctl_biased_fat(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fmul double %7, 1.270000e+02
%9 = fptoui double %8 to i8
%10 = call i32 @ctl_biased_fat(i8* %5, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @fctl_biased_fat(i8* %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, 1.270000e+02
%5 = fptoui double %4 to i8
%6 = tail call i32 @ctl_biased_fat(i8* %0, i8 zeroext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void clean_up() {
  unlink("dummy0");
  unlink("dummy1");
}


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

x86 assembly (clang, -O2):
<clean_up>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"dummy0\00"
@.str.1 = [7 x i8] c"dummy1\00"
define void @clean_up() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"dummy0\00"
@.str.1 = [7 x i8] c"dummy1\00"
define void @clean_up() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long unsigned int fibonacci(unsigned int n) {
  if (n == 0)
    return 0;
  else if (n == 1 || n == 2)
    return 1;
  else
    return (fibonacci(n - 1) + fibonacci(n - 2));
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1132 <fibonacci+0x22>
movq   $0x0,-0x8(%rbp)
jmp    117b <fibonacci+0x6b>
cmpl   $0x1,-0xc(%rbp)
je     1146 <fibonacci+0x36>
cmpl   $0x2,-0xc(%rbp)
jne    1153 <fibonacci+0x43>
movq   $0x1,-0x8(%rbp)
jmp    117b <fibonacci+0x6b>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1148 <fibonacci+0x38>
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     114a <fibonacci+0x3a>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <fibonacci@plt>
add    %rax,%rbx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fibonacci+0x20>
add    $0x1,%rbx
jmp    114a <fibonacci+0x3a>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @fibonacci(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 2
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ %4, %3 ]
%8 = phi i64 [ %12, %6 ], [ 0, %3 ]
%9 = phi i32 [ %11, %6 ], [ %0, %3 ]
%10 = tail call i64 @fibonacci(i32 %7)
%11 = add i32 %9, -2
%12 = add i64 %10, %8
%13 = add i32 %9, -3
%14 = icmp ult i32 %13, 2
br i1 %14, label %15, label %6
15: ; preds = %6
%16 = add i64 %12, 1
br label %17
17: ; preds = %3, %15, %1
%18 = phi i64 [ 0, %1 ], [ %16, %15 ], [ 1, %3 ]
ret i64 %18
}
/* Variables and functions */
double *calloc(int, int);
int /*<<< orphan*/ error_and_exit();
double *calloc_double_line(int dim1) {
  double *line;
  line = calloc(sizeof(double), dim1);
  if (line == NULL)
    error_and_exit();
  return line;
}


x86 assembly (clang, -O0):
<calloc_double_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x8,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <calloc_double_line+0x2e>
mov    $0x0,%al
call   1040 <error_and_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_double_line>:
push   %rbx
mov    %edi,%esi
mov    $0x8,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <calloc_double_line+0x1c>
xor    %eax,%eax
call   1040 <error_and_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias double* @calloc_double_line(i32 %0) {
%2 = tail call double* @calloc(i32 8, i32 %0)
%3 = icmp eq double* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @error_and_exit()
br label %6
6: ; preds = %4, %1
ret double* %2
}
/* Variables and functions */
int /*<<< orphan*/ Com_Error(int, char *, char const *);
void CL_GameModule_Error(const char *msg) { Com_Error(1, "%s", msg); }


x86 assembly (clang, -O0):
<CL_GameModule_Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xed4(%rip),%rsi
call   1030 <Com_Error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_GameModule_Error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <Com_Error@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @CL_GameModule_Error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Com_Error(i32 1, 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 @CL_GameModule_Error(i8* %0) {
%2 = tail call i32 @Com_Error(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *hello2() { return (char *)"Hello from hello2...\n"; }


x86 assembly (clang, -O0):
<hello2>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello2>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Hello from hello2...\0A\00"
define i8* @hello2() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello from hello2...\0A\00"
define i8* @hello2() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EOF;
int getchar();
char peek();
void skip_line(void) {
  for (;;) {
    int c = getchar();
    if (c == EOF || c == '\n')
      return;
    if (c == '\r') {
      if (peek() == '\n')
        getchar();
      return;
    }
  }
}


x86 assembly (clang, -O0):
<skip_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     114e <skip_line+0x2e>
cmpl   $0xa,-0x4(%rbp)
jne    1153 <skip_line+0x33>
jmp    1181 <skip_line+0x61>
cmpl   $0xd,-0x4(%rbp)
jne    117c <skip_line+0x5c>
mov    $0x0,%al
call   1030 <peek@plt>
movsbl %al,%eax
cmp    $0xa,%eax
jne    1177 <skip_line+0x57>
mov    $0x0,%al
call   1040 <getchar@plt>
jmp    1181 <skip_line+0x61>
jmp    1128 <skip_line+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_line>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1158 <skip_line+0x38>
cmp    (%rbx),%eax
je     1158 <skip_line+0x38>
cmp    $0xd,%eax
jne    1130 <skip_line+0x10>
xor    %eax,%eax
call   1030 <peek@plt>
cmp    $0xa,%al
jne    1158 <skip_line+0x38>
xor    %eax,%eax
pop    %rbx
jmp    1040 <getchar@plt>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_line() {
%1 = alloca i32
br label %2
2: ; preds = %21, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %22
11: ; preds = %7
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 13
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = call signext i8 (...) @peek()
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 (...) @getchar()
br label %20
20: ; preds = %18, %14
br label %22
21: ; preds = %11
br label %2
22: ; preds = %20, %10
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_line() {
br label %1
1: ; preds = %7, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
%5 = icmp eq i32 %2, 10
%6 = or i1 %5, %4
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = icmp eq i32 %2, 13
br i1 %8, label %9, label %1
9: ; preds = %7
%10 = tail call signext i8 (...) @peek()
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 (...) @getchar()
br label %14
14: ; preds = %1, %12, %9
ret void
}
/* Variables and functions */
const char *IN_NULL_JoyGetName(int joystick) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @IN_NULL_JoyGetName(i32 %0) {
ret i8* null
}
void f() { asm("movaps %xmm3, (%esi, 2)"); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm3,(%esi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm3,(%esi)
ret

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

LLVM IR (-O2):
define void @f() {
tail call void asm sideeffect "movaps %xmm3, (%esi, 2)", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inplace3(int *, int *);
void qsort_inplace3(int *values, int n) { inplace3(values, values + n - 1); }


x86 assembly (clang, -O0):
<qsort_inplace3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
call   1030 <inplace3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_inplace3>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rsi
add    $0xfffffffffffffffc,%rsi
jmp    1030 <inplace3@plt>

LLVM IR (-O0):
define void @qsort_inplace3(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** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
%11 = call i32 @inplace3(i32* %5, i32* %10)
ret void
}

LLVM IR (-O2):
define void @qsort_inplace3(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = tail call i32 @inplace3(i32* %0, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cglit(int);
int /*<<< orphan*/ gentext();
int /*<<< orphan*/ load();
int /*<<< orphan*/ spill();
void genlit(int v) {
  gentext();
  spill();
  cglit(v);
  load();
}


x86 assembly (clang, -O0):
<genlit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gentext@plt>
mov    $0x0,%al
call   1030 <spill@plt>
mov    -0x4(%rbp),%edi
call   1050 <cglit@plt>
mov    $0x0,%al
call   1060 <load@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genlit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
call   1030 <spill@plt>
mov    %ebx,%edi
call   1050 <cglit@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <load@plt>

LLVM IR (-O0):
define void @genlit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gentext()
%4 = call i32 (...) @spill()
%5 = load i32, i32* %2
%6 = call i32 @cglit(i32 %5)
%7 = call i32 (...) @load()
ret void
}

LLVM IR (-O2):
define void @genlit(i32 %0) {
%2 = tail call i32 (...) @gentext()
%3 = tail call i32 (...) @spill()
%4 = tail call i32 @cglit(i32 %0)
%5 = tail call i32 (...) @load()
ret void
}
void BN_MONT_CTX_copy(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_MONT_CTX_copy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm const *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *get_current_datetime(void) {
  static char buf[50];
  time_t t = time(NULL);
  const struct tm *loctime = (const struct tm *)localtime(&t);
  strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", loctime);
  return buf;
}


x86 assembly (clang, -O0):
<get_current_datetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2ef4(%rip),%rdi
mov    $0x32,%esi
lea    0xe98(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2edc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_datetime>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x32,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@get_current_datetime.buf = internal global [50 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @get_current_datetime() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i64 @localtime(i32* %1)
%5 = inttoptr i64 %4 to %struct.tm*
store %struct.tm* %5, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = call i32 @strftime(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @get_current_datetime.buf, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @get_current_datetime.buf, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@get_current_datetime.buf = internal global [50 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @get_current_datetime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i64 @localtime(i32* %1)
%5 = inttoptr i64 %4 to %struct.tm*
%6 = call i32 @strftime(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @get_current_datetime.buf, i64 0, i64 0), i32 50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @get_current_datetime.buf, i64 0, i64 0)
}
/* Type definitions */
struct shash_node {
  int dummy;
};
struct shash {
  int dummy;
};

/* Variables and functions */
struct shash_node *shash_add_nocopy(struct shash *, int /*<<< orphan*/,
                                    void const *);
int /*<<< orphan*/ xstrdup(char const *);
struct shash_node *shash_add(struct shash *sh, const char *name,
                             const void *data) {
  return shash_add_nocopy(sh, xstrdup(name), data);
}


x86 assembly (clang, -O0):
<shash_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <xstrdup@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1040 <shash_add_nocopy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shash_add>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <xstrdup@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <shash_add_nocopy@plt>

LLVM IR (-O0):
%struct.shash_node = type { i32 }
%struct.shash = type { i32 }
define %struct.shash_node* @shash_add(%struct.shash* %0, i8* %1, i8* %2) {
%4 = alloca %struct.shash*
%5 = alloca i8*
%6 = alloca i8*
store %struct.shash* %0, %struct.shash** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.shash*, %struct.shash** %4
%8 = load i8*, i8** %5
%9 = call i32 @xstrdup(i8* %8)
%10 = load i8*, i8** %6
%11 = call %struct.shash_node* @shash_add_nocopy(%struct.shash* %7, i32 %9, i8* %10)
ret %struct.shash_node* %11
}

LLVM IR (-O2):
%struct.shash_node = type { i32 }
%struct.shash = type { i32 }
define %struct.shash_node* @shash_add(%struct.shash* %0, i8* %1, i8* %2) {
%4 = tail call i32 @xstrdup(i8* %1)
%5 = tail call %struct.shash_node* @shash_add_nocopy(%struct.shash* %0, i32 %4, i8* %2)
ret %struct.shash_node* %5
}
/* Variables and functions */
char *getInputFromUserWhatEver();
int /*<<< orphan*/ letThemPeace(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char *str = getInputFromUserWhatEver();
  printf("All data : %s", str);
  letThemPeace((char *)str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getInputFromUserWhatEver@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <letThemPeace@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getInputFromUserWhatEver@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <letThemPeace@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"All data : %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* (...) @getInputFromUserWhatEver()
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @letThemPeace(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"All data : %s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @getInputFromUserWhatEver()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @letThemPeace(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bubbleSort(int *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int numbers[10000], i;
  srand(time(NULL));
  for (i = 0; i < 10000; i++)
    numbers[i] = rand();
  bubbleSort(numbers, 10000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x9c54(%rbp)
cmpl   $0x2710,-0x9c54(%rbp)
jge    11a7 <main+0x67>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%ecx
movslq -0x9c54(%rbp),%rax
mov    %ecx,-0x9c50(%rbp,%rax,4)
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    116c <main+0x2c>
lea    -0x9c50(%rbp),%rdi
mov    $0x2710,%esi
call   1030 <bubbleSort@plt>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x9c40,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x2710,%rbx
jne    1160 <main+0x20>
mov    %rsp,%rdi
mov    $0x2710,%esi
call   1030 <bubbleSort@plt>
xor    %eax,%eax
add    $0x9c40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10000 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10000
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 %12
store i32 %10, i32* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%19 = call i32 @bubbleSort(i32* %18, i32 10000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10000 x i32]
%2 = bitcast [10000 x i32]* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %9, %5 ]
%7 = tail call i32 (...) @rand()
%8 = getelementptr inbounds [10000 x i32], [10000 x i32]* %1, i64 0, i64 %6
store i32 %7, i32* %8
%9 = add nuw nsw i64 %6, 1
%10 = icmp eq i64 %9, 10000
br i1 %10, label %11, label %5
11: ; preds = %5
%12 = getelementptr inbounds [10000 x i32], [10000 x i32]* %1, i64 0, i64 0
%13 = call i32 @bubbleSort(i32* %12, i32 10000)
ret i32 0
}
int main(int argc, char **argv) {
  int fd;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void triggerGenBufferOut(struct LSD_SceneNodeOutput const *output) {}


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

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

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

LLVM IR (-O2):
%struct.LSD_SceneNodeOutput = type opaque
define void @triggerGenBufferOut(%struct.LSD_SceneNodeOutput* nocapture %0) {
ret void
}
void XEventMaskOfScreen() {}


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

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

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

LLVM IR (-O2):
define void @XEventMaskOfScreen() {
ret void
}
/* Variables and functions */
int rom_present(char *);
int s3_phoenix_86c805_available(void) {
  return rom_present(L"roms/video/s3/805.vbi");
}


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

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

LLVM IR (-O0):
@.str = [22 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 56, i32 48, i32 53, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @s3_phoenix_86c805_available() {
%1 = call i32 @rom_present(i8* bitcast ([22 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [22 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 56, i32 48, i32 53, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @s3_phoenix_86c805_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([22 x i32]* @.str to i8*))
ret i32 %1
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int __iswxdigit_ascii(wint_t c) {
  return (unsigned int)(c - '0') < 10u || (unsigned int)((c | 0x20) - 'a') < 6u;
}


x86 assembly (clang, -O0):
<__iswxdigit_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
jb     112d <__iswxdigit_ascii+0x2d>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x6,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswxdigit_ascii>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
or     $0x20,%edi
add    $0xffffff9f,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__iswxdigit_ascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 48
%5 = icmp ult i32 %4, 10
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, 32
%9 = sub nsw i32 %8, 97
%10 = icmp ult i32 %9, 6
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @__iswxdigit_ascii(i32 %0) {
%2 = add nsw i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = or i32 %0, 32
%5 = add nsw i32 %4, -97
%6 = icmp ult i32 %5, 6
%7 = select i1 %3, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int max_v(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max_v>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max_v+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max_v+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_v>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max_v(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
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max_v(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void hello_message(const char *name) { printf("Hello %s\n", name); }


x86 assembly (clang, -O0):
<hello_message>:
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):
<hello_message>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @hello_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int funcc(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @funcc() {
ret i32 0
}
copy(a, b) char *a, *b;
{
  char *c;
  b--;
  c = --a;
  while (*++b = *++a)
    ;
  return (a - c);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    0x1(%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,0x1(%rcx)
cmp    $0x0,%al
je     1159 <copy+0x59>
jmp    1128 <copy+0x28>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @copy(i8* %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
%4 = getelementptr inbounds i8, i8* %0, i64 -1
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %3, %2 ], [ %10, %5 ]
%7 = phi i8* [ %4, %2 ], [ %8, %5 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %10
%11 = icmp eq i8 %9, 0
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = ptrtoint i8* %8 to i64
%14 = ptrtoint i8* %4 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}
void PCA9685SetOnTime(ch, onRegL, onRegH) {
  int reg = 0x06 + 4 * ch;
  i2cWrite(reg, onRegL);
  i2cWrite(reg + 1, onRegH);
}


x86 assembly (clang, -O0):
<PCA9685SetOnTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <i2cWrite@plt>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <i2cWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PCA9685SetOnTime>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %edi,%ebx
lea    0x6(,%rbx,4),%edi
xor    %eax,%eax
call   1030 <i2cWrite@plt>
lea    0x7(,%rbx,4),%edi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <i2cWrite@plt>

LLVM IR (-O0):
define void @PCA9685SetOnTime(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = mul nsw i32 4, %8
%10 = add nsw i32 6, %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @i2cWrite to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %6
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @i2cWrite to i32 (i32, i32, ...)*)(i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @PCA9685SetOnTime(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %0, 2
%5 = add nsw i32 %4, 6
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @i2cWrite to i32 (i32, i32, ...)*)(i32 %5, i32 %1)
%7 = add nsw i32 %4, 7
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @i2cWrite to i32 (i32, i32, ...)*)(i32 %7, i32 %2)
ret void
}
/* Variables and functions */
size_t _nextpow2(int x) {
  --x;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return ++x;
}


x86 assembly (clang, -O0):
<_nextpow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nextpow2>:
add    $0xffffffff,%edi
mov    %edi,%eax
sar    %eax
or     %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
or     %ecx,%eax
add    $0x1,%eax
cltq
ret

LLVM IR (-O0):
define i64 @_nextpow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = sext i32 %26 to i64
ret i64 %27
}

LLVM IR (-O2):
define i64 @_nextpow2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int PECIDomainValid(unsigned long);
unsigned long PECIDomainValueGet(unsigned long ulBase, unsigned long ulDomain) {
  DEBUG_ASSERT(ulBase == 0x400B0000);
  DEBUG_ASSERT(PECIDomainValid(ulDomain));
  return (
      (((*((volatile unsigned long *)(ulBase + 0x00000040 + (ulDomain * 4)))) &
        0x0000FFFF)));
}


x86 assembly (clang, -O0):
<PECIDomainValueGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rax
and    $0xffff,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainValueGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400b0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    0x40(%rbx,%r14,4),%rax
movzwl %ax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @PECIDomainValueGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074462720
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @PECIDomainValid(i64 %9)
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %3
%13 = add i64 %12, 64
%14 = load i64, i64* %4
%15 = mul i64 %14, 4
%16 = add i64 %13, %15
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = and i64 %18, 65535
ret i64 %19
}

LLVM IR (-O2):
define i64 @PECIDomainValueGet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074462720
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @PECIDomainValid(i64 %1)
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = add i64 %0, 64
%9 = shl i64 %1, 2
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 65535
ret i64 %13
}
int pci_ats_page_aligned(struct pci_dev *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_ats_page_aligned(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
void g_date_set_parse() {}


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

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

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

LLVM IR (-O2):
define void @g_date_set_parse() {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare_string(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


x86 assembly (clang, -O0):
<compare_string>:
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):
<compare_string>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_string(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 @compare_string(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 cdrom_reinit();
int init_drive() { return cdrom_reinit(); }


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

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

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

LLVM IR (-O2):
define i32 @init_drive() {
%1 = tail call i32 (...) @cdrom_reinit()
ret i32 %1
}
__attribute__((always_)) void trace_mm_page_pcpu_drain(struct page *page,
                                                       unsigned int order,
                                                       int migratetype) {}


x86 assembly (clang, -O0):
<trace_mm_page_pcpu_drain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.page = type opaque
define void @trace_mm_page_pcpu_drain(%struct.page* %0, i32 %1, i32 %2) {
%4 = alloca %struct.page*
%5 = alloca i32
%6 = alloca i32
store %struct.page* %0, %struct.page** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @trace_mm_page_pcpu_drain(%struct.page* nocapture %0, i32 %1, i32 %2) {
ret void
}