xunge/DecIR huggingface dataset:
/* Variables and functions */
int getach();
int getrq(void) {
  int i, j;
  if ((i = getach()) == 0 || (j = getach()) == 0)
    goto rtn;
  i = (i | (j << 16));
rtn:
  return (i);
}


x86 assembly (clang, -O0):
<getrq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getach@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <getrq+0x2e>
mov    $0x0,%al
call   1030 <getach@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    1143 <getrq+0x33>
jmp    1151 <getrq+0x41>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrq>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getach@plt>
test   %eax,%eax
je     1138 <getrq+0x28>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getach@plt>
test   %eax,%eax
je     1136 <getrq+0x26>
mov    %eax,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
jmp    1138 <getrq+0x28>
mov    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getrq() {
%1 = tail call i32 (...) @getach()
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @getach()
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = shl i32 %4, 16
%8 = or i32 %7, %1
br label %9
9: ; preds = %0, %3, %6
%10 = phi i32 [ 0, %0 ], [ %1, %3 ], [ %8, %6 ]
ret i32 %10
}
/* Variables and functions */
float INFINITY;
int log10(float);
float to_dB(float v) {
  if (v > 0) {
    return 20 * log10(v);
  }
  return -INFINITY;
}


x86 assembly (clang, -O0):
<to_dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1149 <to_dB+0x39>
movss  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
imul   $0x14,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1166 <to_dB+0x56>
mov    0x2e98(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_dB>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    112d <to_dB+0x1d>
call   1030 <log10@plt>
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret
mov    0x2eb4(%rip),%rax
movss  (%rax),%xmm0
xorps  0xec1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@INFINITY = global float 0.000000e+00
define float @to_dB(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %3
%8 = call i32 @log10(float %7)
%9 = mul nsw i32 20, %8
%10 = sitofp i32 %9 to float
store float %10, float* %2
br label %14
11: ; preds = %1
%12 = load float, float* @INFINITY
%13 = fneg float %12
store float %13, float* %2
br label %14
14: ; preds = %11, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
@INFINITY = global float 0.000000e+00
define float @to_dB(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @log10(float %0)
%5 = mul nsw i32 %4, 20
%6 = sitofp i32 %5 to float
br label %10
7: ; preds = %1
%8 = load float, float* @INFINITY
%9 = fneg float %8
br label %10
10: ; preds = %7, %3
%11 = phi float [ %6, %3 ], [ %9, %7 ]
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ netreceive_setup();
int /*<<< orphan*/ netsend_setup();
void x_net_setup(void) {
  netsend_setup();
  netreceive_setup();
}


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

x86 assembly (clang, -O2):
<x_net_setup>:
push   %rax
xor    %eax,%eax
call   1040 <netsend_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <netreceive_setup@plt>

LLVM IR (-O0):
define void @x_net_setup() {
%1 = call i32 (...) @netsend_setup()
%2 = call i32 (...) @netreceive_setup()
ret void
}

LLVM IR (-O2):
define void @x_net_setup() {
%1 = tail call i32 (...) @netsend_setup()
%2 = tail call i32 (...) @netreceive_setup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, int);
void poweroff(void) { outw(0xB004, 0x0 | 0x2000); }


x86 assembly (clang, -O0):
<poweroff>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb004,%edi
mov    $0x2000,%esi
call   1030 <outw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<poweroff>:
mov    $0xb004,%edi
mov    $0x2000,%esi
jmp    1030 <outw@plt>

LLVM IR (-O0):
define void @poweroff() {
%1 = call i32 @outw(i32 45060, i32 8192)
ret void
}

LLVM IR (-O2):
define void @poweroff() {
%1 = tail call i32 @outw(i32 45060, i32 8192)
ret void
}
void upcrt_thread_init(void) {}


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

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

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

LLVM IR (-O2):
define void @upcrt_thread_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int result;
  srand((unsigned int)time(NULL));
  result = (rand() % 6) + 1;
  printf("Die rolled: %d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Die rolled: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Die rolled: %d\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, int);
void __draw_h_line(void *start, int length) { memset(start, 128, length); }


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

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

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

LLVM IR (-O2):
define void @__draw_h_line(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 128, i32 %1)
ret void
}
int test_imm_BCuint32_mem(unsigned int *val) {
  return ((*val) & (0xBC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BCuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xbc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BCuint32_mem>:
testb  $0xbc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BCuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 188
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_BCuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 188
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HoTTSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HoTTSettingsRequestUpdate() { UAVObjRequestUpdate(HoTTSettingsHandle()); }


x86 assembly (clang, -O0):
<HoTTSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HoTTSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HoTTSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <HoTTSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @HoTTSettingsRequestUpdate() {
%1 = call i32 (...) @HoTTSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HoTTSettingsRequestUpdate() {
%1 = tail call i32 (...) @HoTTSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
unsigned ROR(unsigned word, int i) {
  asm("rorl %%cl,%0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


x86 assembly (clang, -O0):
<ROR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
ror    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROR>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ROR(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 asm "rorl %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ROR(i32 %0, i32 %1) {
%3 = tail call i32 asm "rorl %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *findtab(char *, int);
void getfield(char *p, char **pp, char **qq, int field) {
  *pp = findtab(p, field - 1);
  *qq = findtab(*pp, field);
}


x86 assembly (clang, -O0):
<getfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
sub    $0x1,%esi
call   1030 <findtab@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <findtab@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfield>:
push   %r15
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
lea    -0x1(%rbx),%esi
call   1030 <findtab@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <findtab@plt>
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @getfield(i8* %0, i8** %1, i8** %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %8
%11 = sub nsw i32 %10, 1
%12 = call i8* @findtab(i8* %9, i32 %11)
%13 = load i8**, i8*** %6
store i8* %12, i8** %13
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i32, i32* %8
%17 = call i8* @findtab(i8* %15, i32 %16)
%18 = load i8**, i8*** %7
store i8* %17, i8** %18
ret void
}

LLVM IR (-O2):
define void @getfield(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i32 %3) {
%5 = add nsw i32 %3, -1
%6 = tail call i8* @findtab(i8* %0, i32 %5)
store i8* %6, i8** %1
%7 = tail call i8* @findtab(i8* %6, i32 %3)
store i8* %7, i8** %2
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_new_method_errnof(void *call, void **m, int error,
                                 const char *format, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_new_method_errnof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_new_method_errnof(i8* %0, i8** %1, i32 %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_new_method_errnof(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2, i8* nocapture readnone %3, ...) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
int is_c_white(char grey) {
  if (grey != '-' && grey != '+' &&
      (grey == ' ' || grey == '\t' || grey == '\r' || grey == '\n' ||
       grey == '\v' || grey == '\f'))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_c_white>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     117e <is_c_white+0x7e>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     117e <is_c_white+0x7e>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1172 <is_c_white+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1172 <is_c_white+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     1172 <is_c_white+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1172 <is_c_white+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
je     1172 <is_c_white+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0xc,%eax
jne    117e <is_c_white+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <is_c_white+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_c_white>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <is_c_white+0xe>
ret
cmp    $0x20,%dil
je     110d <is_c_white+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_c_white(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 45
br i1 %6, label %7, label %36
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 43
br i1 %10, label %11, label %36
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 32
br i1 %14, label %35, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 9
br i1 %18, label %35, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 13
br i1 %22, label %35, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 10
br i1 %26, label %35, label %27
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 11
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 12
br i1 %34, label %35, label %36
35: ; preds = %31, %27, %23, %19, %15, %11
store i32 1, i32* %2
br label %37
36: ; preds = %31, %7, %1
store i32 0, i32* %2
br label %37
37: ; preds = %36, %35
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @is_c_white(i8 signext %0) {
switch i8 %0, label %2 [
i8 9, label %3
i8 10, label %3
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __dorand48(unsigned short *);
long jrand48(unsigned short xseed[3]) {
  __dorand48(xseed);
  return ((long)xseed[2] << 16) + (long)xseed[1];
}


x86 assembly (clang, -O0):
<jrand48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__dorand48@plt>
mov    -0x8(%rbp),%rax
movzwl 0x4(%rax),%eax
shl    $0x10,%rax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jrand48>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__dorand48@plt>
mov    0x2(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @jrand48(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i32 @__dorand48(i16* %3)
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 2
%7 = load i16, i16* %6
%8 = zext i16 %7 to i64
%9 = shl i64 %8, 16
%10 = load i16*, i16** %2
%11 = getelementptr inbounds i16, i16* %10, i64 1
%12 = load i16, i16* %11
%13 = zext i16 %12 to i64
%14 = add nsw i64 %9, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @jrand48(i16* %0) {
%2 = tail call i32 @__dorand48(i16* %0)
%3 = getelementptr inbounds i16, i16* %0, i64 2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i64
%6 = shl nuw nsw i64 %5, 16
%7 = getelementptr inbounds i16, i16* %0, i64 1
%8 = load i16, i16* %7
%9 = zext i16 %8 to i64
%10 = or i64 %6, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void shutdownThread(void) { __coverity_panic__(); }


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

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

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

LLVM IR (-O2):
define void @shutdownThread() {
%1 = tail call i32 (...) @__coverity_panic__()
ret void
}
long long bit28() { return 0x0000000010000000LL; }


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

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

LLVM IR (-O0):
define i64 @bit28() {
ret i64 268435456
}

LLVM IR (-O2):
define i64 @bit28() {
ret i64 268435456
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t a52e_get_strmtyp(const uint8_t *p_a52) {
  return (p_a52[2] & 0xc0) >> 5;
}


x86 assembly (clang, -O0):
<a52e_get_strmtyp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0xc0,%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_get_strmtyp>:
mov    0x8(%rdi),%eax
shr    $0x5,%eax
and    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @a52e_get_strmtyp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = ashr i32 %6, 5
ret i32 %7
}

LLVM IR (-O2):
define i32 @a52e_get_strmtyp(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 6
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, char const *, char const *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  const char *p = getprogname();
  (void)fprintf(stderr,
                "Usage: %s system_var\n\t%s -a\n"
                "\t%s path_var pathname\n\t%s -a pathname\n",
                p, p, p, p);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb8(%rip),%rsi
mov    %rax,%rdx
mov    %rax,%rcx
mov    %rax,%r8
mov    %rax,%r9
call   1040 <fprintf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: %s system_var\0A\09%s -a\0A\09%s path_var pathname\0A\09%s -a pathname\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = alloca i8*
%2 = call i8* (...) @getprogname()
store i8* %2, i8** %1
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: %s system_var\0A\09%s -a\0A\09%s path_var pathname\0A\09%s -a pathname\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = tail call i8* (...) @getprogname()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %1, i8* %1, i8* %1)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int day_of_year(int, int, int);
int /*<<< orphan*/ month_day(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int month, day, yearday;
  yearday = day_of_year(2014, 3, 25);
  printf("%d\n", yearday);
  month_day(2014, yearday, &month, &day);
  printf("%d %d\n", month, day);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7de,%edi
mov    $0x3,%esi
mov    $0x19,%edx
call   1050 <day_of_year@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%esi
mov    $0x7de,%edi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <month_day@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x7de,%edi
mov    $0x3,%esi
mov    $0x19,%edx
call   1050 <day_of_year@plt>
mov    %eax,%ebx
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0x7de,%edi
mov    %ebx,%esi
call   1030 <month_day@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @day_of_year(i32 2014, i32 3, i32 25)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @month_day(i32 2014, i32 %8, i32* %2, i32* %3)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @day_of_year(i32 2014, i32 3, i32 25)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @month_day(i32 2014, i32 %5, i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ halt(char *, char *);
int /*<<< orphan*/ tt_error_txt(char *, int);
void checkTT(int ret, char *msg) {
  if (ret < 0) {
    char tmp[10240];
    tt_error_txt(tmp, ret);
    halt(msg, tmp);
  }
}


x86 assembly (clang, -O0):
<checkTT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2810,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115b <checkTT+0x3b>
lea    -0x2810(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <tt_error_txt@plt>
mov    -0x10(%rbp),%rdi
lea    -0x2810(%rbp),%rsi
call   1040 <halt@plt>
add    $0x2810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkTT>:
test   %edi,%edi
js     1125 <checkTT+0x5>
ret
push   %r14
push   %rbx
sub    $0x2808,%rsp
mov    %rsi,%rbx
mov    %edi,%esi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <tt_error_txt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <halt@plt>
add    $0x2808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @checkTT(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [10240 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = getelementptr inbounds [10240 x i8], [10240 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @tt_error_txt(i8* %9, i32 %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [10240 x i8], [10240 x i8]* %5, i64 0, i64 0
%14 = call i32 @halt(i8* %12, i8* %13)
br label %15
15: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @checkTT(i32 %0, i8* %1) {
%3 = alloca [10240 x i8]
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds [10240 x i8], [10240 x i8]* %3, i64 0, i64 0
%7 = call i32 @tt_error_txt(i8* %6, i32 %0)
%8 = call i32 @halt(i8* %1, i8* %6)
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_46547();
int /*<<< orphan*/ test_lsb_everyotherbit();
int /*<<< orphan*/ test_msb_everyotherbit();
int /*<<< orphan*/ test_ones();
int /*<<< orphan*/ test_zeroes();
int main() {
  test_zeroes();
  test_ones();
  test_msb_everyotherbit();
  test_lsb_everyotherbit();
  test_46547();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_zeroes@plt>
mov    $0x0,%al
call   1040 <test_ones@plt>
mov    $0x0,%al
call   1030 <test_msb_everyotherbit@plt>
mov    $0x0,%al
call   1050 <test_lsb_everyotherbit@plt>
mov    $0x0,%al
call   1070 <test_46547@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_zeroes@plt>
xor    %eax,%eax
call   1040 <test_ones@plt>
xor    %eax,%eax
call   1030 <test_msb_everyotherbit@plt>
xor    %eax,%eax
call   1050 <test_lsb_everyotherbit@plt>
xor    %eax,%eax
call   1070 <test_46547@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_zeroes()
%3 = call i32 (...) @test_ones()
%4 = call i32 (...) @test_msb_everyotherbit()
%5 = call i32 (...) @test_lsb_everyotherbit()
%6 = call i32 (...) @test_46547()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_zeroes()
%2 = tail call i32 (...) @test_ones()
%3 = tail call i32 (...) @test_msb_everyotherbit()
%4 = tail call i32 (...) @test_lsb_everyotherbit()
%5 = tail call i32 (...) @test_46547()
ret i32 0
}
/* Variables and functions */
int __builtin_mips_cabs_f_d(double, double);
int test0(double a, double b) { return __builtin_mips_cabs_f_d(a, b); }


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

x86 assembly (clang, -O2):
<test0>:
jmp    1030 <__builtin_mips_cabs_f_d@plt>

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

LLVM IR (-O2):
define i32 @test0(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_f_d(double %0, double %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ mbrtowc__(int /*<<< orphan*/ *, char const *, size_t,
                     int /*<<< orphan*/ *);
int mbtowc__(wchar_t *pwc, const char *s, size_t n) {
  return (int)mbrtowc__(pwc, s, n, NULL);
}


x86 assembly (clang, -O0):
<mbtowc__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <mbrtowc__@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbtowc__>:
xor    %ecx,%ecx
jmp    1030 <mbrtowc__@plt>

LLVM IR (-O0):
define i32 @mbtowc__(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @mbrtowc__(i32* %7, i8* %8, i64 %9, i32* null)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @mbtowc__(i32* %0, i8* %1, i64 %2) {
%4 = tail call i64 @mbrtowc__(i32* %0, i8* %1, i64 %2, i32* null)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateRTCTrimSet(unsigned long ulTrim) {
  ;
  (*((volatile unsigned long *)(0x400FC024))) = ulTrim;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCTrimSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc024,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCTrimSet>:
mov    %rdi,0x400fc024
40
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCTrimSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074774052 to i64*)
%4 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCTrimSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074774052 to i64*)
%2 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
int ThirdMonday(int monthStartDOW) {
  if (monthStartDOW == 0) {
    return 16;
  } else if (monthStartDOW == 1) {
    return 15;
  } else {
    return ((7 - monthStartDOW) + 16);
  }
}


x86 assembly (clang, -O0):
<ThirdMonday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ThirdMonday+0x1d>
movl   $0x10,-0x4(%rbp)
jmp    1141 <ThirdMonday+0x41>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <ThirdMonday+0x33>
movl   $0xf,-0x4(%rbp)
jmp    1141 <ThirdMonday+0x41>
mov    $0x7,%eax
sub    -0x8(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThirdMonday>:
test   %edi,%edi
je     110f <ThirdMonday+0xf>
cmp    $0x1,%edi
jne    1115 <ThirdMonday+0x15>
mov    $0xf,%eax
ret
mov    $0x10,%eax
ret
mov    $0x17,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ThirdMonday(i32 %0) {
switch i32 %0, label %3 [
i32 0, label %5
i32 1, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = sub i32 23, %0
br label %5
5: ; preds = %1, %3, %2
%6 = phi i32 [ 15, %2 ], [ %4, %3 ], [ 16, %1 ]
ret i32 %6
}
void add_to_index(long int *index, long int elem) {
  register long i;
  for (i = 0; index[i] != -1; i++)
    ;
  index[i] = elem;
  index[i + 1] = -1;
}


x86 assembly (clang, -O0):
<add_to_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpq   $0xffffffffffffffff,(%rax,%rcx,8)
je     113d <add_to_index+0x3d>
jmp    112c <add_to_index+0x2c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <add_to_index+0x14>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0xffffffffffffffff,0x8(%rax,%rcx,8)
ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_to_index>:
cmpq   $0xffffffffffffffff,(%rdi)
lea    0x8(%rdi),%rdi
jne    1100 <add_to_index>
mov    %rsi,-0x8(%rdi)
movq   $0xffffffffffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @add_to_index(i64* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %8, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, -1
%8 = add nuw nsw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = getelementptr inbounds i64, i64* %0, i64 %4
store i64 %1, i64* %10
%11 = getelementptr inbounds i64, i64* %0, i64 %8
store i64 -1, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void perror_and_exit(char *str, int exit_code) {
  perror(str);
  exit(exit_code);
}


x86 assembly (clang, -O0):
<perror_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_and_exit>:
push   %rbx
mov    %esi,%ebx
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perror_and_exit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @perror_and_exit(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Derived_copy(void *this, void *other) {
  printf("Derived"
         "::copy()\n");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Derived::copy()\0A\00"
define void @Derived_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Derived::copy()\00"
define void @Derived_copy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) long double roundl(long double x) { return x; }


x86 assembly (clang, -O0):
<roundl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundl>:
fldt   0x8(%rsp)
ret

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

LLVM IR (-O2):
define x86_fp80 @roundl(x86_fp80 returned %0) {
ret x86_fp80 %0
}
int DynamicObjectSize2(void *const p
                       __attribute__((pass_dynamic_object_size(2)))) {
  return __builtin_object_size(p, 2);
}


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

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

LLVM IR (-O0):
define i32 @DynamicObjectSize2(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 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @DynamicObjectSize2(i8* nocapture readnone %0, i64 %1) {
%3 = trunc i64 %1 to i32
ret i32 %3
}
/* Variables and functions */
float fwrap(int);
float fwrap2(float x) { return fwrap(fwrap(x) + 1); }


x86 assembly (clang, -O0):
<fwrap2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%edi
call   1030 <fwrap@plt>
movss  0xed1(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <fwrap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrap2>:
push   %rax
cvttss2si %xmm0,%edi
call   1030 <fwrap@plt>
addss  0xede(%rip),%xmm0
cvttss2si %xmm0,%edi
pop    %rax
jmp    1030 <fwrap@plt>

LLVM IR (-O0):
define float @fwrap2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = call float @fwrap(i32 %4)
%6 = fadd float %5, 1.000000e+00
%7 = fptosi float %6 to i32
%8 = call float @fwrap(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @fwrap2(float %0) {
%2 = fptosi float %0 to i32
%3 = tail call float @fwrap(i32 %2)
%4 = fadd float %3, 1.000000e+00
%5 = fptosi float %4 to i32
%6 = tail call float @fwrap(i32 %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: predict [options] test_file model_file output_file\n"
         "options:\n"
         "-q : quiet mode (no outputs)\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [97 x i8] c"Usage: predict [options] test_file model_file output_file\0Aoptions:\0A-q : quiet mode (no outputs)\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [96 x i8] c"Usage: predict [options] test_file model_file output_file\0Aoptions:\0A-q : quiet mode (no outputs)\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void f(int vla[2][g()]) {}


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

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

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @g()
%4 = zext i32 %3 to i64
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @g()
ret void
}
int PyDTrace_INSTANCE_NEW_START_ENABLED(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PyDTrace_INSTANCE_NEW_START_ENABLED() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void s2cM(uint16_t s, uint8_t *c) {
  memcpy(c, &s, sizeof(uint16_t));
  return;
}


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

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

LLVM IR (-O0):
define void @s2cM(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 = call i32 @memcpy(i32* %5, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @s2cM(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @memcpy(i32* %1, i32* %3, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int mknod(const char *path, mode_t mode, dev_t dev) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<mknod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mknod>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @mknod(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @EACCES
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @mknod(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EACCES
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
struct fileinfo_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_new();
struct fileinfo_list *fileinfo_list_new(void) {
  return (struct fileinfo_list *)genlist_new();
}


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

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

LLVM IR (-O0):
%struct.fileinfo_list = type { i32 }
define %struct.fileinfo_list* @fileinfo_list_new() {
%1 = call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.fileinfo_list*
ret %struct.fileinfo_list* %2
}

LLVM IR (-O2):
%struct.fileinfo_list = type { i32 }
define %struct.fileinfo_list* @fileinfo_list_new() {
%1 = tail call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.fileinfo_list*
ret %struct.fileinfo_list* %2
}
void DischargeDelay_Stop(void) {}


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

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

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

LLVM IR (-O2):
define void @DischargeDelay_Stop() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void pjf_timenow(struct timeval *tv) {
  if (gettimeofday(tv, NULL) == 0)
    return;
  tv->tv_sec = 0;
  tv->tv_usec = 0;
}


x86 assembly (clang, -O0):
<pjf_timenow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jne    1138 <pjf_timenow+0x28>
jmp    114f <pjf_timenow+0x3f>
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pjf_timenow>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     1126 <pjf_timenow+0x16>
xorps  %xmm0,%xmm0
movups %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @pjf_timenow(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
store i64 0, i64* %9
%10 = load %struct.timeval*, %struct.timeval** %2
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
store i64 0, i64* %11
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @pjf_timenow(%struct.timeval* nocapture %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = bitcast %struct.timeval* %0 to i8*
br label %6
6: ; preds = %1, %4
ret void
}
int I2c_CustomInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I2c_CustomInit() {
ret i32 0
}