xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getStat(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
main(int argc, char *argv[]) {
  if (argv[1] != NULL) {
    printf("Info about: %s\n", argv[1]);
    getStat(argv[1]);
  } else {
    puts("no argument given");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     117b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <getStat@plt>
jmp    1187 <main+0x57>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
test   %rsi,%rsi
je     1154 <main+0x24>
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
mov    0x8(%rbx),%rdi
call   1040 <getStat@plt>
jmp    1160 <main+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Info about: %s\0A\00"
@.str.1 = [18 x i8] c"no argument given\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @getStat(i8* %17)
br label %21
19: ; preds = %2
%20 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Info about: %s\0A\00"
@.str.1 = [18 x i8] c"no argument given\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = load i8*, i8** %3
%9 = tail call i32 @getStat(i8* %8)
br label %12
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
ret i32 0
}
int cmpaddr(void *ap, void *bp) { return ap < bp ? -1 : (ap > bp ? 1 : 0); }


x86 assembly (clang, -O0):
<cmpaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <cmpaddr+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <cmpaddr+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpaddr>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmpaddr(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _strcpy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, const char *argv[]) {
  char s1[20], s2[] = "My Array";
  _strcpy(s1, s2);
  printf("S1= %s\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x39(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x31(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x39(%rbp),%rsi
call   1040 <_strcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movabs $0x796172724120794d,%rax
72 61 79
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <_strcpy@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s2 = [9 x i8] c"My Array\00"
@.str = [8 x i8] c"S1= %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca [9 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [9 x i8]* %7 to i8*
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%11 = call i32 @_strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s2 = [9 x i8] c"My Array\00"
@.str = [8 x i8] c"S1= %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = alloca [9 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%7 = call i32 @_strcpy(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
float M(float x) {
  if ((x > 0.000000001f) || (x < -0.000000001f))
    return x;
  else
    return 0.0f;
}


x86 assembly (clang, -O0):
<M>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1131 <M+0x31>
movss  0xedd(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1140 <M+0x40>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1148 <M+0x48>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<M>:
movss  0xef8(%rip),%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm0,%xmm2
cmpltss 0xeeb(%rip),%xmm2
andps  %xmm0,%xmm2
andps  %xmm1,%xmm0
andnps %xmm2,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @M(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0x3E112E0BE0000000
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load float, float* %3
%8 = fcmp olt float %7, 0xBE112E0BE0000000
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load float, float* %3
store float %10, float* %2
br label %12
11: ; preds = %6
store float 0.000000e+00, float* %2
br label %12
12: ; preds = %11, %9
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @M(float %0) {
%2 = fcmp ogt float %0, 0x3E112E0BE0000000
%3 = fcmp olt float %0, 0xBE112E0BE0000000
%4 = or i1 %2, %3
%5 = select i1 %4, float %0, float 0.000000e+00
ret float %5
}
/* Variables and functions */
int A_UNDERLINE;
int make_cursor(int attr) { return attr ^ A_UNDERLINE; }


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

x86 assembly (clang, -O2):
<make_cursor>:
mov    %edi,%eax
mov    0x2ed7(%rip),%rcx
xor    (%rcx),%eax
ret

LLVM IR (-O0):
@A_UNDERLINE = global i32 0
define i32 @make_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @A_UNDERLINE
%5 = xor i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@A_UNDERLINE = global i32 0
define i32 @make_cursor(i32 %0) {
%2 = load i32, i32* @A_UNDERLINE
%3 = xor i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int qsort_stable(void *, size_t, size_t, int (*)(void const *, void const *),
                 int);
int qsort_s3(void *base, size_t nelem, size_t es,
             int (*compar)(const void *, const void *)) {
  return qsort_stable(base, nelem, es, compar, 3);
}


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

x86 assembly (clang, -O2):
<qsort_s3>:
mov    $0x3,%r8d
jmp    1030 <qsort_stable@plt>

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

LLVM IR (-O2):
define i32 @qsort_s3(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i32 @qsort_stable(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3, i32 3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ table(int);
int main() {
  int numero;
  printf("Digite o número\n");
  scanf("%d", &numero);
  table(numero);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <table@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <table@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [17 x i8] c"Digite o n\C3\BAmero\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @table(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("foo!!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"foo!!!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int DivRounded(int a, int b) {
  if (b < 0)
    return -DivRounded(a, -b);
  return a >= 0 ? (a + b / 2) / b : (a - b / 2) / b;
}


x86 assembly (clang, -O0):
<DivRounded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1143 <DivRounded+0x33>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <DivRounded@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1196 <DivRounded+0x86>
cmpl   $0x0,-0x8(%rbp)
jl     1171 <DivRounded+0x61>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
jmp    1190 <DivRounded+0x80>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DivRounded>:
test   %esi,%esi
js     1127 <DivRounded+0x17>
mov    %esi,%ecx
shr    %ecx
mov    %ecx,%eax
neg    %eax
test   %edi,%edi
cmovns %ecx,%eax
add    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
neg    %esi
call   1030 <DivRounded@plt>
neg    %eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @DivRounded(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 0, %10
%12 = call i32 @DivRounded(i32 %9, i32 %11)
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %33
14: ; preds = %2
%15 = load i32, i32* %4
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = sdiv i32 %19, 2
%21 = add nsw i32 %18, %20
%22 = load i32, i32* %5
%23 = sdiv i32 %21, %22
br label %31
24: ; preds = %14
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = sdiv i32 %26, 2
%28 = sub nsw i32 %25, %27
%29 = load i32, i32* %5
%30 = sdiv i32 %28, %29
br label %31
31: ; preds = %24, %17
%32 = phi i32 [ %23, %17 ], [ %30, %24 ]
store i32 %32, i32* %3
br label %33
33: ; preds = %31, %8
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @DivRounded(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %6, label %10
4: ; preds = %10, %6
%5 = phi i32 [ %9, %6 ], [ %16, %10 ]
ret i32 %5
6: ; preds = %2
%7 = sub nsw i32 0, %1
%8 = tail call i32 @DivRounded(i32 %0, i32 %7)
%9 = sub nsw i32 0, %8
br label %4
10: ; preds = %2
%11 = icmp sgt i32 %0, -1
%12 = lshr i32 %1, 1
%13 = sub nsw i32 0, %12
%14 = select i1 %11, i32 %12, i32 %13
%15 = add i32 %14, %0
%16 = sdiv i32 %15, %1
br label %4
}
int main(argc, argv)
int argc;
char *argv[];
{ 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**
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
}
int ret5(int a0, int a1, int a2, int a3, int a4, int a5) { return a5; }


x86 assembly (clang, -O0):
<ret5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret5>:
mov    %r9d,%eax
ret

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

LLVM IR (-O2):
define i32 @ret5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 returned %5) {
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ local_print_greetings();
int main() {
  while (1) {
    local_print_greetings();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <local_print_greetings@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <local_print_greetings@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @local_print_greetings()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @local_print_greetings()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ KDSETLED;
long get_leds(int);
int ioctl(int, int /*<<< orphan*/, long);
int and_leds(int console, long int state) {
  return ioctl(console, KDSETLED, state & 7 & get_leds(console));
}


x86 assembly (clang, -O0):
<and_leds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_leds@plt>
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
and    %rax,%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_leds>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb0(%rip),%rax
mov    (%rax),%r14d
call   1030 <get_leds@plt>
and    %eax,%ebx
and    $0x7,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
@KDSETLED = global i32 0
define i32 @and_leds(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @KDSETLED
%7 = load i64, i64* %4
%8 = and i64 %7, 7
%9 = load i32, i32* %3
%10 = call i64 @get_leds(i32 %9)
%11 = and i64 %8, %10
%12 = call i32 @ioctl(i32 %5, i32 %6, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
@KDSETLED = global i32 0
define i32 @and_leds(i32 %0, i64 %1) {
%3 = load i32, i32* @KDSETLED
%4 = and i64 %1, 7
%5 = tail call i64 @get_leds(i32 %0)
%6 = and i64 %4, %5
%7 = tail call i32 @ioctl(i32 %0, i32 %3, i64 %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(unsigned char *, int, long, int /*<<< orphan*/ *);
void put_file_data(char *path, unsigned char *data, long size) {
  FILE *fp = fopen(path, "wb+");
  fwrite(data, sizeof(unsigned char), size, fp);
  fclose(fp);
  return;
}


x86 assembly (clang, -O0):
<put_file_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_file_data>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebe(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"wb+\00"
define void @put_file_data(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 1, i64 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"wb+\00"
define void @put_file_data(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 1, i64 %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
void ThreadShutdownLock(void) {}


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

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

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

LLVM IR (-O2):
define void @ThreadShutdownLock() {
ret void
}
unsigned int getBits(int low, int high, unsigned int source) {
  if (low < 0 || high > 31 || low > high) {
    return 0;
  }
  int leftAmount = 31 - high;
  int rightAmount = low + leftAmount;
  unsigned int answer = source << leftAmount;
  answer = answer >> rightAmount;
  return answer;
}


x86 assembly (clang, -O0):
<getBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112d <getBits+0x2d>
cmpl   $0x1f,-0xc(%rbp)
jg     112d <getBits+0x2d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1139 <getBits+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1169 <getBits+0x69>
mov    $0x1f,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBits>:
mov    $0x1f,%ecx
sub    %esi,%ecx
shl    %cl,%edx
add    %edi,%ecx
shr    %cl,%edx
xor    %eax,%eax
cmp    $0x20,%esi
cmovge %eax,%edx
test   %edi,%edi
cmovs  %eax,%edx
cmp    %esi,%edi
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @getBits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %3
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 31
br i1 %15, label %20, label %16
16: ; preds = %13
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16, %13, %3
store i32 0, i32* %4
br label %34
21: ; preds = %16
%22 = load i32, i32* %6
%23 = sub nsw i32 31, %22
store i32 %23, i32* %8
%24 = load i32, i32* %5
%25 = load i32, i32* %8
%26 = add nsw i32 %24, %25
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = shl i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %10
%31 = load i32, i32* %9
%32 = lshr i32 %30, %31
store i32 %32, i32* %10
%33 = load i32, i32* %10
store i32 %33, i32* %4
br label %34
34: ; preds = %21, %20
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @getBits(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 0
%5 = icmp sgt i32 %1, 31
%6 = or i1 %4, %5
%7 = icmp sgt i32 %0, %1
%8 = or i1 %7, %6
%9 = sub nsw i32 31, %1
%10 = add nsw i32 %9, %0
%11 = shl i32 %2, %9
%12 = lshr i32 %11, %10
%13 = select i1 %8, i32 0, i32 %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handle(int sig) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @handle(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
short *svector(long nl, long nh) {
  short *v;
  v = (short *)malloc((size_t)((nh - nl + 1 + 0) * sizeof(short)));
  if (!v)
    nrerror("allocation failure in svector()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<svector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
shl    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <svector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    (%rsi,%rsi,1),%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <svector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
add    %r14,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in svector()\00"
define i16* @svector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = mul i64 %10, 2
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i16*
store i16* %13, i16** %5
%14 = load i16*, i16** %5
%15 = icmp ne i16* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i16*, i16** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i16, i16* %19, i64 %21
%23 = getelementptr inbounds i16, i16* %22, i64 0
ret i16* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in svector()\00"
define i16* @svector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 2
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i16*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i16, i16* %11, i64 %12
ret i16* %13
}
int execle(name, args)
char *name;
char *args;
{
  char **p = &args;
  while (*p++)
    ;
  return execve(name, &args, *p);
}


x86 assembly (clang, -O0):
<execle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,(%rax)
je     1146 <execle+0x36>
jmp    1128 <execle+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <execve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execle>:
push   %rax
mov    %rsi,(%rsp)
lea    0x10(%rsp),%rax
xor    %ecx,%ecx
test   %cl,%cl
je     1130 <execle+0x20>
mov    %rax,%rcx
jmp    113d <execle+0x2d>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x8(%rax),%rcx
cmpq   $0x0,(%rax)
mov    %rcx,%rax
jne    1130 <execle+0x20>
mov    (%rcx),%rdx
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <execve@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execle(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8** %4, i8*** %5
br label %6
6: ; preds = %11, %2
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %5
%9 = load i8*, i8** %7
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = load i8**, i8*** %5
%15 = load i8*, i8** %14
%16 = call i32 (i8*, i8**, i8*, ...) bitcast (i32 (...)* @execve to i32 (i8*, i8**, i8*, ...)*)(i8* %13, i8** %4, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @execle(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = icmp ne i8* %1, null
%5 = getelementptr inbounds i8*, i8** %3, i64 2
br i1 undef, label %11, label %6
6: ; preds = %2, %6
%7 = phi i8** [ %9, %6 ], [ %5, %2 ]
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = icmp eq i8* %8, null
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = phi i8** [ %5, %2 ], [ %9, %6 ]
%13 = load i8*, i8** %12
%14 = call i32 (i8*, i8**, i8*, ...) bitcast (i32 (...)* @execve to i32 (i8*, i8**, i8*, ...)*)(i8* %0, i8** %3, i8* %13)
ret i32 %14
}
int ares_library_initialized(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ares_library_initialized() {
ret i32 0
}
int cb(void *argument, int count, const char *anagram) { return 1; }


x86 assembly (clang, -O0):
<cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cb(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("helloworld\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"helloworld\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ LOCK_UN;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ flock(int /*<<< orphan*/, int /*<<< orphan*/);
void funlockfile(FILE *filehandle) { flock(fileno(filehandle), LOCK_UN); }


x86 assembly (clang, -O0):
<funlockfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
call   1040 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funlockfile>:
push   %rax
call   1030 <fileno@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <flock@plt>

LLVM IR (-O0):
@LOCK_UN = global i32 0
define void @funlockfile(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = load i32, i32* @LOCK_UN
%6 = call i32 @flock(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@LOCK_UN = global i32 0
define void @funlockfile(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = load i32, i32* @LOCK_UN
%4 = tail call i32 @flock(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void atsruntime_mfree_user(void *ptr) {
  free(ptr);
  return;
}


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

LLVM IR (-O0):
define void @atsruntime_mfree_user(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 @atsruntime_mfree_user(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double F_t_u_d(double f_t_k_d, double A_k, double gamma_M) {
  return ((0.6 * f_t_k_d * A_k) / gamma_M);
}


x86 assembly (clang, -O0):
<F_t_u_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_t_u_d>:
mulsd  0xef8(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @F_t_u_d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fmul double 6.000000e-01, %7
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = load double, double* %6
%12 = fdiv double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @F_t_u_d(double %0, double %1, double %2) {
%4 = fmul double %0, 6.000000e-01
%5 = fmul double %4, %1
%6 = fdiv double %5, %2
ret double %6
}
/* Type definitions */
typedef int const int32_t;

/* Variables and functions */
int32_t mul(const int32_t a, const int32_t b) { return a * b; }


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mul(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
double inchesToYards(double inches) { return inches / 36.0; }


x86 assembly (clang, -O0):
<inchesToYards>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @inchesToYards(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.600000e+01
ret double %4
}

LLVM IR (-O2):
define double @inchesToYards(double %0) {
%2 = fdiv double %0, 3.600000e+01
ret double %2
}
unsigned char hash(const char *name) {
  unsigned int hash = 0;
  while (*name) {
    hash = 31 * hash + *name;
    name++;
  }
  return (unsigned char)hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <hash+0x3d>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1127 <hash+0x27>
add    $0x1,%rdi
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret

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

LLVM IR (-O2):
define zeroext i8 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i32 %10 to i8
br label %16
16: ; preds = %14, %1
%17 = phi i8 [ 0, %1 ], [ %15, %14 ]
ret i8 %17
}
void ASN1_TYPE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_TYPE_new() {
ret void
}
int imax(int a, int b) { return (a > b ? a : b); }


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

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

LLVM IR (-O0):
define i32 @imax(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 @imax(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*/ getUserPath(char **);
char *getenv(char *);
int /*<<< orphan*/ strmcat(char **, char *);
void getCacheHome(char **path) {
  char *cacheHome = getenv("XDG_CACHE_HOME");
  if (cacheHome)
    strmcat(path, cacheHome);
  else {
    getUserPath(path);
    strmcat(path, "/.cache");
  }
}


x86 assembly (clang, -O0):
<getCacheHome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1169 <getCacheHome+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strmcat@plt>
jmp    1182 <getCacheHome+0x52>
mov    -0x8(%rbp),%rdi
call   1040 <getUserPath@plt>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <strmcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCacheHome>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1151 <getCacheHome+0x21>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1050 <strmcat@plt>
mov    %rbx,%rdi
call   1040 <getUserPath@plt>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <strmcat@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"XDG_CACHE_HOME\00"
@.str.1 = [8 x i8] c"/.cache\00"
define void @getCacheHome(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %3
%10 = call i32 @strmcat(i8** %8, i8* %9)
br label %16
11: ; preds = %1
%12 = load i8**, i8*** %2
%13 = call i32 @getUserPath(i8** %12)
%14 = load i8**, i8*** %2
%15 = call i32 @strmcat(i8** %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"XDG_CACHE_HOME\00"
@.str.1 = [8 x i8] c"/.cache\00"
define void @getCacheHome(i8** %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @strmcat(i8** %0, i8* %2)
br label %9
6: ; preds = %1
%7 = tail call i32 @getUserPath(i8** %0)
%8 = tail call i32 @strmcat(i8** %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %4
ret void
}
double EucDist(double a, double b) {
  double diff;
  diff = a - b;
  return (diff * diff);
}


x86 assembly (clang, -O0):
<EucDist>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EucDist>:
subsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @EucDist(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @EucDist(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fmul double %3, %3
ret double %4
}
/* Variables and functions */
int tst_iv_entry(int, char **);
int main(int argc, char **argv) { return tst_iv_entry(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tst_iv_entry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <tst_iv_entry@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tst_iv_entry(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Decode_xxxxnnnxssmmmrrr();
int /*<<< orphan*/ DoBinOpAdd(int /*<<< orphan*/);
void DoCodeAddQ(void) { DoBinOpAdd(Decode_xxxxnnnxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeAddQ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Decode_xxxxnnnxssmmmrrr@plt>
mov    %eax,%edi
call   1030 <DoBinOpAdd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeAddQ>:
push   %rax
xor    %eax,%eax
call   1040 <Decode_xxxxnnnxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DoBinOpAdd@plt>

LLVM IR (-O0):
define void @DoCodeAddQ() {
%1 = call i32 (...) @Decode_xxxxnnnxssmmmrrr()
%2 = call i32 @DoBinOpAdd(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeAddQ() {
%1 = tail call i32 (...) @Decode_xxxxnnnxssmmmrrr()
%2 = tail call i32 @DoBinOpAdd(i32 %1)
ret void
}
int test_imm_BDuint16_mem(unsigned short *val) {
  return ((*val) & (-0xBD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BDuint16_mem>:
movzwl (%rdi),%eax
test   $0xff43,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BDuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -189
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_char(char const k1, char const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_char>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_char(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_char(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int foo(int i) {
  if (i) {
    int j = 2;
  } else {
    int j = 3;
  }
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111d <foo+0x1d>
movl   $0x2,-0x8(%rbp)
jmp    1124 <foo+0x24>
movl   $0x3,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
unsigned long ffz(unsigned long x) {
  unsigned long r;
  __asm__("" : "=r"(r) : "r"(x & (~x - 1)));
  return r;
}


x86 assembly (clang, -O0):
<ffz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
sub    $0x1,%rcx
and    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffz>:
mov    $0xfffffffffffffffe,%rax
sub    %rdi,%rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ffz(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = xor i64 %5, -1
%7 = sub i64 %6, 1
%8 = and i64 %4, %7
%9 = call i64 asm "", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @ffz(i64 %0) {
%2 = sub i64 -2, %0
%3 = and i64 %2, %0
%4 = tail call i64 asm "", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %3)
ret i64 %4
}
int cairo_code_draw_casOutputLabel_get_width() { return 46; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casOutputLabel_get_width() {
ret i32 46
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casOutputLabel_get_width() {
ret i32 46
}