xunge/DecIR huggingface dataset:
int isctrlalt(char buf[8]) {
  return buf[0] == '\033' && buf[1] > 0 && buf[1] < 32 && buf[2] == 0;
}


x86 assembly (clang, -O0):
<isctrlalt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x1b,%ecx
mov    %al,-0x9(%rbp)
jne    115a <isctrlalt+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jle    115a <isctrlalt+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
jge    115a <isctrlalt+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isctrlalt>:
xor    %eax,%eax
cmpb   $0x1b,(%rdi)
jne    111b <isctrlalt+0x1b>
mov    0x1(%rdi),%cl
add    $0xff,%cl
cmp    $0x1e,%cl
ja     111b <isctrlalt+0x1b>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isctrlalt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 27
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = add i8 %6, -1
%8 = icmp ult i8 %7, 31
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %9, %4, %1
%15 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ executeApplescriptAsync(char *, char *);
void playpause() { executeApplescriptAsync("iTunes", "playpause"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [10 x i8] c"playpause\00"
define void @playpause() {
%1 = call i32 @executeApplescriptAsync(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [10 x i8] c"playpause\00"
define void @playpause() {
%1 = tail call i32 @executeApplescriptAsync(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
short inw(short port) {
  short res;
  __asm__("inw %%dx,%%ax" : "=a"(res) : "d"(port));
  return res;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define signext i16 @inw(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm "inw %dx,%ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @inw(i16 signext %0) {
%2 = tail call i16 asm "inw %dx,%ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
int g() {}


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

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

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @g() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printa(int a[], int len) {
  for (int i = 0; i < len; i++) {
    printf("%d ", a[i]);
  }
}


x86 assembly (clang, -O0):
<printa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printa+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printa+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printa>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printa+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printa+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @printa(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printa(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t t0;
  t0 = time(NULL);
  printf("%s", asctime(localtime(&t0)));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
lea    0xe9c(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
void genbgezall() {}


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

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

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

LLVM IR (-O2):
define void @genbgezall() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_raw(int *, int *, int);
void R2(int *a, int *b) { R_raw(a, b, 2); }


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

x86 assembly (clang, -O2):
<R2>:
mov    $0x2,%edx
jmp    1030 <R_raw@plt>

LLVM IR (-O0):
define void @R2(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 = call i32 @R_raw(i32* %5, i32* %6, i32 2)
ret void
}

LLVM IR (-O2):
define void @R2(i32* %0, i32* %1) {
%3 = tail call i32 @R_raw(i32* %0, i32* %1, i32 2)
ret void
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void stack_swap(void) {
  double tmp1 = pop();
  double tmp2 = pop();
  push(tmp1);
  push(tmp2);
}


x86 assembly (clang, -O0):
<stack_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <push@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_swap>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @stack_swap() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @stack_swap() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ demo();
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ timer_pause(int);
int main(void) {
  setup_screen();
  srand(time(NULL));
  demo();
  timer_pause(5000);
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <setup_screen@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1040 <demo@plt>
mov    $0x1388,%edi
call   1070 <timer_pause@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <setup_screen@plt>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1040 <demo@plt>
mov    $0x1388,%edi
call   1070 <timer_pause@plt>
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @demo()
%6 = call i32 @timer_pause(i32 5000)
%7 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @demo()
%5 = tail call i32 @timer_pause(i32 5000)
%6 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mgetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char s[100];
  mgetline(s, 100);
  reverse(s);
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1050 <mgetline@plt>
lea    -0x70(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x70(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <mgetline@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @mgetline(i8* %3, i32 100)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @reverse(i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @mgetline(i8* %2, i32 100)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void psocMemoryBarrier() { __asm__ __volatile__("mfence" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @psocMemoryBarrier() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void floats_mat_to_xyz(const float M[16], float xyz[3]) {
  xyz[0] = M[3];
  xyz[1] = M[7];
  xyz[2] = M[11];
}


x86 assembly (clang, -O0):
<floats_mat_to_xyz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x1c(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x2c(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_mat_to_xyz>:
movss  0xc(%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x1c(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x2c(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @floats_mat_to_xyz(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 3
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 7
%12 = load float, float* %11
%13 = load float*, float** %4
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 11
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
ret void
}

LLVM IR (-O2):
define void @floats_mat_to_xyz(float* nocapture %0, float* nocapture writeonly %1) {
%3 = getelementptr inbounds float, float* %0, i64 3
%4 = load float, float* %3
store float %4, float* %1
%5 = getelementptr inbounds float, float* %0, i64 7
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
store float %6, float* %7
%8 = getelementptr inbounds float, float* %0, i64 11
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %1, i64 2
store float %9, float* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ec_print();
void ec_atexit_fcn(void) { ec_print(); }


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

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

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

LLVM IR (-O2):
define void @ec_atexit_fcn() {
%1 = tail call i32 (...) @ec_print()
ret void
}
int badmark(c)
int c;
{ return (getmark(c) == 0); }


x86 assembly (clang, -O0):
<badmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <getmark@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badmark>:
push   %rax
xor    %eax,%eax
call   1030 <getmark@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @badmark(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @getmark to i32 (i32, ...)*)(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @badmark(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @getmark to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int xuptime(void) {
  printf("uptime() not implemented\n");
  exit(-1);
}


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

x86 assembly (clang, -O2):
<xuptime>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@str = [25 x i8] c"uptime() not implemented\00"
define i32 @xuptime() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
struct cart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _cartVarDbName(char *, char *);
int cartInt(struct cart *, int /*<<< orphan*/);
int cartIntDb(struct cart *cart, char *db, char *var) {
  return cartInt(cart, _cartVarDbName(db, var));
}


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

x86 assembly (clang, -O2):
<cartIntDb>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <_cartVarDbName@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <cartInt@plt>

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

LLVM IR (-O2):
%struct.cart = type { i32 }
define i32 @cartIntDb(%struct.cart* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_cartVarDbName(i8* %1, i8* %2)
%5 = tail call i32 @cartInt(%struct.cart* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
size_t SIZE_MAX;
void *rzalloc_size(void const *, size_t);
void *rzalloc_array_size(const void *ctx, size_t size, size_t count) {
  if (count > SIZE_MAX / size)
    return NULL;
  return rzalloc_size(ctx, size * count);
}


x86 assembly (clang, -O0):
<rzalloc_array_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    115b <rzalloc_array_size+0x4b>
movq   $0x0,-0x8(%rbp)
jmp    1171 <rzalloc_array_size+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1030 <rzalloc_size@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rzalloc_array_size>:
mov    %rdx,%rcx
mov    0x2ebe(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1136 <rzalloc_array_size+0x26>
xor    %edx,%edx
div    %rsi
cmp    %rcx,%rax
jae    113f <rzalloc_array_size+0x2f>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %esi
cmp    %rcx,%rax
jb     1133 <rzalloc_array_size+0x23>
imul   %rsi,%rcx
mov    %rcx,%rsi
jmp    1030 <rzalloc_size@plt>

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i8* @rzalloc_array_size(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = load i64, i64* @SIZE_MAX
%10 = load i64, i64* %6
%11 = udiv i64 %9, %10
%12 = icmp ugt i64 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store i8* null, i8** %4
br label %20
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = mul i64 %16, %17
%19 = call i8* @rzalloc_size(i8* %15, i64 %18)
store i8* %19, i8** %4
br label %20
20: ; preds = %14, %13
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i8* @rzalloc_array_size(i8* %0, i64 %1, i64 %2) {
%4 = load i64, i64* @SIZE_MAX
%5 = udiv i64 %4, %1
%6 = icmp ult i64 %5, %2
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = mul i64 %2, %1
%9 = tail call i8* @rzalloc_size(i8* %0, i64 %8)
br label %10
10: ; preds = %3, %7
%11 = phi i8* [ %9, %7 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int gg_pass_cb(char *, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int gg_getkey(char *buf, int size) {
  int ret;
  ret = gg_pass_cb(buf, size, 0, NULL);
  if (!ret)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<gg_getkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <gg_pass_cb@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    114a <gg_getkey+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <gg_getkey+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_getkey>:
push   %rax
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <gg_pass_cb@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gg_getkey(i8* %0, i32 %1) {
%3 = tail call i32 @gg_pass_cb(i8* %0, i32 %1, i32 0, i32* null)
%4 = icmp eq i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
void RTRandAdvCreateSystemTruer(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandAdvCreateSystemTruer() {
ret void
}
void mg_ev_mgr_remove_conn(struct mg_connection *nc) { (void)nc; }


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

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

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

LLVM IR (-O2):
%struct.mg_connection = type opaque
define void @mg_ev_mgr_remove_conn(%struct.mg_connection* nocapture %0) {
ret void
}
void sigpipe() {}


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

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

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

LLVM IR (-O2):
define void @sigpipe() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
char *tccstrunescape(char const *);
char *tcjsonunescape(const char *str) {
  assert(str);
  return tccstrunescape(str);
}


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

x86 assembly (clang, -O2):
<tcjsonunescape>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tccstrunescape@plt>

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

LLVM IR (-O2):
define i8* @tcjsonunescape(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i8* @tccstrunescape(i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_copyright() {
  printf("Part of bcm-utils package ver. "
         "0.1"
         " \n");
  printf("Copyright (C) 2009  Andrew 'Necromant' Andrianov\n"
         "This is free software, and you are welcome to redistribute it\n"
         "under certain conditions. See COPYING for details\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Part of bcm-utils package ver. 0.1 \0A\00"
@.str.1 = [162 x i8] c"Copyright (C) 2009 Andrew 'Necromant' Andrianov\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions. See COPYING for details\0A\00"
define void @print_copyright() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Part of bcm-utils package ver. 0.1 \00"
@str.2 = [161 x i8] c"Copyright (C) 2009 Andrew 'Necromant' Andrianov\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions. See COPYING for details\00"
define void @print_copyright() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([161 x i8], [161 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void std_bool_str(const void *restrict self, const char *restrict format,
                  FILE *restrict stream) {
  (void)format;
  if (self)
    fputs(*(const bool *)self ? "true" : "false", stream);
}


x86 assembly (clang, -O0):
<std_bool_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <std_bool_str+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xec9(%rip),%rdi
lea    0xebd(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_bool_str>:
test   %rdi,%rdi
je     1132 <std_bool_str+0x22>
cmpl   $0x0,(%rdi)
lea    0xee6(%rip),%rax
lea    0xeda(%rip),%rdi
cmove  %rax,%rdi
mov    %rdx,%rsi
jmp    1030 <fputs@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define void @std_bool_str(i8* noalias %0, i8* noalias %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%17 = load i32*, i32** %6
%18 = call i32 @fputs(i8* %16, i32* %17)
br label %19
19: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define void @std_bool_str(i8* noalias %0, i8* noalias nocapture readnone %1, i32* noalias nocapture %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%10 = tail call i32 @fputs(i8* %9, i32* %2)
br label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sh_error(char *);
char *strdup(char const *);
char *savestr(const char *s) {
  char *p = strdup(s);
  if (!p)
    sh_error("Out of space");
  return p;
}


x86 assembly (clang, -O0):
<savestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <savestr+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <sh_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestr>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <savestr+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <sh_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Out of space\00"
define i8* @savestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @sh_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"Out of space\00"
define noalias i8* @savestr(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sh_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int m_get_canna_mode(int mode, int n) {
  int ret;
  ret = (mode >> (4 * n)) & 0x0f;
  return ret;
}


x86 assembly (clang, -O0):
<m_get_canna_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
sar    %cl,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_get_canna_mode>:
mov    %edi,%eax
lea    0x0(,%rsi,4),%ecx
sar    %cl,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @m_get_canna_mode(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 = mul nsw i32 4, %7
%9 = ashr i32 %6, %8
%10 = and i32 %9, 15
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @m_get_canna_mode(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = ashr i32 %0, %3
%5 = and i32 %4, 15
ret i32 %5
}
void f() {
  struct MyStruct {
    int abc;
    int def;
    float ghi;
    int jkl;
  };
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int transposescore(char charx, char chary) { return -2; }


x86 assembly (clang, -O0):
<transposescore>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0xfffffffe,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @transposescore(i8 signext %0, i8 signext %1) {
ret i32 -2
}
int do_928() { return 928; }


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

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

LLVM IR (-O0):
define i32 @do_928() {
ret i32 928
}

LLVM IR (-O2):
define i32 @do_928() {
ret i32 928
}
int d_bge_mm2(double *a1, double *a2) {
  return !(__builtin_isgreaterequal(*a1, *a2));
}


x86 assembly (clang, -O0):
<d_bge_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_mm2>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @d_bge_mm2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp oge double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_bge_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ult double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ access_pattern_init(int);
int /*<<< orphan*/ matrix_init(int, int, int);
int /*<<< orphan*/ matrix_multiply(int, int, int);
void *work(void *id) {
  int i, j;
  int n = 8;
  int my_id = *((int *)id);
  int row_count = n / 2;
  int first_row = (int)my_id * row_count;
  matrix_init(first_row, row_count, n);
  access_pattern_init(n);
  matrix_multiply(first_row, row_count, n);
  return NULL;
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1050 <matrix_init@plt>
mov    -0x14(%rbp),%edi
call   1030 <access_pattern_init@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <matrix_multiply@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
push   %rbx
mov    (%rdi),%ebx
shl    $0x2,%ebx
mov    %ebx,%edi
mov    $0x4,%esi
mov    $0x8,%edx
call   1050 <matrix_init@plt>
mov    $0x8,%edi
call   1030 <access_pattern_init@plt>
mov    %ebx,%edi
mov    $0x4,%esi
mov    $0x8,%edx
call   1040 <matrix_multiply@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @work(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %2
store i32 8, i32* %5
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = sdiv i32 %12, 2
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %5
%20 = call i32 @matrix_init(i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %5
%22 = call i32 @access_pattern_init(i32 %21)
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = call i32 @matrix_multiply(i32 %23, i32 %24, i32 %25)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @work(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl nsw i32 %3, 2
%5 = tail call i32 @matrix_init(i32 %4, i32 4, i32 8)
%6 = tail call i32 @access_pattern_init(i32 8)
%7 = tail call i32 @matrix_multiply(i32 %4, i32 4, i32 8)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ pelglo_(double *, double *);
void cpelglo(double *xmom, double *para) { pelglo_(xmom, para); }


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

x86 assembly (clang, -O2):
<cpelglo>:
jmp    1030 <pelglo_@plt>

LLVM IR (-O0):
define void @cpelglo(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @pelglo_(double* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @cpelglo(double* %0, double* %1) {
%3 = tail call i32 @pelglo_(double* %0, double* %1)
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
int r_close(int fd) {
  int retval;
  while (retval = close(fd), retval == -1 && errno == EINTR)
    ;
  return retval;
}


x86 assembly (clang, -O0):
<r_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jne    114f <r_close+0x3f>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115f <r_close+0x4f>
jmp    1164 <r_close+0x54>
jmp    111b <r_close+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1144 <r_close+0x34>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <r_close+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i64, i64* @errno
%11 = load i64, i64* @EINTR
%12 = icmp eq i64 %10, %11
br label %13
13: ; preds = %9, %4
%14 = phi i1 [ false, %4 ], [ %12, %9 ]
br i1 %14, label %15, label %16
15: ; preds = %13
br label %4
16: ; preds = %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @r_close(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void memory() { printf("Memory Testing : %s OK\n", "640k"); }


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

x86 assembly (clang, -O2):
<memory>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Memory Testing : %s OK\0A\00"
@.str.1 = [5 x i8] c"640k\00"
define void @memory() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Memory Testing : %s OK\0A\00"
@.str.1 = [5 x i8] c"640k\00"
define void @memory() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float RAND_MAX;
double log(float);
int rand();
void t() {
  int i;
  float f;
  i = rand();
  if (i == 0) {
    i = 1;
  }
  f = -log(((float)i) / RAND_MAX) / 10.0;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1143 <t+0x23>
movl   $0x1,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mov    0x2e99(%rip),%rax
divss  (%rax),%xmm0
call   1030 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe89(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
test   %eax,%eax
mov    $0x1,%ecx
cmovne %eax,%ecx
cvtsi2ss %ecx,%xmm0
mov    0x2eab(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define void @t() {
%1 = alloca i32
%2 = alloca float
%3 = call i32 (...) @rand()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
%9 = sitofp i32 %8 to float
%10 = load float, float* @RAND_MAX
%11 = fdiv float %9, %10
%12 = call double @log(float %11)
%13 = fneg double %12
%14 = fdiv double %13, 1.000000e+01
%15 = fptrunc double %14 to float
store float %15, float* %2
ret void
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define void @t() {
%1 = tail call i32 (...) @rand()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i32 1, i32 %1
%4 = sitofp i32 %3 to float
%5 = load float, float* @RAND_MAX
%6 = fdiv float %4, %5
%7 = tail call double @log(float %6)
ret void
}
/* Variables and functions */
double pow(int, double);
double ampdb(float db) { return (pow(10., (double)(db / 20.))); }


x86 assembly (clang, -O0):
<ampdb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ampdb>:
cvtss2sd %xmm0,%xmm0
divsd  0xee4(%rip),%xmm0
mov    $0xa,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @ampdb(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 2.000000e+01
%6 = call double @pow(i32 10, double %5)
ret double %6
}

LLVM IR (-O2):
define double @ampdb(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 2.000000e+01
%4 = tail call double @pow(i32 10, double %3)
ret double %4
}
float OR(float a, float b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<OR>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <OR+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <OR+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OR>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @OR(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ mvaddch(int /*<<< orphan*/, int, char);
int /*<<< orphan*/ mvprintw(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void notification(char *text) {
  for (int i = 0; i < 50; i++) {
    mvaddch(0, i, ' ');
  }
  mvprintw(0, 0, text);
  return;
}


x86 assembly (clang, -O0):
<notification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    115a <notification+0x3a>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
mov    $0x20,%edx
call   1030 <mvaddch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <notification+0x13>
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notification>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %ebp,%esi
mov    $0x20,%edx
call   1030 <mvaddch@plt>
add    $0x1,%ebp
cmp    $0x32,%ebp
jne    1130 <notification+0x10>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mvprintw@plt>

LLVM IR (-O0):
define void @notification(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 50
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @mvaddch(i32 0, i32 %8, i8 signext 32)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i8*, i8** %2
%15 = call i32 @mvprintw(i32 0, i32 0, i8* %14)
ret void
}

LLVM IR (-O2):
define void @notification(i8* %0) {
br label %4
2: ; preds = %4
%3 = tail call i32 @mvprintw(i32 0, i32 0, i8* %0)
ret void
4: ; preds = %1, %4
%5 = phi i32 [ 0, %1 ], [ %7, %4 ]
%6 = tail call i32 @mvaddch(i32 0, i32 %5, i8 signext 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 50
br i1 %8, label %2, label %4
}