xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dgeqrf_(int *, int *, double *, int *, double *, double *,
                           int *, int *);
int aa_cla_dgeqrf(int m, int n, double *A, int lda, double *tau, double *work,
                  int lwork) {
  int info = 0;
  dgeqrf_(&m, &n, A, &lda, tau, work, &lwork, &info);
  return info;
}


x86 assembly (clang, -O0):
<aa_cla_dgeqrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    0x10(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dgeqrf_@plt>
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dgeqrf>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rax
lea    0x20(%rsp),%r10
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
push   %rax
push   %r10
call   1030 <dgeqrf_@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @aa_cla_dgeqrf(i32 %0, i32 %1, double* %2, i32 %3, double* %4, double* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store double* %2, double** %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
store i32 %6, i32* %14
store i32 0, i32* %15
%16 = load double*, double** %10
%17 = load double*, double** %12
%18 = load double*, double** %13
%19 = call i32 @dgeqrf_(i32* %8, i32* %9, double* %16, i32* %11, double* %17, double* %18, i32* %14, i32* %15)
%20 = load i32, i32* %15
ret i32 %20
}

LLVM IR (-O2):
define i32 @aa_cla_dgeqrf(i32 %0, i32 %1, double* %2, i32 %3, double* %4, double* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %3, i32* %10
store i32 %6, i32* %11
%13 = bitcast i32* %12 to i8*
store i32 0, i32* %12
%14 = call i32 @dgeqrf_(i32* %8, i32* %9, double* %2, i32* %10, double* %4, double* %5, i32* %11, i32* %12)
%15 = load i32, i32* %12
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f1() { puts("function f1"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"function f1\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int c_div(int a, int b) {
  if (a == 0)
    return (0);
  return (b / a);
}


x86 assembly (clang, -O0):
<c_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1120 <c_div+0x20>
movl   $0x0,-0x4(%rbp)
jmp    112a <c_div+0x2a>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_div>:
test   %edi,%edi
je     110a <c_div+0xa>
mov    %esi,%eax
cltd
idiv   %edi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @c_div(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %1, %0
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
int parent(int nodeidx) { return (nodeidx - 1) / 2; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Msp430ClockP__Msp430ClockInit__default__initClocks();
void Msp430ClockP__Msp430ClockInit__initClocks(void) {
  Msp430ClockP__Msp430ClockInit__default__initClocks();
}


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

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

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

LLVM IR (-O2):
define void @Msp430ClockP__Msp430ClockInit__initClocks() {
%1 = tail call i32 (...) @Msp430ClockP__Msp430ClockInit__default__initClocks()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wfile_is_symlink_ex(char *, char *);
char *wsys_full_exe_name(char *s) {
  if (!wfile_is_symlink_ex("/proc/self/exe", s))
    s[0] = '\0';
  return (s);
}


x86 assembly (clang, -O0):
<wsys_full_exe_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <wfile_is_symlink_ex@plt>
cmp    $0x0,%eax
jne    113c <wsys_full_exe_name+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsys_full_exe_name>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <wfile_is_symlink_ex@plt>
test   %eax,%eax
jne    112a <wsys_full_exe_name+0x1a>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i8* @wsys_full_exe_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @wfile_is_symlink_ex(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i8* @wsys_full_exe_name(i8* returned %0) {
%2 = tail call i32 @wfile_is_symlink_ex(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 0, i8* %0
br label %5
5: ; preds = %4, %1
ret i8* %0
}
void UARTWriteChar(unsigned char ch) {
  while (((*(volatile unsigned long *)(0xE000C000 + 0x14)) & 0x20) == 0)
    ;
  (*(volatile unsigned long *)(0xE000C000 + 0x00)) = ch;
}


x86 assembly (clang, -O0):
<UARTWriteChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
jne    1125 <UARTWriteChar+0x25>
jmp    110a <UARTWriteChar+0xa>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    $0xe000c000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTWriteChar>:
mov    $0xe000c000,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x20,0x14(%rax)
je     1110 <UARTWriteChar+0x10>
movzbl %dil,%ecx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @UARTWriteChar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%5 = and i64 %4, 32
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
%10 = zext i8 %9 to i64
store volatile i64 %10, i64* inttoptr (i64 3758145536 to i64*)
ret void
}

LLVM IR (-O2):
define void @UARTWriteChar(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%4 = and i64 %3, 32
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = zext i8 %0 to i64
store volatile i64 %7, i64* inttoptr (i64 3758145536 to i64*)
ret void
}
char getCharToSend(void) {
  static unsigned char i = 16;
  if (i == 125) {
    i = 16;
  }
  return (i++);
}


x86 assembly (clang, -O0):
<getCharToSend>:
push   %rbp
mov    %rsp,%rbp
movzbl 0x2f15(%rip),%eax
cmp    $0x7d,%eax
jne    111b <getCharToSend+0x1b>
movb   $0x10,0x2f05(%rip)
mov    0x2eff(%rip),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,0x2ef4(%rip)
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCharToSend>:
movzbl 0x2f19(%rip),%ecx
cmp    $0x7d,%cl
mov    $0x10,%eax
cmovne %ecx,%eax
lea    0x1(%rax),%ecx
mov    %cl,0x2f05(%rip)
ret

LLVM IR (-O0):
@getCharToSend.i = internal global i8 16
define signext i8 @getCharToSend() {
%1 = load i8, i8* @getCharToSend.i
%2 = zext i8 %1 to i32
%3 = icmp eq i32 %2, 125
br i1 %3, label %4, label %5
4: ; preds = %0
store i8 16, i8* @getCharToSend.i
br label %5
5: ; preds = %4, %0
%6 = load i8, i8* @getCharToSend.i
%7 = add i8 %6, 1
store i8 %7, i8* @getCharToSend.i
ret i8 %6
}

LLVM IR (-O2):
@getCharToSend.i = internal unnamed_addr global i8 16
define signext i8 @getCharToSend() {
%1 = load i8, i8* @getCharToSend.i
%2 = icmp eq i8 %1, 125
%3 = select i1 %2, i8 16, i8 %1
%4 = add i8 %3, 1
store i8 %4, i8* @getCharToSend.i
ret i8 %3
}
void rop3_4_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_4_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_4_1_0>:
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_4_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(short *, short *, int);
int main() {
  short a, b[40];
  send(&a, b, 40);
  return (a == b[39]) ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rsi
lea    -0x6(%rbp),%rdi
mov    $0x28,%edx
call   1030 <send@plt>
movswl -0x6(%rbp),%edx
movswl -0x12(%rbp),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0xe(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x28,%edx
call   1030 <send@plt>
movzwl 0xe(%rsp),%ecx
xor    %eax,%eax
cmp    0x5e(%rsp),%cx
setne  %al
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca [40 x i16]
store i32 0, i32* %1
%4 = getelementptr inbounds [40 x i16], [40 x i16]* %3, i64 0, i64 0
%5 = call i32 @send(i16* %2, i16* %4, i32 40)
%6 = load i16, i16* %2
%7 = sext i16 %6 to i32
%8 = getelementptr inbounds [40 x i16], [40 x i16]* %3, i64 0, i64 39
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i16
%2 = alloca [40 x i16]
%3 = bitcast i16* %1 to i8*
%4 = bitcast [40 x i16]* %2 to i8*
%5 = getelementptr inbounds [40 x i16], [40 x i16]* %2, i64 0, i64 0
%6 = call i32 @send(i16* %1, i16* %5, i32 40)
%7 = load i16, i16* %1
%8 = getelementptr inbounds [40 x i16], [40 x i16]* %2, i64 0, i64 39
%9 = load i16, i16* %8
%10 = icmp ne i16 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
int count_bits(int n) {
  int b = 0;
  for (; n; n >>= 1)
    if (n & 1) {
      b++;
    }
  return b;
}


x86 assembly (clang, -O0):
<count_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <count_bits+0x43>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <count_bits+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <count_bits+0x35>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <count_bits+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
double make_double(int);
double f(void) {
  int bar = 17;
  return make_double(bar);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <make_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x11,%edi
jmp    1030 <make_double@plt>

LLVM IR (-O0):
define double @f() {
%1 = alloca i32
store i32 17, i32* %1
%2 = load i32, i32* %1
%3 = call double @make_double(i32 %2)
ret double %3
}

LLVM IR (-O2):
define double @f() {
%1 = tail call double @make_double(i32 17)
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void SPI_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @SPI_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @SPI_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
int do_790() { return 790; }


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

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

LLVM IR (-O0):
define i32 @do_790() {
ret i32 790
}

LLVM IR (-O2):
define i32 @do_790() {
ret i32 790
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t __fwrite(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  size_t ret = __fwrite(ptr, size, nmemb, stream);
  return ret;
}


x86 assembly (clang, -O0):
<fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <__fwrite@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread>:
jmp    1030 <__fwrite@plt>

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

LLVM IR (-O2):
define i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i64 @__fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
int foo3(float a, float b) { return !(a < b); }


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @foo3(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 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo3(float %0, float %1) {
%3 = fcmp uge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int PAPI_ipc(float *, float *, long long *, float *);
void papif_ipc_(float *rtime, float *ptime, long long *ins, float *ipc,
                int *check) {
  *check = PAPI_ipc(rtime, ptime, ins, ipc);
}


x86 assembly (clang, -O0):
<papif_ipc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_ipc@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_ipc_>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_ipc@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_ipc_(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_ipc(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_ipc_(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_ipc(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
int func2(char hex_dec[100]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func2(i8* nocapture readnone %0) {
ret i32 0
}
int fedisableexcept(int excepts) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fedisableexcept(i32 %0) {
ret i32 0
}
int main() {
  char out = 0x55;
  __asm__("movl $0x42, %%eax; cmpl $0x42, %%eax; setc %%al" : "=a"(out));
  return out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
mov    $0x42,%eax
cmp    $0x42,%eax
setb   %al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x42,%eax
cmp    $0x42,%eax
setb   %al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
%3 = call i8 asm "movl $$0x42, %eax; cmpl $$0x42, %eax; setc %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "movl $$0x42, %eax; cmpl $$0x42, %eax; setc %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = sext i8 %1 to i32
ret i32 %2
}
/* Variables and functions */
scalar_t__ Pmnm();
scalar_t__ PnumberValue();
PmiNoMaxValue() {
  int b = -1;
  ;
  b = PnumberValue() || Pmnm();
  return (b);
}


x86 assembly (clang, -O0):
<PmiNoMaxValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1040 <PnumberValue@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1159 <PmiNoMaxValue+0x39>
mov    $0x0,%al
call   1030 <Pmnm@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PmiNoMaxValue>:
push   %rax
xor    %eax,%eax
call   1040 <PnumberValue@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <PmiNoMaxValue+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <Pmnm@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @PmiNoMaxValue() {
%1 = tail call i64 (...) @PnumberValue()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Pmnm()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
void *ffoox1g(void) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @ffoox1g() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ffoox1g() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("is a demo"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"is a demo\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct lock_impl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __CPROVER_assume(int /*<<< orphan*/);
int /*<<< orphan*/ lock_impl_trylock(struct lock_impl *);
void lock_impl_lock(struct lock_impl *lock) {
  __CPROVER_assume(lock_impl_trylock(lock));
}


x86 assembly (clang, -O0):
<lock_impl_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lock_impl_trylock@plt>
mov    %eax,%edi
call   1030 <__CPROVER_assume@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_impl_lock>:
push   %rax
call   1040 <lock_impl_trylock@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <__CPROVER_assume@plt>

LLVM IR (-O0):
%struct.lock_impl = type { i32 }
define void @lock_impl_lock(%struct.lock_impl* %0) {
%2 = alloca %struct.lock_impl*
store %struct.lock_impl* %0, %struct.lock_impl** %2
%3 = load %struct.lock_impl*, %struct.lock_impl** %2
%4 = call i32 @lock_impl_trylock(%struct.lock_impl* %3)
%5 = call i32 @__CPROVER_assume(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.lock_impl = type { i32 }
define void @lock_impl_lock(%struct.lock_impl* %0) {
%2 = tail call i32 @lock_impl_trylock(%struct.lock_impl* %0)
%3 = tail call i32 @__CPROVER_assume(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int x = 1;
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  if (z > 5)
    x = y;
  else
    x++;
  __VERIFIER_assert(x != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jle    115f <main+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x6,%eax
setl   %al
test   %ebx,%ebx
setne  %cl
or     %al,%cl
movzbl %cl,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %14
11: ; preds = %0
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @__VERIFIER_assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp slt i32 %2, 6
%4 = icmp ne i32 %1, 0
%5 = select i1 %3, i1 true, i1 %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @__VERIFIER_assert(i32 %6)
ret i32 0
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ inet_ntoa(struct in_addr);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, size_t);
char *inaddr_str(in_addr_t a, char *buf, size_t len) {
  struct in_addr addr;
  addr.s_addr = a;
  strncpy(buf, inet_ntoa(addr), len);
  buf[len - 1] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<inaddr_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inaddr_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <inet_ntoa@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @inaddr_str(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.in_addr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i8*, i8** %5
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @inet_ntoa(i32 %12)
%14 = load i64, i64* %6
%15 = call i32 @strncpy(i8* %10, i32 %13, i64 %14)
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = sub i64 %17, 1
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @inaddr_str(i32 %0, i8* returned %1, i64 %2) {
%4 = tail call i32 @inet_ntoa(i32 %0)
%5 = tail call i32 @strncpy(i8* %1, i32 %4, i64 %2)
%6 = add i64 %2, -1
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 0, i8* %7
ret i8* %1
}
void BRAKE_ADC_ISR2(void) {}


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

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

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

LLVM IR (-O2):
define void @BRAKE_ADC_ISR2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *myThreadFun(void *vargp) {
  sleep(1);
  printf("Printing something from Thread \n");
  return NULL;
}


x86 assembly (clang, -O0):
<myThreadFun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myThreadFun>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Printing something from Thread \0A\00"
define i8* @myThreadFun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [32 x i8] c"Printing something from Thread \00"
define noalias i8* @myThreadFun(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cginc2iw(void) { ngen("%s\t(%%edx)", "incl", 0); }


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

x86 assembly (clang, -O2):
<cginc2iw>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"incl\00"
define void @cginc2iw() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09(%%edx)\00"
@.str.1 = [5 x i8] c"incl\00"
define void @cginc2iw() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
int memtst(unsigned char *buf, unsigned char c, int len) {
  int i;
  for (i = 0; i < len; i++)
    if (*buf++ != c)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<memtst>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1161 <memtst+0x61>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
movzbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     114e <memtst+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <memtst+0x68>
jmp    1153 <memtst+0x53>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <memtst+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memtst>:
test   %edx,%edx
jle    111e <memtst+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rdi,%rcx,1)
jne    1121 <memtst+0x21>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <memtst+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @memtst(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %10
%6 = phi i32 [ %12, %10 ], [ 0, %3 ]
%7 = phi i8* [ %11, %10 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %1
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %3
%15 = phi i32 [ 0, %3 ], [ 0, %10 ], [ 1, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ glmXor3s(int *, int *, int);
void glmXor3s_(bool x[3], bool y) { glmXor3s(x, x, y); }


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

x86 assembly (clang, -O2):
<glmXor3s_>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <glmXor3s@plt>

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

LLVM IR (-O2):
define void @glmXor3s_(i32* %0, i32 %1) {
%3 = tail call i32 @glmXor3s(i32* %0, i32* %0, i32 %1)
ret void
}
int get_gcd(int a, int b) {
  while (b > 0) {
    int n = a % b;
    a = b;
    b = n;
  }
  return a;
}


x86 assembly (clang, -O0):
<get_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <get_gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <get_gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <get_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <get_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ searchn(int);
void searchback() { searchn(-1); }


x86 assembly (clang, -O0):
<searchback>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <searchn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchback>:
mov    $0xffffffff,%edi
jmp    1030 <searchn@plt>

LLVM IR (-O0):
define void @searchback() {
%1 = call i32 @searchn(i32 -1)
ret void
}

LLVM IR (-O2):
define void @searchback() {
%1 = tail call i32 @searchn(i32 -1)
ret void
}
int fb_ConsoleGetX(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb_ConsoleGetX() {
ret i32 0
}
/* Variables and functions */
int SSL_accept(void *);
int dv_openssl_error(void *, int);
int dv_openssl_accept(void *s) {
  int ret = 0;
  ret = SSL_accept(s);
  if (ret == 1) {
    return 0;
  }
  return dv_openssl_error(s, ret);
}


x86 assembly (clang, -O0):
<dv_openssl_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <SSL_accept@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1155 <dv_openssl_accept+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1164 <dv_openssl_accept+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <dv_openssl_error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv_openssl_accept>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SSL_accept@plt>
cmp    $0x1,%eax
jne    1132 <dv_openssl_accept+0x12>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dv_openssl_error@plt>

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

LLVM IR (-O2):
define i32 @dv_openssl_accept(i8* %0) {
%2 = tail call i32 @SSL_accept(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @dv_openssl_error(i8* %0, i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
unsigned cpu_uint32_make_uint16(unsigned v0, unsigned v1) {
  return v0 | v1 << 16;
}


x86 assembly (clang, -O0):
<cpu_uint32_make_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_uint32_make_uint16>:
mov    %esi,%eax
shl    $0x10,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cpu_uint32_make_uint16(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 = shl i32 %6, 16
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @cpu_uint32_make_uint16(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
double currentTime();
double currentTimeMS() { return currentTime() * 1000.0; }


x86 assembly (clang, -O0):
<currentTimeMS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <currentTime@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentTimeMS>:
push   %rax
xor    %eax,%eax
call   1030 <currentTime@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @currentTimeMS() {
%1 = call double (...) @currentTime()
%2 = fmul double %1, 1.000000e+03
ret double %2
}

LLVM IR (-O2):
define double @currentTimeMS() {
%1 = tail call double (...) @currentTime()
%2 = fmul double %1, 1.000000e+03
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(int argc, char **argv) {
  (void)argc;
  fprintf(stderr,
          "Usage: %s l_string dst\n"
          "Create a lookup table\n"
          "\n"
          "l_string  string length\n"
          "dst       the destination file\n",
          argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [102 x i8] c"Usage: %s l_string dst\0ACreate a lookup table\0A\0Al_string string length\0Adst the destination file\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @stderr
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [102 x i8] c"Usage: %s l_string dst\0ACreate a lookup table\0A\0Al_string string length\0Adst the destination file\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void JIS0212_to_Unicode(void) {}


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

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

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

LLVM IR (-O2):
define void @JIS0212_to_Unicode() {
ret void
}
/* Variables and functions */
double rnd();
double rnd_double(void) { return rnd() / 2147483647.0; }


x86 assembly (clang, -O0):
<rnd_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rnd@plt>
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_double>:
push   %rax
xor    %eax,%eax
call   1030 <rnd@plt>
divsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rnd_double() {
%1 = call double (...) @rnd()
%2 = fdiv double %1, 0x41DFFFFFFFC00000
ret double %2
}

LLVM IR (-O2):
define double @rnd_double() {
%1 = tail call double (...) @rnd()
%2 = fdiv double %1, 0x41DFFFFFFFC00000
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ _ptrc_glPolygonOffset(float, float);
__attribute__((visibility("default"))) void emu_glPolygonOffset(float factor,
                                                                float units) {
  _ptrc_glPolygonOffset(factor, units);
}


x86 assembly (clang, -O0):
<emu_glPolygonOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <_ptrc_glPolygonOffset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emu_glPolygonOffset>:
jmp    1030 <_ptrc_glPolygonOffset@plt>

LLVM IR (-O0):
define void @emu_glPolygonOffset(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 = load float, float* %4
%7 = call i32 @_ptrc_glPolygonOffset(float %5, float %6)
ret void
}

LLVM IR (-O2):
define void @emu_glPolygonOffset(float %0, float %1) {
%3 = tail call i32 @_ptrc_glPolygonOffset(float %0, float %1)
ret void
}
/* Variables and functions */
int possibly_dupli_function() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @possibly_dupli_function() {
ret i32 1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int _lstat(const char *path, struct stat *buf) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_lstat>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_lstat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}