xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; ++i)
    printf("%s ", argv[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1161 <main+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1157 <main+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xec1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int EINVAL;
int devpts_new_index(void) { return -EINVAL; }


x86 assembly (clang, -O0):
<devpts_new_index>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<devpts_new_index>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @devpts_new_index() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @devpts_new_index() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long selection;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselection_selection(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselection.selection = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xselection_selection>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xselection_selection(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xselection_selection(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int krb_afslog(const char *cell, const char *realm) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @krb_afslog(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int do_343() { return 343; }


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

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

LLVM IR (-O0):
define i32 @do_343() {
ret i32 343
}

LLVM IR (-O2):
define i32 @do_343() {
ret i32 343
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; ++i) {
    printf("[%d] %s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"[%d] %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
void Lut_4(double *out, double *in) {
  out[0] = in[0];
  out[1] = in[1];
  out[2] = in[2];
  out[3] = in[3];
}


x86 assembly (clang, -O0):
<Lut_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lut_4>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @Lut_4(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 2
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 3
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 3
store double %11, double* %12
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(scalar_t__, scalar_t__);
uint32_t mvhd_epoch_to_vhd_ts(time_t ts) {
  time_t start_time = 946684800;
  if (ts < start_time) {
    return start_time;
  }
  double vhd_time = difftime(ts, start_time);
  return (uint32_t)vhd_time;
}


x86 assembly (clang, -O0):
<mvhd_epoch_to_vhd_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x386d4380,-0x18(%rbp)
38
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    113f <mvhd_epoch_to_vhd_ts+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <mvhd_epoch_to_vhd_ts+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <difftime@plt>
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvhd_epoch_to_vhd_ts>:
mov    $0x386d4380,%eax
cmp    $0x386d4380,%rdi
jl     1132 <mvhd_epoch_to_vhd_ts+0x22>
push   %rax
mov    $0x386d4380,%esi
call   1030 <difftime@plt>
cvttsd2si %xmm0,%rax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i64 @mvhd_epoch_to_vhd_ts(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 946684800, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i64, i64* %4
store i64 %10, i64* %2
br label %17
11: ; preds = %1
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = call double @difftime(i64 %12, i64 %13)
store double %14, double* %5
%15 = load double, double* %5
%16 = fptosi double %15 to i64
store i64 %16, i64* %2
br label %17
17: ; preds = %11, %9
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
define i64 @mvhd_epoch_to_vhd_ts(i64 %0) {
%2 = icmp slt i64 %0, 946684800
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call double @difftime(i64 %0, i64 946684800)
%5 = fptosi double %4 to i64
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 946684800, %1 ]
ret i64 %7
}
int ands_si_test3(int a, int b, int c) {
  int d = a & (b << 3);
  if (d <= 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<ands_si_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1133 <ands_si_test3+0x33>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <ands_si_test3+0x3f>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ands_si_test3>:
lea    0x0(,%rsi,8),%ecx
and    %edi,%ecx
lea    (%rsi,%rcx,1),%eax
test   %ecx,%ecx
cmovle %edi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ands_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = shl i32 %10, 3
%12 = and i32 %9, %11
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp sle i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
store i32 %18, i32* %4
br label %25
19: ; preds = %3
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %7
%24 = add nsw i32 %22, %23
store i32 %24, i32* %4
br label %25
25: ; preds = %19, %15
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @ands_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 3
%5 = and i32 %4, %0
%6 = icmp slt i32 %5, 1
%7 = add nsw i32 %5, %1
%8 = select i1 %6, i32 %0, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
execlsrh(arg1, arg2, arg3) char *arg1, *arg2, *arg3;
{ return (excvsrh(arg1, &arg1)); }


x86 assembly (clang, -O0):
<execlsrh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <excvsrh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execlsrh>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <excvsrh@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execlsrh(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @excvsrh to i32 (i8*, i8**, ...)*)(i8* %7, i8** %4)
ret i32 %8
}

LLVM IR (-O2):
define i32 @execlsrh(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @excvsrh to i32 (i8*, i8**, ...)*)(i8* %0, i8** %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_rlca(void) { op_write1(0x07); }


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

x86 assembly (clang, -O2):
<op_enc_rlca>:
mov    $0x7,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_rlca() {
%1 = call i32 @op_write1(i32 7)
ret void
}

LLVM IR (-O2):
define void @op_enc_rlca() {
%1 = tail call i32 @op_write1(i32 7)
ret void
}
int MPI_Init(int *pargc, char ***pargv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MPI_Init(i32* nocapture readnone %0, i8*** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
long double sqrtl(long double);
long double libm_sqrtl(long double x) { return sqrtl(x); }


x86 assembly (clang, -O0):
<libm_sqrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sqrtl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libm_sqrtl>:
jmp    1030 <sqrtl@plt>

LLVM IR (-O0):
define x86_fp80 @libm_sqrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @sqrtl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @libm_sqrtl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sqrtl(x86_fp80 %0)
ret x86_fp80 %2
}
void Delay(void) {
  float usdelay = 0.0;
  usdelay = (1000 / ((1.0 / 28000000) * 1000000000));
  while (usdelay != 0) {
    asm("NOP");
    usdelay--;
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xeec(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1135 <Delay+0x35>
jp     1135 <Delay+0x35>
jmp    114d <Delay+0x4d>
nop
movss  0xec6(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1119 <Delay+0x19>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Delay() {
%1 = alloca float
store float 0.000000e+00, float* %1
store float 2.800000e+01, float* %1
br label %2
2: ; preds = %5, %0
%3 = load float, float* %1
%4 = fcmp une float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load float, float* %1
%7 = fadd float %6, -1.000000e+00
store float %7, float* %1
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @Delay() {
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
int64_t decode_native_64_signed(char *buf) {
  int64_t rv;
  memcpy(&rv, buf, 8);
  return rv;
}


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

x86 assembly (clang, -O2):
<decode_native_64_signed>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @decode_native_64_signed(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 8)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, size_t);
bool starts_with(const char *line, const char *word) {
  size_t len;
  len = strlen(word);
  if (!strncmp(line, word, len))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1163 <starts_with+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116a <starts_with+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_menu(void) {
  printf("1. register\n");
  printf("2. login\n");
  printf("3. exit\n");
  printf(">");
}


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

x86 assembly (clang, -O2):
<display_menu>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x3e,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"1. register\0A\00"
@.str.1 = [10 x i8] c"2. login\0A\00"
@.str.2 = [9 x i8] c"3. exit\0A\00"
@.str.3 = [2 x i8] c">\00"
define void @display_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"1. register\00"
@str.4 = [9 x i8] c"2. login\00"
@str.5 = [8 x i8] c"3. exit\00"
define void @display_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 62)
ret void
}
/* Variables and functions */
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int get_int(const char *v) { return (int)strtol(v, NULL, 0); }


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

x86 assembly (clang, -O2):
<get_int>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @get_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i32* null, i32 0)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_int(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBHostPwrConfig(uint32_t ui32Base, uint32_t ui32Flags) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000430))) = ui32Flags >> 16;
  (*((volatile unsigned short *)(ui32Base + 0x00000400))) =
      (ui32Flags | ((*((volatile unsigned short *)(ui32Base + 0x00000400))) &
                    ~(0x00000300 | 0x00000040 | 0x00000020 | 0x00000003)));
}


x86 assembly (clang, -O0):
<USBHostPwrConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    $0x430,%eax
cltq
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x400,%ecx
movslq %ecx,%rcx
mov    (%rcx),%cx
movzwl %cx,%ecx
and    $0xfffffc9c,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrConfig>:
mov    %esi,%eax
sar    $0x10,%eax
cltq
movslq %edi,%rcx
mov    %rax,0x430(%rcx)
movzwl 0x400(%rcx),%eax
and    $0xfffffc9c,%eax
or     %esi,%eax
mov    %ax,0x400(%rcx)
ret

LLVM IR (-O0):
define void @USBHostPwrConfig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 16
%7 = sext i32 %6 to i64
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1072
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1024
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i16*
%17 = load volatile i16, i16* %16
%18 = zext i16 %17 to i32
%19 = and i32 %18, -868
%20 = or i32 %12, %19
%21 = trunc i32 %20 to i16
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1024
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i16*
store volatile i16 %21, i16* %25
ret void
}

LLVM IR (-O2):
define void @USBHostPwrConfig(i32 %0, i32 %1) {
%3 = ashr i32 %1, 16
%4 = sext i32 %3 to i64
%5 = add nsw i32 %0, 1072
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
store volatile i64 %4, i64* %7
%8 = add nsw i32 %0, 1024
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i16*
%11 = load volatile i16, i16* %10
%12 = and i16 %11, -868
%13 = trunc i32 %1 to i16
%14 = or i16 %12, %13
store volatile i16 %14, i16* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int _read(int fd, void *buffer, unsigned int count) {
  fprintf(stderr, "read not implemented\n");
  return -1;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"read not implemented\0A\00"
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"read not implemented\0A\00"
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("gcc %d.%d\n", 9, 4);
  printf("CC\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"gcc %d.%d\0A\00"
@.str.1 = [4 x i8] c"CC\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 9, i32 4)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"gcc %d.%d\0A\00"
@str = [3 x i8] c"CC\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 9, i32 4)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int tolower(int);
int toupper(int);
int invert(int c) {
  if (isupper(c))
    return tolower(c);
  else if (islower(c))
    return toupper(c);
  else
    return c;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <isupper@plt>
cmp    $0x0,%rax
je     116d <invert+0x2d>
mov    -0x8(%rbp),%edi
call   1050 <tolower@plt>
mov    %eax,-0x4(%rbp)
jmp    1195 <invert+0x55>
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     118f <invert+0x4f>
mov    -0x8(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0x4(%rbp)
jmp    1195 <invert+0x55>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
push   %rbx
mov    %edi,%ebx
call   1060 <isupper@plt>
test   %rax,%rax
je     1155 <invert+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <tolower@plt>
mov    %ebx,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     1169 <invert+0x29>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <toupper@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @invert(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tolower(i32 %0)
br label %11
6: ; preds = %1
%7 = tail call i64 @islower(i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @toupper(i32 %0)
br label %11
11: ; preds = %6, %9, %4
%12 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_embedded_null() {
  clang_analyzer_eval(strcasecmp("ab\0zz", "ab\0yy") == 0);
}


x86 assembly (clang, -O0):
<strcasecmp_embedded_null>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp_embedded_null>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ab\00zz\00"
@.str.1 = [6 x i8] c"ab\00yy\00"
define void @strcasecmp_embedded_null() {
%1 = call i64 @strcasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ab\00zz\00"
@.str.1 = [6 x i8] c"ab\00yy\00"
define void @strcasecmp_embedded_null() {
%1 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
size_t randgen(int);
char rand_letter(void) {
  return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[randgen(52)];
}


x86 assembly (clang, -O0):
<rand_letter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
call   1030 <randgen@plt>
mov    %rax,%rcx
lea    0xed8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_letter>:
push   %rax
mov    $0x34,%edi
call   1030 <randgen@plt>
lea    0xede(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\00"
define signext i8 @rand_letter() {
%1 = call i64 @randgen(i32 52)
%2 = getelementptr inbounds [53 x i8], [53 x i8]* @.str, i64 0, i64 %1
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
@.str = [53 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\00"
define signext i8 @rand_letter() {
%1 = tail call i64 @randgen(i32 52)
%2 = getelementptr inbounds [53 x i8], [53 x i8]* @.str, i64 0, i64 %1
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, size_t, int, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void print_variable(const char *var_ptr, size_t var_len) {
  fwrite(var_ptr, var_len, 1, stdout);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_variable>:
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    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_variable>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_variable(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @stdout
%8 = call i32 @fwrite(i8* %5, i64 %6, i32 1, i32 %7)
%9 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_variable(i8* %0, i64 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwrite(i8* %0, i64 %1, i32 1, i32 %3)
%5 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ do_cpuid(int /*<<< orphan*/, int /*<<< orphan*/ *);
uint32_t cpuid_ebx(uint32_t op) {
  uint32_t regs[4];
  do_cpuid(op, regs);
  return regs[1];
}


x86 assembly (clang, -O0):
<cpuid_ebx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <do_cpuid@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ebx>:
sub    $0x18,%rsp
mov    %rsp,%rsi
call   1030 <do_cpuid@plt>
mov    0x4(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_ebx(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @do_cpuid(i32 %4, i32* %5)
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @cpuid_ebx(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @do_cpuid(i32 %0, i32* %4)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
ret i32 %7
}
void rop3_116_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ *D;
  stk2 = S | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_116_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)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %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_116_1_0>:
mov    (%rdi),%al
xor    %al,%dl
or     %sil,%dl
xor    %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_116_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %4
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %4, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
#define SIGHUP 129
#define SIGINT 128
int /*<<< orphan*/ signal(int, void (*)(int));
int /*<<< orphan*/ system_quit();
void main_signalHandler(int signum) {
  signal(signum, main_signalHandler);
  switch (signum) {
  case SIGINT:
    system_quit();
    break;
  case SIGHUP:
    break;
  }
}


x86 assembly (clang, -O0):
<main_signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rsi
call   1030 <signal@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1163 <main_signalHandler+0x43>
jmp    1150 <main_signalHandler+0x30>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     116f <main_signalHandler+0x4f>
jmp    1174 <main_signalHandler+0x54>
mov    $0x0,%al
call   1040 <system_quit@plt>
jmp    1174 <main_signalHandler+0x54>
jmp    1174 <main_signalHandler+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_signalHandler>:
push   %rbx
mov    %edi,%ebx
mov    0x2eae(%rip),%rsi
call   1030 <signal@plt>
cmp    $0x80,%ebx
jne    113f <main_signalHandler+0x1f>
xor    %eax,%eax
pop    %rbx
jmp    1040 <system_quit@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @main_signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @signal(i32 %3, void (i32)* @main_signalHandler)
%5 = load i32, i32* %2
switch i32 %5, label %9 [
i32 128, label %6
i32 129, label %8
]
6: ; preds = %1
%7 = call i32 (...) @system_quit()
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %6
ret void
}

LLVM IR (-O2):
define void @main_signalHandler(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @main_signalHandler)
%3 = icmp eq i32 %0, 128
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @system_quit()
br label %6
6: ; preds = %1, %4
ret void
}
void *id2(void *v1, void *v2) { return v2; }


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

x86 assembly (clang, -O2):
<id2>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @id2(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ Handle(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char string[30];
  scanf("%s", string);
  Handle(string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <Handle@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    %rbx,%rdi
call   1040 <Handle@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @Handle(i8* %2)
ret i32 0
}
int board_with_gmac_eth(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @board_with_gmac_eth() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int i = 3;
  if (i * 1073741824u == 3221225472u) {
    printf("%u\n", i);
    assert(i == 3);
  }
  assert(i == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1e,%eax
cmp    $0xc0000000,%eax
jne    1167 <main+0x47>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1073741824
%5 = icmp eq i32 %4, -1073741824
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %13
13: ; preds = %6, %0
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 3
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}