xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ lsddb_disablePlugin(int);
int lsddb_purgePlugin(int pluginId) {
  lsddb_disablePlugin(pluginId);
  return 0;
}


x86 assembly (clang, -O0):
<lsddb_purgePlugin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lsddb_disablePlugin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsddb_purgePlugin>:
push   %rax
call   1030 <lsddb_disablePlugin@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lsddb_purgePlugin(i32 %0) {
%2 = tail call i32 @lsddb_disablePlugin(i32 %0)
ret i32 0
}
getline() {}


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

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

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

LLVM IR (-O2):
define i32 @getline() {
ret i32 undef
}
short inw(short port) {
  short ret;
  __asm__ volatile("inw %1, %0" : "=a"(ret) : "dN"(port));
  return ret;
}


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

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

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

LLVM IR (-O2):
define signext i16 @inw(i16 signext %0) {
%2 = tail call i16 asm sideeffect "inw $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ UP3D_GetParameter(int);
int32_t UP3D_GetCheckPowerKey() { return UP3D_GetParameter(0x33); }


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

x86 assembly (clang, -O2):
<UP3D_GetCheckPowerKey>:
mov    $0x33,%edi
jmp    1030 <UP3D_GetParameter@plt>

LLVM IR (-O0):
define i32 @UP3D_GetCheckPowerKey() {
%1 = call i32 @UP3D_GetParameter(i32 51)
ret i32 %1
}

LLVM IR (-O2):
define i32 @UP3D_GetCheckPowerKey() {
%1 = tail call i32 @UP3D_GetParameter(i32 51)
ret i32 %1
}
int main() {
  unsigned int arg1 = 0x12345678;
  unsigned int arg2 = 0x87654321;
  unsigned int out1 = 0;
  unsigned int out2 = 0;
  __asm__("xchgl %%eax, %%ecx" : "=a"(out1), "=c"(out2) : "a"(arg1), "c"(arg2));
  return (out1 == 0x87654321) && (out2 == 0x12345678);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
movl   $0x87654321,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
xchg   %eax,%ecx
mov    %eax,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x87654321,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jne    1153 <main+0x53>
cmpl   $0x12345678,-0x14(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x12345678,%eax
mov    $0x87654321,%ecx
xchg   %eax,%ecx
xor    $0x87654321,%eax
xor    $0x12345678,%ecx
xor    %edx,%edx
or     %eax,%ecx
sete   %dl
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 305419896, i32* %2
store i32 -2023406815, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call { i32, i32 } asm "xchgl %eax, %ecx", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7)
%9 = extractvalue { i32, i32 } %8, 0
%10 = extractvalue { i32, i32 } %8, 1
store i32 %9, i32* %4
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, -2023406815
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 305419896
br label %16
16: ; preds = %13, %0
%17 = phi i1 [ false, %0 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i32, i32 } asm "xchgl %eax, %ecx", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -2023406815)
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = icmp eq i32 %2, -2023406815
%5 = icmp eq i32 %3, 305419896
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
unsigned short inw(int);
int /*<<< orphan*/ slow_down_io();
unsigned short inw_p(int port) {
  unsigned short value = inw(port);
  slow_down_io();
  return value;
}


x86 assembly (clang, -O0):
<inw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inw@plt>
mov    %ax,-0x6(%rbp)
mov    $0x0,%al
call   1040 <slow_down_io@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw_p>:
push   %rbx
call   1030 <inw@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @inw_p(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call zeroext i16 @inw(i32 %4)
store i16 %5, i16* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @inw_p(i32 %0) {
%2 = tail call zeroext i16 @inw(i32 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ someFunction(int *, int /*<<< orphan*/, int);
int main(int argc, char const *argv[]) {
  int a[10] = {8, 3, 1, 2, 6, 0, 9, 7, 4, 5};
  printf("Answer is:\n");
  someFunction(a, 0, 10);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <someFunction@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <someFunction@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 8, i32 3, i32 1, i32 2, i32 6, i32 0, i32 9, i32 7, i32 4, i32 5]
@.str = [12 x i8] c"Answer is:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [10 x i32]* %6 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%10 = call i32 @someFunction(i32* %9, i32 0, i32 10)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 8, i32 3, i32 1, i32 2, i32 6, i32 0, i32 9, i32 7, i32 4, i32 5]
@str = [11 x i8] c"Answer is:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%7 = call i32 @someFunction(i32* %6, i32 0, i32 10)
%8 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int PAPI_num_events(int);
void papif_num_events__(int *EventCode, int *count) {
  *count = PAPI_num_events(*EventCode);
}


x86 assembly (clang, -O0):
<papif_num_events__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_num_events@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_num_events__>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_num_events@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_num_events__(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_num_events(i32 %3)
store i32 %4, i32* %1
ret void
}
float calc_power_r(float volt, float resistance) {
  float effect;
  effect = (volt * volt) / resistance;
  return effect;
}


x86 assembly (clang, -O0):
<calc_power_r>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_power_r>:
mulss  %xmm0,%xmm0
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calc_power_r(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %4
%10 = fdiv float %8, %9
store float %10, float* %5
%11 = load float, float* %5
ret float %11
}

LLVM IR (-O2):
define float @calc_power_r(float %0, float %1) {
%3 = fmul float %0, %0
%4 = fdiv float %3, %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void displayMain() {
  printf("\nPlease enter an area of math that interests you:\n\n");
  printf("\tVectors in 2D [V]\n");
  printf("\tExit [X]\n");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"\0APlease enter an area of math that interests you:\0A\0A\00"
@.str.1 = [20 x i8] c"\09Vectors in 2D [V]\0A\00"
@.str.2 = [11 x i8] c"\09Exit [X]\0A\00"
define void @displayMain() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"\0APlease enter an area of math that interests you:\0A\00"
@str.3 = [19 x i8] c"\09Vectors in 2D [V]\00"
@str.4 = [10 x i8] c"\09Exit [X]\00"
define void @displayMain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bincoeff(int);
int main() {
  bincoeff(1);
  bincoeff(2);
  bincoeff(3);
  bincoeff(20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <bincoeff@plt>
mov    $0x2,%edi
call   1030 <bincoeff@plt>
mov    $0x3,%edi
call   1030 <bincoeff@plt>
mov    $0x14,%edi
call   1030 <bincoeff@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <bincoeff@plt>
mov    $0x2,%edi
call   1030 <bincoeff@plt>
mov    $0x3,%edi
call   1030 <bincoeff@plt>
mov    $0x14,%edi
call   1030 <bincoeff@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bincoeff(i32 1)
%3 = call i32 @bincoeff(i32 2)
%4 = call i32 @bincoeff(i32 3)
%5 = call i32 @bincoeff(i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bincoeff(i32 1)
%2 = tail call i32 @bincoeff(i32 2)
%3 = tail call i32 @bincoeff(i32 3)
%4 = tail call i32 @bincoeff(i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex16array(void *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 16));
}


x86 assembly (clang, -O0):
<pushcomplex16array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x4,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushcomplex16array>:
shl    $0x4,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex16array(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 = mul nsw i32 %6, 16
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushcomplex16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rd_3dim_slice(int *, int, int, int, int, int, int,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void rd_3dim(int *array, int dim1, int dim2, int dim3, int shift1, int shift2,
             int shift3) {
  rd_3dim_slice(array, dim1, dim2, dim3, shift1, shift2, shift3, 0, 0, 0);
}


x86 assembly (clang, -O0):
<rd_3dim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    0x10(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1030 <rd_3dim_slice@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_3dim>:
push   %rax
mov    0x10(%rsp),%eax
push   $0x0
push   $0x0
push   $0x0
push   %rax
call   1030 <rd_3dim_slice@plt>
add    $0x20,%rsp
pop    %rax
ret

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

LLVM IR (-O2):
define void @rd_3dim(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @rd_3dim_slice(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  unsigned char index = 0;
  char input[11];
  char c;
  do {
    c = getchar();
    input[index] = c;
    index++;
  } while (c != '\n');
  printf("%s", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
movzbl -0x5(%rbp),%eax
mov    %cl,-0x10(%rbp,%rax,1)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1133 <main+0x13>
lea    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
movzbl %bl,%ebx
mov    %al,0x5(%rsp,%rbx,1)
add    $0x1,%bl
cmp    $0xa,%al
jne    1130 <main+0x10>
lea    0xeb4(%rip),%rdi
lea    0x5(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = phi i8 [ 0, %0 ], [ %8, %3 ]
%5 = tail call signext i8 (...) @getchar()
%6 = zext i8 %4 to i64
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 %6
store i8 %5, i8* %7
%8 = add i8 %4, 1
%9 = icmp eq i8 %5, 10
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void nrf_ceh() { *(unsigned char *)0x500A |= (1 << 3); }


x86 assembly (clang, -O0):
<nrf_ceh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x500a,%eax
movzbl (%rax),%eax
or     $0x8,%eax
mov    %al,%cl
mov    $0x500a,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_ceh>:
orb    $0x8,0x500a
08
ret

LLVM IR (-O0):
define void @nrf_ceh() {
%1 = load i8, i8* inttoptr (i64 20490 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 20490 to i8*)
ret void
}

LLVM IR (-O2):
define void @nrf_ceh() {
%1 = load i8, i8* inttoptr (i64 20490 to i8*)
%2 = or i8 %1, 8
store i8 %2, i8* inttoptr (i64 20490 to i8*)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t TimerIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  return (bMasked ? (*((volatile uint32_t *)(ui32Base + 0x00000020)))
                  : (*((volatile uint32_t *)(ui32Base + 0x0000001C))));
}


x86 assembly (clang, -O0):
<TimerIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1126 <TimerIntStatus+0x26>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <TimerIntStatus+0x32>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x1c(%rcx,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @TimerIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store volatile i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load volatile i64, i64* %3
%9 = add nsw i64 %8, 32
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
br label %17
12: ; preds = %2
%13 = load volatile i64, i64* %3
%14 = add nsw i64 %13, 28
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
br label %17
17: ; preds = %12, %7
%18 = phi i64 [ %11, %7 ], [ %16, %12 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @TimerIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 28, i64 32
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hfp_subevent_enhanced_call_status_get_bnip_type(const uint8_t *event) {
  return event[7];
}


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

x86 assembly (clang, -O2):
<hfp_subevent_enhanced_call_status_get_bnip_type>:
mov    0x1c(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hfp_subevent_enhanced_call_status_get_bnip_type(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
ret i32 %3
}
void alloc_hash(void (*func)(unsigned char *, void *), void *arg) {
  unsigned char c[16];
  (*func)(c, arg);
}


x86 assembly (clang, -O0):
<alloc_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_hash>:
sub    $0x18,%rsp
mov    %rdi,%rax
mov    %rsp,%rdi
call   *%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @alloc_hash(void (i8*, i8*)* %0, i8* %1) {
%3 = alloca void (i8*, i8*)*
%4 = alloca i8*
%5 = alloca [16 x i8]
store void (i8*, i8*)* %0, void (i8*, i8*)** %3
store i8* %1, i8** %4
%6 = load void (i8*, i8*)*, void (i8*, i8*)** %3
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @alloc_hash(void (i8*, i8*)* nocapture %0, i8* %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ led_test();
int main(void) {
  led_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <led_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <led_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @led_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @led_test()
ret i32 0
}
void I422ToBGRA() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigsuspend(const sigset_t *set) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__sigsuspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sigsuspend>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__sigsuspend(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__sigsuspend(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void InGame_Cache(void) { trap_R_RegisterShaderNoMip("menu/art/addbotframe"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"menu/art/addbotframe\00"
define void @InGame_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"menu/art/addbotframe\00"
define void @InGame_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compare(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  compare(&a, &b, &c);
  printf("%d %d %d", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <compare@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebe(%rip),%r14
lea    0x14(%rsp),%rbx
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <compare@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = call i32 @compare(i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
unsigned int find_divisor(unsigned long val, unsigned int base) {
  unsigned int n;
  for (n = 1; val >= base; n *= base, val /= base)
    ;
  return n;
}


x86 assembly (clang, -O0):
<find_divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmp    %rcx,%rax
jb     1148 <find_divisor+0x48>
jmp    1127 <find_divisor+0x27>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    1112 <find_divisor+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_divisor>:
mov    %rdi,%rax
mov    %esi,%edi
mov    $0x1,%ecx
cmp    %rax,%rdi
jbe    112d <find_divisor+0x2d>
mov    %ecx,%eax
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edx,%edx
div    %rdi
imul   %esi,%ecx
cmp    %rdi,%rax
jb     110f <find_divisor+0xf>
mov    %rax,%rdx
shr    $0x20,%rdx
jne    1120 <find_divisor+0x20>
xor    %edx,%edx
div    %edi
jmp    1125 <find_divisor+0x25>

LLVM IR (-O0):
define i32 @find_divisor(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %12, %2
%7 = load i64, i64* %3
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = icmp uge i64 %7, %9
br i1 %10, label %11, label %20
11: ; preds = %6
br label %12
12: ; preds = %11
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = mul i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = load i64, i64* %3
%19 = udiv i64 %18, %17
store i64 %19, i64* %3
br label %6
20: ; preds = %6
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @find_divisor(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = icmp ugt i64 %3, %0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 1, %2 ]
%7 = phi i64 [ %9, %5 ], [ %0, %2 ]
%8 = mul i32 %6, %1
%9 = udiv i64 %7, %3
%10 = icmp ult i64 %9, %3
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, int);
int set_flag(int fd, int flags) {
  int val = -1;
  if ((val = fcntl(fd, F_GETFL, 0)) >= 0) {
    val |= flags;
    val = fcntl(fd, F_SETFL, val);
  }
  return (val >= 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<set_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1164 <set_flag+0x54>
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flag>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     113f <set_flag+0x2f>
or     %ebp,%eax
mov    0x2eac(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
call   1030 <fcntl@plt>
not    %eax
shr    $0x1f,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @set_flag(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @F_GETFL
%8 = call i32 @fcntl(i32 %6, i32 %7, i32 0)
store i32 %8, i32* %5
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = or i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* @F_SETFL
%16 = load i32, i32* %5
%17 = call i32 @fcntl(i32 %14, i32 %15, i32 %16)
store i32 %17, i32* %5
br label %18
18: ; preds = %10, %2
%19 = load i32, i32* %5
%20 = icmp sge i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
ret i32 %22
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @set_flag(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = or i32 %4, %1
%8 = load i32, i32* @F_SETFL
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ %9, %6 ], [ %4, %2 ]
%12 = xor i32 %11, -1
%13 = lshr i32 %12, 31
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int alloc_sprintfv(char **, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int const, char *, int);
void fdprintfv(const int fd, const char *format, va_list lst) {
  char *buf = NULL;
  int size = alloc_sprintfv(&buf, format, lst);
  if (size == -1)
    return;
  write(fd, buf, size);
}


x86 assembly (clang, -O0):
<fdprintfv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1040 <alloc_sprintfv@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    115c <fdprintfv+0x3c>
jmp    116b <fdprintfv+0x4b>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdprintfv>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <alloc_sprintfv@plt>
cmp    $0xffffffff,%eax
je     114d <fdprintfv+0x2d>
mov    0x8(%rsp),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fdprintfv(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i8* null, i8** %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @alloc_sprintfv(i8** %7, i8* %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %3
br label %20
15: ; preds = %3
%16 = load i32, i32* %4
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 @write(i32 %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %14
ret void
}

LLVM IR (-O2):
define void @fdprintfv(i32 %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%6 = call i32 @alloc_sprintfv(i8** %4, i8* %1, i32 %2)
%7 = icmp eq i32 %6, -1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = load i8*, i8** %4
%10 = call i32 @write(i32 %0, i8* %9, i32 %6)
br label %11
11: ; preds = %3, %8
ret void
}
int dist_O(int **image, int **transformee, int x, int y) {
  if (y > 0) {
    return (transformee[x][y - 1]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<dist_O>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    113c <dist_O+0x3c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <dist_O+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_O>:
test   %ecx,%ecx
jle    1112 <dist_O+0x12>
movslq %edx,%rax
mov    (%rsi,%rax,8),%rax
add    $0xffffffff,%ecx
mov    (%rax,%rcx,4),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dist_O(i32** nocapture readnone %0, i32** nocapture %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32*, i32** %1, i64 %7
%9 = load i32*, i32** %8
%10 = add nsw i32 %3, -1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
br label %14
14: ; preds = %4, %6
%15 = phi i32 [ %13, %6 ], [ 0, %4 ]
ret i32 %15
}
void print_so_version() {}


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

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

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

LLVM IR (-O2):
define void @print_so_version() {
ret void
}
void incompatible_init(struct S1 *s1, struct S2 *s2) {
  void *p1 = s1, *p2 = s2;
}


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

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

LLVM IR (-O0):
%struct.S1 = type opaque
%struct.S2 = type opaque
define void @incompatible_init(%struct.S1* %0, %struct.S2* %1) {
%3 = alloca %struct.S1*
%4 = alloca %struct.S2*
%5 = alloca i8*
%6 = alloca i8*
store %struct.S1* %0, %struct.S1** %3
store %struct.S2* %1, %struct.S2** %4
%7 = load %struct.S1*, %struct.S1** %3
%8 = bitcast %struct.S1* %7 to i8*
store i8* %8, i8** %5
%9 = load %struct.S2*, %struct.S2** %4
%10 = bitcast %struct.S2* %9 to i8*
store i8* %10, i8** %6
ret void
}

LLVM IR (-O2):
%struct.S1 = type opaque
%struct.S2 = type opaque
define void @incompatible_init(%struct.S1* nocapture %0, %struct.S2* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void mainSelect(int value) {
  if (value == 666) {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<mainSelect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x29a,-0x4(%rbp)
jne    112f <mainSelect+0x1f>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainSelect>:
cmp    $0x29a,%edi
je     1119 <mainSelect+0x9>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @mainSelect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 666
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @mainSelect(i32 %0) {
%2 = icmp eq i32 %0, 666
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
ret void
}
void main() {
  int i, j;
  int from;
  int to;
  int k;
  if (!(k >= 0))
    return;
  if (!(k <= 100))
    return;
  if (!(from >= 0))
    return;
  if (!(from <= k))
    return;
  i = from;
  j = 0;
  while (i < k) {
    i++;
    j++;
  }
  if (j >= 101)
    goto ERROR;
  return;
ERROR:;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x14(%rbp)
jge    1113 <main+0x13>
jmp    118b <main+0x8b>
cmpl   $0x64,-0x14(%rbp)
jle    1122 <main+0x22>
jmp    118b <main+0x8b>
cmpl   $0x0,-0xc(%rbp)
jge    1131 <main+0x31>
jmp    118b <main+0x8b>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1142 <main+0x42>
jmp    118b <main+0x8b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1172 <main+0x72>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x4f>
cmpl   $0x65,-0x8(%rbp)
jl     1181 <main+0x81>
jmp    1186 <main+0x86>
jmp    118b <main+0x8b>
jmp    118b <main+0x8b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %0
br label %39
9: ; preds = %0
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 100
br i1 %11, label %13, label %12
12: ; preds = %9
br label %39
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %13
br label %39
17: ; preds = %13
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = icmp sle i32 %18, %19
br i1 %20, label %22, label %21
21: ; preds = %17
br label %39
22: ; preds = %17
%23 = load i32, i32* %3
store i32 %23, i32* %1
store i32 0, i32* %2
br label %24
24: ; preds = %28, %22
%25 = load i32, i32* %1
%26 = load i32, i32* %5
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %24
33: ; preds = %24
%34 = load i32, i32* %2
%35 = icmp sge i32 %34, 101
br i1 %35, label %36, label %37
36: ; preds = %33
br label %38
37: ; preds = %33
br label %39
38: ; preds = %36
br label %39
39: ; preds = %38, %37, %21, %16, %12, %8
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
float theta(y) { return asin(y / (sqrt(2))); }


x86 assembly (clang, -O0):
<theta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec3(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <asin@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theta>:
push   %rax
cvtsi2sd %edi,%xmm0
divsd  0xee3(%rip),%xmm0
call   1030 <asin@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @theta(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @sqrt(double 2.000000e+00)
%6 = fdiv double %4, %5
%7 = call double @asin(double %6)
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @theta(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 0x3FF6A09E667F3BCD
%4 = tail call double @asin(double %3)
%5 = fptrunc double %4 to float
ret float %5
}
long __attribute__((unused))
compare_and_swap(volatile long *p, long oldval, long newval) {
  long ret;
  __asm__ __volatile__("lock; cmpxchgq %2, %1"
                       : "=a"(ret), "=m"(*p)
                       : "r"(newval), "m"(*p), "0"(oldval));
  return ret;
}


x86 assembly (clang, -O0):
<compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
lock cmpxchg %rdx,(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i64 @compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = load i64, i64* %6
%10 = load i64*, i64** %4
%11 = load i64, i64* %5
%12 = call i64 asm sideeffect "lock; cmpxchgq $2, $1", "={ax},=*m,r,*m,0,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %8, i64 %9, i64* elementtype(i64) %10, i64 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
ret i64 %13
}

LLVM IR (-O2):
define i64 @compare_and_swap(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "lock; cmpxchgq $2, $1", "={ax},=*m,r,*m,0,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %2, i64* elementtype(i64) %0, i64 %1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ atanf(float);
float kill_denormal(int /*<<< orphan*/);
float atan_native(float f) { return kill_denormal(atanf(f)); }


x86 assembly (clang, -O0):
<atan_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atanf@plt>
mov    %eax,%edi
call   1040 <kill_denormal@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @atan_native(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @atanf(float %3)
%5 = call float @kill_denormal(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @atan_native(float %0) {
%2 = tail call i32 @atanf(float %0)
%3 = tail call float @kill_denormal(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ clr(int *, size_t);
scalar_t__ get(int *, size_t);
int /*<<< orphan*/ set(int *, size_t);
void flip(int *p, size_t i) {
  if (get(p, i))
    clr(p, i);
  else
    set(p, i);
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get@plt>
cmp    $0x0,%rax
je     1169 <flip+0x39>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <clr@plt>
jmp    1176 <flip+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <get@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1156 <flip+0x26>
pop    %rbx
pop    %r14
jmp    1030 <clr@plt>
pop    %rbx
pop    %r14
jmp    1050 <set@plt>

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

LLVM IR (-O2):
define void @flip(i32* %0, i64 %1) {
%3 = tail call i64 @get(i32* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @clr(i32* %0, i64 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @set(i32* %0, i64 %1)
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int fstat(int, struct stat *);
int unix_fstat(int fd, struct stat *s_p) { return fstat(fd, s_p); }


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

x86 assembly (clang, -O2):
<unix_fstat>:
jmp    1030 <fstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @unix_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @fstat(i32 %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @unix_fstat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @fstat(i32 %0, %struct.stat* %1)
ret i32 %3
}