xunge/DecIR huggingface dataset:
int match(long long x, long long y, int ari) {
  long long mod = x % y;
  return (mod && x - y == mod) ? match(y, mod, !ari) : ari;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1171 <match+0x61>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1171 <match+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
call   1030 <match@plt>
mov    %eax,-0x24(%rbp)
jmp    1177 <match+0x67>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    %edx,%ecx
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111d <match+0x1d>
mov    %rdi,%rax
cqto
idiv   %rsi
test   %rdx,%rdx
jne    1128 <match+0x28>
jmp    1179 <match+0x79>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
je     1179 <match+0x79>
sub    %rsi,%rdi
cmp    %rdx,%rdi
jne    1179 <match+0x79>
mov    %ecx,%eax
mov    %rdx,%rdi
xor    %ecx,%ecx
test   %eax,%eax
sete   %r8b
mov    %rsi,%rax
or     %rdx,%rax
shr    $0x20,%rax
je     1160 <match+0x60>
mov    %rsi,%rax
cqto
idiv   %rdi
jmp    1166 <match+0x66>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %esi,%eax
xor    %edx,%edx
div    %edi
mov    %r8b,%cl
test   %rdx,%rdx
je     1179 <match+0x79>
sub    %rdi,%rsi
cmp    %rdx,%rsi
mov    %rdi,%rsi
je     1130 <match+0x30>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @match(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = srem i64 %8, %9
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %3
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = sub nsw i64 %14, %15
%17 = load i64, i64* %7
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %27
19: ; preds = %13
%20 = load i64, i64* %5
%21 = load i64, i64* %7
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
%26 = call i32 @match(i64 %20, i64 %21, i32 %25)
br label %29
27: ; preds = %13, %3
%28 = load i32, i32* %6
br label %29
29: ; preds = %27, %19
%30 = phi i32 [ %26, %19 ], [ %28, %27 ]
ret i32 %30
}

LLVM IR (-O2):
define i32 @match(i64 %0, i64 %1, i32 %2) {
%4 = srem i64 %0, %1
%5 = icmp ne i64 %4, 0
%6 = sub nsw i64 %0, %1
%7 = icmp eq i64 %6, %4
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %20
9: ; preds = %3, %9
%10 = phi i64 [ %15, %9 ], [ %4, %3 ]
%11 = phi i32 [ %14, %9 ], [ %2, %3 ]
%12 = phi i64 [ %10, %9 ], [ %1, %3 ]
%13 = icmp eq i32 %11, 0
%14 = zext i1 %13 to i32
%15 = srem i64 %12, %10
%16 = icmp ne i64 %15, 0
%17 = sub nsw i64 %12, %10
%18 = icmp eq i64 %17, %15
%19 = select i1 %16, i1 %18, i1 false
br i1 %19, label %9, label %20
20: ; preds = %9, %3
%21 = phi i32 [ %2, %3 ], [ %14, %9 ]
ret i32 %21
}
void dummyaudio_VolumeMute(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dummyaudio_VolumeMute() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doText();
int /*<<< orphan*/ putBoxTextPictureHead(double, double, char *, double, double,
                                         char *, char *);
int /*<<< orphan*/ putBoxTextPictureTail();
void putBoxTextPicture(double px, double py, char *box, double sx, double sy,
                       char *boxPos, char *position) {
  putBoxTextPictureHead(px, py, box, sx, sy, boxPos, position);
  doText();
  putBoxTextPictureTail();
}


x86 assembly (clang, -O0):
<putBoxTextPicture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1050 <putBoxTextPictureHead@plt>
mov    $0x0,%al
call   1030 <doText@plt>
mov    $0x0,%al
call   1040 <putBoxTextPictureTail@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putBoxTextPicture>:
push   %rax
call   1050 <putBoxTextPictureHead@plt>
xor    %eax,%eax
call   1030 <doText@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <putBoxTextPictureTail@plt>

LLVM IR (-O0):
define void @putBoxTextPicture(double %0, double %1, i8* %2, double %3, double %4, i8* %5, i8* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
%13 = alloca i8*
%14 = alloca i8*
store double %0, double* %8
store double %1, double* %9
store i8* %2, i8** %10
store double %3, double* %11
store double %4, double* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%15 = load double, double* %8
%16 = load double, double* %9
%17 = load i8*, i8** %10
%18 = load double, double* %11
%19 = load double, double* %12
%20 = load i8*, i8** %13
%21 = load i8*, i8** %14
%22 = call i32 @putBoxTextPictureHead(double %15, double %16, i8* %17, double %18, double %19, i8* %20, i8* %21)
%23 = call i32 (...) @doText()
%24 = call i32 (...) @putBoxTextPictureTail()
ret void
}

LLVM IR (-O2):
define void @putBoxTextPicture(double %0, double %1, i8* %2, double %3, double %4, i8* %5, i8* %6) {
%8 = tail call i32 @putBoxTextPictureHead(double %0, double %1, i8* %2, double %3, double %4, i8* %5, i8* %6)
%9 = tail call i32 (...) @doText()
%10 = tail call i32 (...) @putBoxTextPictureTail()
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getint(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n;
  while (getint(&n) != EOF) {
    printf("%d\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getint@plt>
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
je     115c <main+0x3c>
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <getint@plt>
mov    0x2eae(%rip),%r15
cmp    (%r15),%rax
je     1169 <main+0x49>
lea    0xeba(%rip),%r14
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getint@plt>
cmp    (%r15),%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i64 @getint(i32* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @getint(i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i64 @getint(i32* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
char **malloc(int);
int /*<<< orphan*/ printFF(char *, char **, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
void helpShell() {
  char **s = malloc(sizeof(char *));
  char *help = "Help\n the commands are clear, help, echo, ls and man\n write "
               "man \"comand\" for more information";
  s[0] = help;
  printFF("%s", s, 0);
  putchar('\n');
}


x86 assembly (clang, -O0):
<helpShell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xef7(%rip),%rdi
xor    %edx,%edx
call   1040 <printFF@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpShell>:
push   %rax
mov    $0x8,%edi
call   1050 <malloc@plt>
lea    0xebe(%rip),%rcx
mov    %rcx,(%rax)
lea    0xf12(%rip),%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1040 <printFF@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [94 x i8] c"Help\0A the commands are clear, help, echo, ls and man\0A write man \22comand\22 for more information\00"
@.str.1 = [3 x i8] c"%s\00"
define void @helpShell() {
%1 = alloca i8**
%2 = alloca i8*
%3 = call i8** @malloc(i32 8)
store i8** %3, i8*** %1
store i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i8**, i8*** %1
%6 = getelementptr inbounds i8*, i8** %5, i64 0
store i8* %4, i8** %6
%7 = load i8**, i8*** %1
%8 = call i32 @printFF(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %7, i32 0)
%9 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [94 x i8] c"Help\0A the commands are clear, help, echo, ls and man\0A write man \22comand\22 for more information\00"
@.str.1 = [3 x i8] c"%s\00"
define void @helpShell() {
%1 = tail call i8** @malloc(i32 8)
store i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = tail call i32 @printFF(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %1, i32 0)
%3 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fastaSort(char **, int, int);
int ssaha_init(char **argv, int argc, int SEG_LEN) {
  fastaSort(argv, argc, SEG_LEN);
  return (1);
}


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

x86 assembly (clang, -O2):
<ssaha_init>:
push   %rax
call   1030 <fastaSort@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ssaha_init(i8** %0, i32 %1, i32 %2) {
%4 = tail call i32 @fastaSort(i8** %0, i32 %1, i32 %2)
ret i32 1
}
/* Type definitions */
typedef char *uint8_t;
typedef char *uint16_t;

/* Variables and functions */
uint8_t sysIn8(uint16_t port) {
  uint16_t ret;
  __asm__ volatile("inb %w1,%b0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<sysIn8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysIn8>:
mov    %rdi,%rdx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @sysIn8(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "inb ${1:w},${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @sysIn8(i8* %0) {
%2 = tail call i8* asm sideeffect "inb ${1:w},${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int uirt2_calc_freq(int freq) {
  if (freq > 39000) {
    return 0x00;
  } else if (freq > 37000) {
    return 0x40;
  } else {
    return 0xC0;
  }
}


x86 assembly (clang, -O0):
<uirt2_calc_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9858,-0x8(%rbp)
jle    1120 <uirt2_calc_freq+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1140 <uirt2_calc_freq+0x40>
cmpl   $0x9088,-0x8(%rbp)
jle    1139 <uirt2_calc_freq+0x39>
movl   $0x40,-0x4(%rbp)
jmp    1140 <uirt2_calc_freq+0x40>
movl   $0xc0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uirt2_calc_freq>:
xor    %ecx,%ecx
cmp    $0x9089,%edi
setl   %cl
shl    $0x7,%ecx
or     $0x40,%ecx
xor    %eax,%eax
cmp    $0x9859,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @uirt2_calc_freq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 39000
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 37000
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 64, i32* %2
br label %12
11: ; preds = %7
store i32 192, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @uirt2_calc_freq(i32 %0) {
%2 = icmp sgt i32 %0, 39000
%3 = icmp sgt i32 %0, 37000
%4 = select i1 %3, i32 64, i32 192
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
void swap(char *str, int loc0, int loc1) {
  char tmp;
  tmp = str[loc0];
  str[loc0] = str[loc1];
  str[loc1] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int *malloc(int);
void test3() {
  int *s3 = malloc(1);
  if (s3 != NULL) {
    *s3 = 42;
  }
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <test3+0x2b>
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rax
mov    $0x1,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1126 <test3+0x16>
movl   $0x2a,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @test3() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 1)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32*, i32** %1
store i32 42, i32* %6
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @test3() {
%1 = tail call i32* @malloc(i32 1)
%2 = icmp eq i32* %1, null
br i1 %2, label %4, label %3
3: ; preds = %0
store i32 42, i32* %1
br label %4
4: ; preds = %3, %0
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  printf("Enter character: ");
  c = getchar();
  printf("Character entered: ");
  putchar(c);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [20 x i8] c"Character entered: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
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 signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8, i8* %2
%7 = call i32 @putchar(i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [20 x i8] c"Character entered: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @putchar(i8 signext %2)
ret i32 0
}
void val_delete_item(void *v) { (void)v; }


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

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

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

LLVM IR (-O2):
define void @val_delete_item(i8* nocapture %0) {
ret void
}
float maths_sigmoid(float x) { return (x / maths_fast_sqrt(1 + ((x) * (x)))); }


x86 assembly (clang, -O0):
<maths_sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xec3(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <maths_fast_sqrt@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maths_sigmoid>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  0xeda(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <maths_fast_sqrt@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @maths_sigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %4, float %5, float 1.000000e+00)
%7 = fpext float %6 to double
%8 = call i32 (double, ...) bitcast (i32 (...)* @maths_fast_sqrt to i32 (double, ...)*)(double %7)
%9 = sitofp i32 %8 to float
%10 = fdiv float %3, %9
ret float %10
}

LLVM IR (-O2):
define float @maths_sigmoid(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float %0, float 1.000000e+00)
%3 = fpext float %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @maths_fast_sqrt to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to float
%6 = fdiv float %0, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ banktitle(char *);
void obank2() {
  banktitle("Welcome to the 8th level branch office of the First National Bank "
            "of Ularn.");
}


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

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

LLVM IR (-O0):
@.str = [76 x i8] c"Welcome to the 8th level branch office of the First National Bank of Ularn.\00"
define void @obank2() {
%1 = call i32 @banktitle(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"Welcome to the 8th level branch office of the First National Bank of Ularn.\00"
define void @obank2() {
%1 = tail call i32 @banktitle(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void WatchdogLock(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  (*((volatile uint32_t *)(ui32Base + 0x00000C00))) = 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <WatchdogLock+0x2a>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xc00,%eax
cltq
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogLock>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
movl   $0x1,0xc00(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogLock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 3072
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 1, i32* %15
ret void
}

LLVM IR (-O2):
define void @WatchdogLock(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 3072
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 1, i32* %8
ret void
}
unsigned int f83(unsigned int x, int y __attribute__((unused))) {
  return (x << (8 * 4 - 1)) + (x >> 1);
}


x86 assembly (clang, -O0):
<f83>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f83(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 = shl i32 %5, 31
%7 = load i32, i32* %3
%8 = lshr i32 %7, 1
%9 = add i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f83(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: netreport [-r]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: netreport [-r]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: netreport [-r]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void swap(char *pb, char *pe) {
  *pb = *pb ^ *pe;
  *pe = *pb ^ *pe;
  *pb = *pb ^ *pe;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rsi),%al
xor    (%rdi),%al
mov    %al,(%rdi)
xor    (%rsi),%al
mov    %al,(%rsi)
xor    %al,(%rdi)
ret

LLVM IR (-O0):
define void @swap(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* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = xor i32 %7, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
store i8 %12, i8* %13
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = xor i32 %16, %19
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
store i8 %21, i8* %22
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = xor i32 %25, %28
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %3
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = xor i8 %4, %3
store i8 %5, i8* %0
%6 = load i8, i8* %1
%7 = xor i8 %6, %5
store i8 %7, i8* %1
%8 = load i8, i8* %0
%9 = xor i8 %8, %7
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
double exp(int);
float raw_tanh_function(float x) { return (2.0 / (1.0 + exp(-2 * x))) - 1.0; }


x86 assembly (clang, -O0):
<raw_tanh_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xeeb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0xec5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_tanh_function>:
push   %rax
mulss  0xee7(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1030 <exp@plt>
addsd  0xede(%rip),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @raw_tanh_function(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float -2.000000e+00, %3
%5 = fptosi float %4 to i32
%6 = call double @exp(i32 %5)
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double 2.000000e+00, %7
%9 = fsub double %8, 1.000000e+00
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @raw_tanh_function(float %0) {
%2 = fmul float %0, -2.000000e+00
%3 = fptosi float %2 to i32
%4 = tail call double @exp(i32 %3)
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 2.000000e+00, %5
%7 = fadd double %6, -1.000000e+00
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ safeExitErr(char *);
void *safeCalloc(size_t nmemb, size_t size) {
  void *mem = calloc(nmemb, size);
  if (size && nmemb && !mem)
    safeExitErr("Not enough memory");
  return mem;
}


x86 assembly (clang, -O0):
<safeCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <safeCalloc+0x4e>
cmpq   $0x0,-0x8(%rbp)
je     116e <safeCalloc+0x4e>
cmpq   $0x0,-0x18(%rbp)
jne    116e <safeCalloc+0x4e>
lea    0xe97(%rip),%rdi
call   1040 <safeExitErr@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeCalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <calloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     114e <safeCalloc+0x2e>
test   %r15,%r15
je     114e <safeCalloc+0x2e>
test   %r14,%r14
jne    114e <safeCalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <safeExitErr@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Not enough memory\00"
define i8* @safeCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i64, i64* %3
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = call i32 @safeExitErr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %14, %11, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [18 x i8] c"Not enough memory\00"
define noalias i8* @safeCalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i64 %1, 0
%5 = icmp eq i64 %0, 0
%6 = or i1 %5, %4
%7 = icmp ne i8* %3, null
%8 = or i1 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @safeExitErr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i8* %3
}
/* Variables and functions */
int yas_bma250_read_reg_byte(int);
int yas_bma250_get_eeprom_ready(unsigned char *eeprdy) {
  int ret = 0;
  int reg_data = 0;
  reg_data = yas_bma250_read_reg_byte(0x33);
  reg_data = ((reg_data & 0x04) >> 2);
  *eeprdy = reg_data;
  return ret;
}


x86 assembly (clang, -O0):
<yas_bma250_get_eeprom_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x33,%edi
call   1030 <yas_bma250_read_reg_byte@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x4,%eax
sar    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma250_get_eeprom_ready>:
push   %rbx
mov    %rdi,%rbx
mov    $0x33,%edi
call   1030 <yas_bma250_read_reg_byte@plt>
shr    $0x2,%al
and    $0x1,%al
mov    %al,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @yas_bma250_get_eeprom_ready(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @yas_bma250_read_reg_byte(i32 51)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 4
%8 = ashr i32 %7, 2
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %2
store i8 %10, i8* %11
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @yas_bma250_get_eeprom_ready(i8* nocapture writeonly %0) {
%2 = tail call i32 @yas_bma250_read_reg_byte(i32 51)
%3 = trunc i32 %2 to i8
%4 = lshr i8 %3, 2
%5 = and i8 %4, 1
store i8 %5, i8* %0
ret i32 0
}
/* Variables and functions */
double floor(double const);
double coco_round_double(const double number) { return floor(number + 0.5); }


x86 assembly (clang, -O0):
<coco_round_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coco_round_double>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @coco_round_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @coco_round_double(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
/* Variables and functions */
void *malloc(size_t);
void *ALautowahState_New(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ALautowahState_New>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ALautowahState_New(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  x = -1;
  x = x >> 1;
  assert(x == -1);
  x = -10;
  x = x >> 10;
  assert(x == -1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0xfffffff6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xa,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = ashr i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
store i32 -10, i32* %1
%8 = load i32, i32* %1
%9 = ashr i32 %8, 10
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
int andInstruction(int i, int j) {
  int mask = i & j;
  return mask;
}


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

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

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

LLVM IR (-O2):
define i32 @andInstruction(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct Foo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Foo_bar(struct Foo *);
struct Foo *Foo_new();
int main(int argc, char *argv[]) {
  struct Foo *f = Foo_new();
  Foo_bar(f);
  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 <Foo_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <Foo_bar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Foo = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Foo*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.Foo* (...) @Foo_new()
store %struct.Foo* %7, %struct.Foo** %6
%8 = load %struct.Foo*, %struct.Foo** %6
%9 = call i32 @Foo_bar(%struct.Foo* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.Foo = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.Foo* (...) @Foo_new()
%4 = tail call i32 @Foo_bar(%struct.Foo* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quick_settings_view_hide();
void phoneui_backend_quick_settings_hide() { quick_settings_view_hide(); }


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

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

LLVM IR (-O0):
define void @phoneui_backend_quick_settings_hide() {
%1 = call i32 (...) @quick_settings_view_hide()
ret void
}

LLVM IR (-O2):
define void @phoneui_backend_quick_settings_hide() {
%1 = tail call i32 (...) @quick_settings_view_hide()
ret void
}
/* Variables and functions */
scalar_t__ WEXITSTATUS(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
int is_in_path(char *exe) {
  char cmd[64];
  sprintf(cmd, "which %s >/dev/null", exe);
  return (WEXITSTATUS(system(cmd)) == 0);
}


x86 assembly (clang, -O0):
<is_in_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <WEXITSTATUS@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_path>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <WEXITSTATUS@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"which %s >/dev/null\00"
define i32 @is_in_path(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
%9 = call i64 @WEXITSTATUS(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"which %s >/dev/null\00"
define i32 @is_in_path(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
%6 = tail call i64 @WEXITSTATUS(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ print_bar();
int /*<<< orphan*/ print_center(char const *);
int print_header(const char *header) {
  print_bar();
  print_center(header);
  print_bar();
  return 0;
}


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

x86 assembly (clang, -O2):
<print_header>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <print_bar@plt>
mov    %rbx,%rdi
call   1030 <print_center@plt>
xor    %eax,%eax
call   1040 <print_bar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @print_bar()
%4 = load i8*, i8** %2
%5 = call i32 @print_center(i8* %4)
%6 = call i32 (...) @print_bar()
ret i32 0
}

LLVM IR (-O2):
define i32 @print_header(i8* %0) {
%2 = tail call i32 (...) @print_bar()
%3 = tail call i32 @print_center(i8* %0)
%4 = tail call i32 (...) @print_bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *memutil_alloc(size_t, char *, int);
void *memutil_dup(void *data, size_t size, char *file, int line) {
  void *ret = memutil_alloc(size, file, line);
  if (ret)
    memcpy(ret, data, size);
  return (ret);
}


x86 assembly (clang, -O0):
<memutil_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memutil_alloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1167 <memutil_dup+0x47>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memutil_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memutil_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114e <memutil_dup+0x2e>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memutil_dup(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @memutil_alloc(i64 %1, i8* %2, i32 %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
br label %9
9: ; preds = %7, %4
ret i8* %5
}
int tosError_getCodeDetail() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tosError_getCodeDetail() {
ret i32 0
}
/* Variables and functions */
int SIGINT;
int SIGQUIT;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cleanup(int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ printw(char *, int);
void ill_sig(int whichsig) {
  clear();
  if (!(whichsig == SIGINT || whichsig == SIGQUIT))
    printw("Error: caught signal # %d.\n", whichsig);
  cleanup(TRUE);
}


x86 assembly (clang, -O0):
<ill_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <clear@plt>
mov    -0x4(%rbp),%eax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
je     1175 <ill_sig+0x45>
mov    -0x4(%rbp),%eax
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%eax
je     1175 <ill_sig+0x45>
mov    -0x4(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printw@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1040 <cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ill_sig>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <clear@plt>
mov    0x2ea7(%rip),%rax
cmp    %ebx,(%rax)
je     115e <ill_sig+0x2e>
mov    0x2e94(%rip),%rax
cmp    %ebx,(%rax)
je     115e <ill_sig+0x2e>
lea    0xea9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printw@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1040 <cleanup@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@.str = [28 x i8] c"Error: caught signal # %d.\0A\00"
@TRUE = global i32 0
define void @ill_sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @clear()
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGINT
%6 = icmp eq i32 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = load i32, i32* @SIGQUIT
%10 = icmp eq i32 %8, %9
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @printw(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %7, %1
%15 = load i32, i32* @TRUE
%16 = call i32 @cleanup(i32 %15)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@.str = [28 x i8] c"Error: caught signal # %d.\0A\00"
@TRUE = global i32 0
define void @ill_sig(i32 %0) {
%2 = tail call i32 (...) @clear()
%3 = load i32, i32* @SIGINT
%4 = icmp eq i32 %3, %0
%5 = load i32, i32* @SIGQUIT
%6 = icmp eq i32 %5, %0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @printw(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* @TRUE
%12 = tail call i32 @cleanup(i32 %11)
ret void
}