xunge/DecIR huggingface dataset:
void f2(void) {
  int i = 0, j = 0;
#pragma omp task default(shared) if (0)
  {
#pragma omp simd collapse(2)
    for (i = 0; i < 10; i++)
      for (j = 0; j < 10; j++)
        ;
  }
  if (i != 10 || j != 10)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    116e <f2+0x5e>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115b <f2+0x4b>
jmp    114d <f2+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <f2+0x2e>
jmp    1160 <f2+0x50>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <f2+0x1d>
cmpl   $0xa,-0x4(%rbp)
jne    1182 <f2+0x72>
cmpl   $0xa,-0x8(%rbp)
je     1187 <f2+0x77>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IrqInterruptEnable();
int /*<<< orphan*/ LedInit();
int /*<<< orphan*/ SysCtlClockSet(int);
int /*<<< orphan*/ TimeInit();
void Init(void) {
  SysCtlClockSet(0x01C00000 | 0x00000000 | 0x00000000 | 0x00000380);
  LedInit();
  TimeInit();
  IrqInterruptEnable();
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c00380,%edi
call   1030 <SysCtlClockSet@plt>
mov    $0x0,%al
call   1050 <LedInit@plt>
mov    $0x0,%al
call   1040 <TimeInit@plt>
mov    $0x0,%al
call   1060 <IrqInterruptEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
push   %rax
mov    $0x1c00380,%edi
call   1030 <SysCtlClockSet@plt>
xor    %eax,%eax
call   1050 <LedInit@plt>
xor    %eax,%eax
call   1040 <TimeInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <IrqInterruptEnable@plt>

LLVM IR (-O0):
define void @Init() {
%1 = call i32 @SysCtlClockSet(i32 29361024)
%2 = call i32 (...) @LedInit()
%3 = call i32 (...) @TimeInit()
%4 = call i32 (...) @IrqInterruptEnable()
ret void
}

LLVM IR (-O2):
define void @Init() {
%1 = tail call i32 @SysCtlClockSet(i32 29361024)
%2 = tail call i32 (...) @LedInit()
%3 = tail call i32 (...) @TimeInit()
%4 = tail call i32 (...) @IrqInterruptEnable()
ret void
}
int main() {
  int *a = arrRead();
  quickSort(a, a + arrLen(a));
  arrPrint(a);
  free(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <arrRead@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1070 <arrLen@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdi
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x0,%al
call   1050 <quickSort@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <arrPrint@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <arrRead@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <arrLen@plt>
cltq
lea    (%rbx,%rax,4),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <quickSort@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <arrPrint@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 (...) @arrRead()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %2
%8 = load i32*, i32** %2
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @arrLen to i32 (i32*, ...)*)(i32* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
%12 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @quickSort to i32 (i32*, i32*, ...)*)(i32* %6, i32* %11)
%13 = load i32*, i32** %2
%14 = call i32 (i32*, ...) bitcast (i32 (...)* @arrPrint to i32 (i32*, ...)*)(i32* %13)
%15 = load i32*, i32** %2
%16 = bitcast i32* %15 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @arrRead()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @arrLen to i32 (i32*, ...)*)(i32* %3)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @quickSort to i32 (i32*, i32*, ...)*)(i32* %3, i32* %6)
%8 = tail call i32 (i32*, ...) bitcast (i32 (...)* @arrPrint to i32 (i32*, ...)*)(i32* %3)
%9 = inttoptr i64 %2 to i8*
tail call void @free(i8* %9)
ret i32 0
}
main() {
  typedef int int_t;
  goto int_t;
int_t:
  return 4;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
int sys_capset(tcp)
struct tcb *tcp;
{
  return printargs(tcp);
}


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_capset(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @printargs to i32 (%struct.tcb*, ...)*)(%struct.tcb* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_capset(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @printargs to i32 (%struct.tcb*, ...)*)(%struct.tcb* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_setresuid;
scalar_t__ syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int syscall_setresuid(uid_t ruid, uid_t euid, uid_t suid) {
  return (int)syscall(__NR_setresuid, ruid, euid, suid);
}


x86 assembly (clang, -O0):
<syscall_setresuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_setresuid>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_setresuid = global i32 0
define i32 @syscall_setresuid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_setresuid
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i64 @syscall(i32 %7, i32 %8, i32 %9, i32 %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__NR_setresuid = global i32 0
define i32 @syscall_setresuid(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @__NR_setresuid
%5 = tail call i64 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void rc_close_section(void) { return; }


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

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

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

LLVM IR (-O2):
define void @rc_close_section() {
ret void
}
void ff_hevc_put_hevc_epel_hv12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv12_10_sse4() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
void accept_membership_query(u_int32_t src, u_int32_t dst, u_int32_t group,
                             int tmo) {}


x86 assembly (clang, -O0):
<accept_membership_query>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @accept_membership_query(i32 %0, i32 %1, i32 %2, i32 %3) {
%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
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @accept_membership_query(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
int Cyc_CfFlowInfo_nprefix(int *n, void *unused) {
  int *_T0;
  int _T1;
  int *_T2;
  int *_T3;
  int _T4;
  _T0 = n;
  _T1 = *_T0;
  if (_T1 <= 0)
    goto _TL12A;
  _T2 = n;
  _T3 = n;
  _T4 = *_T3;
  *_T2 = _T4 - 1;
  return 1;
_TL12A:
  return 0;
}


x86 assembly (clang, -O0):
<Cyc_CfFlowInfo_nprefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jg     112c <Cyc_CfFlowInfo_nprefix+0x2c>
jmp    115d <Cyc_CfFlowInfo_nprefix+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1164 <Cyc_CfFlowInfo_nprefix+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_CfFlowInfo_nprefix>:
mov    (%rdi),%eax
test   %eax,%eax
jle    1111 <Cyc_CfFlowInfo_nprefix+0x11>
add    $0xffffffff,%eax
mov    %eax,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Cyc_CfFlowInfo_nprefix(i32* nocapture %0, i8* nocapture readnone %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = add nsw i32 %3, -1
store i32 %6, i32* %0
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
void HAC_BREAKPOINT(const char *msg, int c) {}


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

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

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

LLVM IR (-O2):
define void @HAC_BREAKPOINT(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ isprime(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int sum, n;
  sum = 0;
  for (n = 2; n < 10000; ++n) {
    if (isprime(n)) {
      sum += n;
    }
  }
  printf("Sum of primes less than 10000: %d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1178 <main+0x58>
mov    -0xc(%rbp),%edi
call   1040 <isprime@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    116a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x2,%ebp
jmp    113d <main+0x1d>
nopl   0x0(%rax)
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x2710,%ebp
je     1152 <main+0x32>
mov    %ebp,%edi
call   1040 <isprime@plt>
mov    $0x0,%ecx
test   %rax,%rax
je     1130 <main+0x10>
mov    %ebp,%ecx
jmp    1130 <main+0x10>
lea    0xea7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [35 x i8] c"Sum of primes less than 10000: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @isprime(i32 %2)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 0, i32 %2
%7 = add nuw nsw i32 %6, %3
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 10000
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNC_5() {
  long int stat = 99;
  BNCIO(5);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x5,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_5>:
push   %rax
mov    $0x5,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNC_5() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 5)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNC_5() {
%1 = tail call i32 @BNCIO(i32 5)
ret i64 99
}
int ti_wcprice_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_wcprice_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello, World!\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void syrk(void *args) {}


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

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

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

LLVM IR (-O2):
define void @syrk(i8* nocapture %0) {
ret void
}
int virtual_machine_object_environment_print(
    const struct virtual_machine_object *object) {
  (void)object;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.virtual_machine_object = type opaque
define i32 @virtual_machine_object_environment_print(%struct.virtual_machine_object* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __cvmx_spi4000_configure_mac(int);
int /*<<< orphan*/ __cvmx_spi4000_configure_phy(int);
int /*<<< orphan*/ cvmx_spi4000_is_present(int);
int cvmx_spi4000_initialize(int interface) {
  if (!cvmx_spi4000_is_present(interface))
    return -1;
  __cvmx_spi4000_configure_mac(interface);
  __cvmx_spi4000_configure_phy(interface);
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <cvmx_spi4000_is_present@plt>
cmp    $0x0,%eax
jne    1158 <cvmx_spi4000_initialize+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <cvmx_spi4000_initialize+0x3f>
mov    -0x8(%rbp),%edi
call   1030 <__cvmx_spi4000_configure_mac@plt>
mov    -0x8(%rbp),%edi
call   1050 <__cvmx_spi4000_configure_phy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
call   1040 <cvmx_spi4000_is_present@plt>
test   %eax,%eax
je     114e <cvmx_spi4000_initialize+0x1e>
mov    %ebx,%edi
call   1030 <__cvmx_spi4000_configure_mac@plt>
mov    %ebx,%edi
call   1050 <__cvmx_spi4000_configure_phy@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cvmx_spi4000_initialize(i32 %0) {
%2 = tail call i32 @cvmx_spi4000_is_present(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @__cvmx_spi4000_configure_mac(i32 %0)
%6 = tail call i32 @__cvmx_spi4000_configure_phy(i32 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ bad_things(int);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ pthread_setname_np(int /*<<< orphan*/, char const *);
void *child_fn_2(void *arg) {
  const char *threadname = "012345678901234";
  pthread_setname_np(pthread_self(), threadname);
  bad_things(4);
  return NULL;
}


x86 assembly (clang, -O0):
<child_fn_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_setname_np@plt>
mov    $0x4,%edi
call   1040 <bad_things@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_fn_2>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1030 <pthread_setname_np@plt>
mov    $0x4,%edi
call   1040 <bad_things@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"012345678901234\00"
define i8* @child_fn_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = call i32 (...) @pthread_self()
%5 = load i8*, i8** %3
%6 = call i32 @pthread_setname_np(i32 %4, i8* %5)
%7 = call i32 @bad_things(i32 4)
ret i8* null
}

LLVM IR (-O2):
@.str = [16 x i8] c"012345678901234\00"
define noalias i8* @child_fn_2(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_setname_np(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @bad_things(i32 4)
ret i8* null
}
void XShmGetEventBase() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void writeLeInt16(FILE *f, int v) {
  char c = v;
  fwrite(&c, 1, 1, f);
  v /= 256;
  c = v;
  fwrite(&c, 1, 1, f);
}


x86 assembly (clang, -O0):
<writeLeInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xd(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xd(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeLeInt16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movsbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
lea    0xff(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
shr    $0x8,%eax
movsbl %al,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @writeLeInt16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32*, i32** %3
%9 = call i32 @fwrite(i8* %5, i32 1, i32 1, i32* %8)
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 256
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = trunc i32 %12 to i8
store i8 %13, i8* %5
%14 = load i32*, i32** %3
%15 = call i32 @fwrite(i8* %5, i32 1, i32 1, i32* %14)
ret void
}

LLVM IR (-O2):
define void @writeLeInt16(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = tail call i32 @fputc(i32 %4, i32* %0)
%6 = sdiv i32 %1, 256
%7 = shl i32 %6, 24
%8 = ashr exact i32 %7, 24
%9 = tail call i32 @fputc(i32 %8, i32* %0)
ret void
}
main() { ((void (*__attribute((format(printf, 1, 2))))())0)(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x0,%al
call   *%rcx
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ cpuid(int, unsigned int *, unsigned int *, unsigned int *,
                         unsigned int *);
int chk_proc_mmx(void) {
  unsigned int eax, ebx, ecx, edx;
  cpuid(1, &eax, &ebx, &ecx, &edx);
  return edx & (1 << 23);
}


x86 assembly (clang, -O0):
<chk_proc_mmx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x10(%rbp),%eax
and    $0x800000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_proc_mmx>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x1,%edi
call   1030 <cpuid@plt>
mov    $0x800000,%eax
and    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @chk_proc_mmx() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %4
%7 = and i32 %6, 8388608
ret i32 %7
}

LLVM IR (-O2):
define i32 @chk_proc_mmx() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %4
%11 = and i32 %10, 8388608
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void macscp3_1() { puts("macscp3_1"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"macscp3_1\00"
define void @macscp3_1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct termios {
  int c_cflag;
};
typedef int speed_t;

/* Variables and functions */
int CBAUD;
int CBAUDEX;
speed_t cf2getispeed(struct termios *tios) {
  return (tios->c_cflag >> 16) & (CBAUD | CBAUDEX);
}


x86 assembly (clang, -O0):
<cf2getispeed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x10,%eax
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2ebf(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf2getispeed>:
movswl 0x2(%rdi),%ecx
mov    0x2ec5(%rip),%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
or     (%rdx),%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@CBAUD = global i32 0
@CBAUDEX = global i32 0
define i32 @cf2getispeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = ashr i32 %5, 16
%7 = load i32, i32* @CBAUD
%8 = load i32, i32* @CBAUDEX
%9 = or i32 %7, %8
%10 = and i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@CBAUD = global i32 0
@CBAUDEX = global i32 0
define i32 @cf2getispeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* @CBAUD
%6 = load i32, i32* @CBAUDEX
%7 = or i32 %6, %5
%8 = and i32 %7, %4
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void __attribute__((unused)) atomic_add(uint32_t *mem, int val) { *mem += val; }


x86 assembly (clang, -O0):
<atomic_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add>:
add    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @atomic_add(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 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @atomic_add(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int usart_messages_waiting(int /*<<< orphan*/);
int usart_stdio_msgwaiting(void) { return usart_messages_waiting(0); }


x86 assembly (clang, -O0):
<usart_stdio_msgwaiting>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <usart_messages_waiting@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_stdio_msgwaiting>:
xor    %edi,%edi
jmp    1030 <usart_messages_waiting@plt>

LLVM IR (-O0):
define i32 @usart_stdio_msgwaiting() {
%1 = call i32 @usart_messages_waiting(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @usart_stdio_msgwaiting() {
%1 = tail call i32 @usart_messages_waiting(i32 0)
ret i32 %1
}
/* Variables and functions */
int first_character(char *);
int /*<<< orphan*/ led_write(int);
void entry(void) {
  led_write(0b0111);
  char *derp = "CDEFAB";
  led_write(first_character(derp));
  while (1)
    ;
}


x86 assembly (clang, -O0):
<entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1040 <led_write@plt>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <first_character@plt>
mov    %eax,%edi
call   1040 <led_write@plt>
jmp    114d <entry+0x2d>

x86 assembly (clang, -O2):
<entry>:
push   %rax
mov    $0x7,%edi
call   1040 <led_write@plt>
lea    0xece(%rip),%rdi
call   1030 <first_character@plt>
mov    %eax,%edi
call   1040 <led_write@plt>
xchg   %ax,%ax
jmp    1140 <entry+0x20>

LLVM IR (-O0):
@.str = [7 x i8] c"CDEFAB\00"
define void @entry() {
%1 = alloca i8*
%2 = call i32 @led_write(i32 7)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @first_character(i8* %3)
%5 = call i32 @led_write(i32 %4)
br label %6
6: ; preds = %0, %6
br label %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"CDEFAB\00"
define void @entry() {
%1 = tail call i32 @led_write(i32 7)
%2 = tail call i32 @first_character(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @led_write(i32 %2)
br label %4
4: ; preds = %4, %0
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ reuse_out_of_mem();
char *strdup(char const *);
char *xstrdup(char const *str) {
  char *ptr;
  if (str == NULL)
    str = "";
  ptr = strdup(str);
  if (ptr == NULL)
    reuse_out_of_mem();
  return ptr;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <xstrdup+0x22>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <xstrdup+0x41>
mov    $0x0,%al
call   1030 <reuse_out_of_mem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
test   %rdi,%rdi
lea    0xed5(%rip),%rax
cmove  %rax,%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xstrdup+0x23>
xor    %eax,%eax
call   1030 <reuse_out_of_mem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %1
%8 = load i8*, i8** %2
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 (...) @reuse_out_of_mem()
br label %14
14: ; preds = %12, %7
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i8* @strdup(i8* %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @reuse_out_of_mem()
br label %8
8: ; preds = %6, %1
ret i8* %4
}
int wiringPiSetupGpio() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wiringPiSetupGpio() {
ret i32 0
}
/* Variables and functions */
scalar_t__ rapl_pkg_available();
scalar_t__ rapl_pp0_available();
scalar_t__ rapl_pp1_available();
char rapl_uncore_available() {
  return rapl_pkg_available() && rapl_pp0_available() && rapl_pp1_available();
}


x86 assembly (clang, -O0):
<rapl_uncore_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rapl_pkg_available@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     117b <rapl_uncore_available+0x4b>
mov    $0x0,%al
call   1030 <rapl_pp0_available@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     117b <rapl_uncore_available+0x4b>
mov    $0x0,%al
call   1050 <rapl_pp1_available@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_uncore_available>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <rapl_pkg_available@plt>
test   %rax,%rax
je     115a <rapl_uncore_available+0x2a>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <rapl_pp0_available@plt>
test   %rax,%rax
je     115a <rapl_uncore_available+0x2a>
xor    %eax,%eax
call   1050 <rapl_pp1_available@plt>
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @rapl_uncore_available() {
%1 = call i64 (...) @rapl_pkg_available()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i64 (...) @rapl_pp0_available()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i64 (...) @rapl_pp1_available()
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @rapl_uncore_available() {
%1 = tail call i64 (...) @rapl_pkg_available()
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 (...) @rapl_pp0_available()
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 (...) @rapl_pp1_available()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %6, %3, %0
%11 = phi i8 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ cm_accent_generic(int, int, int, char *, char,
                                     int /*<<< orphan*/, char *);
void cm_accent_hat(int arg, int start, int end) {
  cm_accent_generic(arg, start, end, "AEIOUaeiou", '^', 0, "circ");
}


x86 assembly (clang, -O0):
<cm_accent_hat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xecf(%rip),%rcx
mov    $0x5e,%r8d
xor    %r9d,%r9d
lea    0xeca(%rip),%rax
mov    %rax,(%rsp)
call   1030 <cm_accent_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_accent_hat>:
push   %rax
lea    0xef3(%rip),%rax
mov    %rax,(%rsp)
lea    0xedd(%rip),%rcx
mov    $0x5e,%r8d
xor    %r9d,%r9d
call   1030 <cm_accent_generic@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"AEIOUaeiou\00"
@.str.1 = [5 x i8] c"circ\00"
define void @cm_accent_hat(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @cm_accent_generic(i32 %7, i32 %8, i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext 94, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"AEIOUaeiou\00"
@.str.1 = [5 x i8] c"circ\00"
define void @cm_accent_hat(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @cm_accent_generic(i32 %0, i32 %1, i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext 94, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void open() {}


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

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

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

LLVM IR (-O2):
define void @open() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int unknown_uint();
void muliply_two_Bad() {
  uint64_t x = unknown_uint();
  uint64_t y = x * 2;
}


x86 assembly (clang, -O0):
<muliply_two_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_uint@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @muliply_two_Bad() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @unknown_uint()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, 2
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
define void @muliply_two_Bad() {
%1 = tail call i32 (...) @unknown_uint()
ret void
}
int is_whitespace(char ch) {
  return (ch == ' ') || (ch == '\t') || (ch == '\r') || (ch == '\n');
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
ja     1120 <is_whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <is_whitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void processNormalKeys(unsigned char key, int xx, int yy) {
  if (key == 27)
    exit(0);
}


x86 assembly (clang, -O0):
<processNormalKeys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    1138 <processNormalKeys+0x28>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processNormalKeys>:
cmp    $0x1b,%dil
je     1117 <processNormalKeys+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @processNormalKeys(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @processNormalKeys(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ w5100_writeSn_byte(unsigned int, int, unsigned int);
void w5100_writeSnTOS(unsigned sock, unsigned data) {
  w5100_writeSn_byte(sock, 0x0015, data);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x15,%esi
call   1030 <w5100_writeSn_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edx
mov    $0x15,%esi
jmp    1030 <w5100_writeSn_byte@plt>

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

LLVM IR (-O2):
define void @w5100_writeSnTOS(i32 %0, i32 %1) {
%3 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 21, i32 %1)
ret void
}
void I2CFIFOClear(unsigned int baseAdd, unsigned int flag) {
  if (1 == flag) {
    (*((volatile unsigned int *)(baseAdd + (0x94)))) |= ((0x00000040u));
  } else {
    (*((volatile unsigned int *)(baseAdd + (0x94)))) |= ((0x00004000u));
  }
}


x86 assembly (clang, -O0):
<I2CFIFOClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    112e <I2CFIFOClear+0x2e>
mov    -0x4(%rbp),%eax
add    $0x94,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x40,%ecx
mov    %ecx,(%rax)
jmp    1142 <I2CFIFOClear+0x42>
mov    -0x4(%rbp),%eax
add    $0x94,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x4000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CFIFOClear>:
add    $0x94,%edi
cmp    $0x1,%esi
mov    $0x40,%eax
mov    $0x4000,%ecx
cmove  %eax,%ecx
or     %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @I2CFIFOClear(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 = icmp eq i32 1, %5
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add i32 %8, 148
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, 64
store volatile i32 %13, i32* %11
br label %21
14: ; preds = %2
%15 = load i32, i32* %3
%16 = add i32 %15, 148
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = or i32 %19, 16384
store volatile i32 %20, i32* %18
br label %21
21: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
define void @I2CFIFOClear(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = add i32 %0, 148
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = select i1 %3, i32 64, i32 16384
%9 = or i32 %7, %8
store volatile i32 %9, i32* %6
ret void
}
int I_SetupPlatformQuit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_SetupPlatformQuit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double U = ((double)10586 / (double)16119) + ((double)37190 / (double)108363);
  printf("x = %f\n", U);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"x = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0x3FEFFF7FB07C72DB, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"x = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x3FEFFF7FB07C72DB)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ zeroize(unsigned char *, int);
void zeroize_stack() {
  unsigned char m[1024];
  zeroize(m, 1024);
}


x86 assembly (clang, -O0):
<zeroize_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1030 <zeroize@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroize_stack>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1030 <zeroize@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
define void @zeroize_stack() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @zeroize(i8* %2, i32 1024)
ret void
}

LLVM IR (-O2):
define void @zeroize_stack() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @zeroize(i8* %2, i32 1024)
ret void
}