xunge/DecIR huggingface dataset:
void nested_loop() {
  int i, j;
  char a[10];
  for (i = 0; i < 10; i++) {
    a[i] = 'a';
    for (j = 0; j <= 10; j++) {
      a[j] = 'a';
    }
  }
}


x86 assembly (clang, -O0):
<nested_loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1159 <nested_loop+0x59>
movslq -0x4(%rbp),%rax
movb   $0x61,-0x12(%rbp,%rax,1)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1146 <nested_loop+0x46>
movslq -0x8(%rbp),%rax
movb   $0x61,-0x12(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <nested_loop+0x25>
jmp    114b <nested_loop+0x4b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <nested_loop+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @nested_loop() {
ret void
}
int test_imm_07int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x07 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_07int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_07int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 30064771072
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_avg_mask() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_avg_mask"
         "\n");
}


x86 assembly (clang, -O0):
<pa_cvolume_avg_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_cvolume_avg_mask\0A\00"
define i32 @pa_cvolume_avg_mask() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_cvolume_avg_mask\00"
define i32 @pa_cvolume_avg_mask() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int a_twist_r_on_eloc(eloc)
int eloc;
{
  int temp_arr[12];
  a_eloc_unpack(eloc, temp_arr);
  four_cycle(temp_arr, 8, 5, 10, 1);
  return a_eloc_pack(temp_arr);
}


x86 assembly (clang, -O0):
<a_twist_r_on_eloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <a_eloc_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0x8,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
mov    $0x1,%r8d
mov    $0x0,%al
call   1030 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <a_eloc_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_twist_r_on_eloc>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <a_eloc_unpack@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
call   1030 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <a_eloc_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a_twist_r_on_eloc(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eloc_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 8, i32 5, i32 10, i32 1)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eloc_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @a_twist_r_on_eloc(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eloc_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 8, i32 5, i32 10, i32 1)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eloc_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, a[5];
  for (i = 0; i < 5; i++) {
    printf("%d\n", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1152 <main+0x42>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @_Jv_LookupJNIMethod() {
ret void
}
/* Variables and functions */
int testLinkedList();
int main() { return testLinkedList(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testLinkedList()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void input_name() { printf("input_name\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"input_name\00"
define void @input_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int int2double(double);
int /*<<< orphan*/ printf(char *, double, int);
int uchar2schar(unsigned char);
int main(int argc, char *argv[]) {
  unsigned char uc128 = 128u;
  double d100 = 100;
  printf("uchar2schar"
         "(%d) = %d\n",
         uc128, uchar2schar(uc128));
  printf("int2double"
         "(%d) = %d\n",
         d100, int2double(d100));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x80,-0x11(%rbp)
movabs $0x4059000000000000,%rax
mov    %rax,-0x20(%rbp)
movzbl -0x11(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movzbl -0x11(%rbp),%edi
call   1040 <uchar2schar@plt>
movsd  -0x30(%rbp),%xmm0
mov    %eax,%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <int2double@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
call   1040 <uchar2schar@plt>
lea    0xece(%rip),%rdi
movsd  0xeb6(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xeaf(%rip),%xmm0
call   1050 <int2double@plt>
lea    0xec1(%rip),%rdi
movsd  0xe9b(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"uchar2schar(%d) = %d\0A\00"
@.str.1 = [21 x i8] c"int2double(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 -128, i8* %6
store double 1.000000e+02, double* %7
%8 = load i8, i8* %6
%9 = uitofp i8 %8 to double
%10 = load i8, i8* %6
%11 = call i32 @uchar2schar(i8 zeroext %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %9, i32 %11)
%13 = load double, double* %7
%14 = load double, double* %7
%15 = call i32 @int2double(double %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %13, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"uchar2schar(%d) = %d\0A\00"
@.str.1 = [21 x i8] c"int2double(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @uchar2schar(i8 zeroext -128)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double 1.280000e+02, i32 %3)
%5 = tail call i32 @int2double(double 1.000000e+02)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+02, i32 %5)
ret i32 0
}
void __attribute__((noipa)) foo(const char *x) {
  asm volatile("" : "+g"(x) : : "memory");
  if (x)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <foo+0x24>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    %rdi,(%rsp)
mov    %rdi,(%rsp)
test   %rdi,%rdi
jne    1120 <foo+0x10>
pop    %rax
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
unreachable
6: ; preds = %1
ret void
}
void b_progend(void) {}


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

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

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

LLVM IR (-O2):
define void @b_progend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void abort() { printf("failed\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"failed\0A\00"
define void @abort() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"failed\00"
define void @abort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
unreachable
}
int sign(int x) { return (x >> 63) | (!!x); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3f,%ecx
sar    %cl,%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 63
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = or i32 %4, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ list_add(void *);
int /*<<< orphan*/ list_del(void *);
void *my_malloc(int);
int main() {
  void *dev1 = my_malloc(sizeof dev1);
  void *dev2 = my_malloc(sizeof dev2);
  if (dev1 && dev2) {
    list_add(dev2);
    list_add(dev1);
    list_del(dev2);
    list_add(dev2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1030 <my_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1030 <my_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1195 <main+0x65>
cmpq   $0x0,-0x18(%rbp)
je     1195 <main+0x65>
mov    -0x18(%rbp),%rdi
call   1050 <list_add@plt>
mov    -0x10(%rbp),%rdi
call   1050 <list_add@plt>
mov    -0x18(%rbp),%rdi
call   1040 <list_del@plt>
mov    -0x18(%rbp),%rdi
call   1050 <list_add@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x8,%edi
call   1030 <my_malloc@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1030 <my_malloc@plt>
test   %r14,%r14
je     1178 <main+0x48>
mov    %rax,%rbx
test   %rax,%rax
je     1178 <main+0x48>
mov    %rbx,%rdi
call   1050 <list_add@plt>
mov    %r14,%rdi
call   1050 <list_add@plt>
mov    %rbx,%rdi
call   1040 <list_del@plt>
mov    %rbx,%rdi
call   1050 <list_add@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @my_malloc(i32 8)
%2 = tail call i8* @my_malloc(i32 8)
%3 = icmp ne i8* %1, null
%4 = icmp ne i8* %2, null
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = tail call i32 @list_add(i8* %2)
%8 = tail call i32 @list_add(i8* %1)
%9 = tail call i32 @list_del(i8* %2)
%10 = tail call i32 @list_add(i8* %2)
br label %11
11: ; preds = %6, %0
ret i32 0
}
int eq(char *a, char *b) {
  while (*a) {
    if (*a != *b)
      return 0;
    a++;
    b++;
  }
  if (*b != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <eq+0x58>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     113b <eq+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    117b <eq+0x7b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <eq+0xc>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1174 <eq+0x74>
movl   $0x0,-0x4(%rbp)
jmp    117b <eq+0x7b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
mov    (%rdi),%al
test   %al,%al
je     1123 <eq+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    112c <eq+0x2c>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <eq+0x10>
xor    %eax,%eax
cmpb   $0x0,(%rsi)
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @eq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %21
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ]
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %5, %16
%22 = phi i32 [ %20, %16 ], [ 0, %5 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ UBloxInfoHandle();
void UBloxInfoRequestUpdate() { UAVObjRequestUpdate(UBloxInfoHandle()); }


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

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

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

LLVM IR (-O2):
define void @UBloxInfoRequestUpdate() {
%1 = tail call i32 (...) @UBloxInfoHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void rop3_77_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ T;
  stk3 = *D ^ S;
  stk2 = stk2 | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_77_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
or     %esi,%edx
or     %cl,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_77_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ pthread_sigmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
void BlockAllSignal() {
  sigset_t sigmask;
  sigfillset(&sigmask);
  pthread_sigmask(SIG_SETMASK, &sigmask, NULL);
}


x86 assembly (clang, -O0):
<BlockAllSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigfillset@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlockAllSignal>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigfillset@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define void @BlockAllSignal() {
%1 = alloca i32
%2 = call i32 @sigfillset(i32* %1)
%3 = load i32, i32* @SIG_SETMASK
%4 = call i32 @pthread_sigmask(i32 %3, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define void @BlockAllSignal() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_SETMASK
%5 = call i32 @pthread_sigmask(i32 %4, i32* %1, i32* null)
ret void
}
/* Variables and functions */
char *osdep_get_cwd(int fd) { return (NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @osdep_get_cwd(i32 %0) {
ret i8* null
}
void RTRandU64Ex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandU64Ex() {
ret void
}
int unoctchar(char c) {
  if (c >= '0' && c <= '7')
    return c - '0';
  return -1;
}


x86 assembly (clang, -O0):
<unoctchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <unoctchar+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x37,%eax
jg     1133 <unoctchar+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <unoctchar+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unoctchar>:
lea    -0x30(%rdi),%ecx
mov    %edi,%eax
and    $0xf8,%al
cmp    $0x30,%al
mov    $0xffffffff,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @unoctchar(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 sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 55
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %16
15: ; preds = %7, %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @unoctchar(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
float cosf(float x) { return 0.0; }


x86 assembly (clang, -O0):
<cosf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @cosf(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @cosf(float %0) {
ret float 0.000000e+00
}
write_bmp_image(file_name, array) char *file_name;
short **array;
{}


x86 assembly (clang, -O0):
<write_bmp_image>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @write_bmp_image(i8* nocapture readnone %0, i16** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
usage() {
  (void)fprintf(stderr, "usage: mkdir [-p] dirname ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"usage: mkdir [-p] dirname ...\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"usage: mkdir [-p] dirname ...\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void ff_hevc_put_hevc_uni_qpel_v48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v48_10_avx2() {
ret void
}
/* Variables and functions */
char *longestCommonPrefix(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", longestCommonPrefix(argv + 1, argc - 1));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <longestCommonPrefix@plt>
mov    %rax,%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x8(%rsi),%rax
lea    -0x1(%rdi),%esi
mov    %rax,%rdi
call   1030 <longestCommonPrefix@plt>
lea    0xec9(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = add nsw i32 %0, -1
%5 = tail call i8* @longestCommonPrefix(i8** %3, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ unix_error(char *);
void Sigemptyset(sigset_t *set) {
  if (sigemptyset(set) < 0) {
    unix_error("Sigemptyset error");
  }
}


x86 assembly (clang, -O0):
<Sigemptyset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sigemptyset@plt>
cmp    $0x0,%rax
jge    114b <Sigemptyset+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigemptyset>:
push   %rax
call   1030 <sigemptyset@plt>
test   %rax,%rax
js     112d <Sigemptyset+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Sigemptyset error\00"
define void @Sigemptyset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @sigemptyset(i32* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @unix_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Sigemptyset error\00"
define void @Sigemptyset(i32* %0) {
%2 = tail call i64 @sigemptyset(i32* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
size_t fwrite(void const *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void fwrite_check(const void *ptr, size_t size, size_t nmemb, FILE *stream) {
  if (fwrite(ptr, size, nmemb, stream) != nmemb) {
    perror("kdt_write");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<fwrite_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1050 <fwrite@plt>
cmp    -0x18(%rbp),%rax
je     117d <fwrite_check+0x4d>
lea    0xe92(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite_check>:
push   %rbx
mov    %rdx,%rbx
call   1050 <fwrite@plt>
cmp    %rbx,%rax
jne    1140 <fwrite_check+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"kdt_write\00"
define void @fwrite_check(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fwrite(i8* %9, i64 %10, i64 %11, i32* %12)
%14 = load i64, i64* %7
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"kdt_write\00"
define void @fwrite_check(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, %2
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
int compress_x10list(struct x10list_st *x10list, int *listsize) { return 0; }


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

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

LLVM IR (-O0):
%struct.x10list_st = type opaque
define i32 @compress_x10list(%struct.x10list_st* %0, i32* %1) {
%3 = alloca %struct.x10list_st*
%4 = alloca i32*
store %struct.x10list_st* %0, %struct.x10list_st** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
%struct.x10list_st = type opaque
define i32 @compress_x10list(%struct.x10list_st* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
void consoleSetReverse(int rev) {}


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

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

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

LLVM IR (-O2):
define void @consoleSetReverse(i32 %0) {
ret void
}
/* Variables and functions */
long rand();
double AverageRandom(double min, double max) {
  long minInteger = (long)(min * 1000000);
  long maxInteger = (long)(max * 1000000);
  long randInteger = rand();
  long diffInteger = maxInteger - minInteger;
  return (randInteger % diffInteger + minInteger) / 1000000.0;
}


x86 assembly (clang, -O0):
<AverageRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x18(%rbp)
movsd  0xec0(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cqto
idivq  -0x30(%rbp)
add    -0x18(%rbp),%rdx
cvtsi2sd %rdx,%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AverageRandom>:
push   %r14
push   %rbx
push   %rax
movsd  0xee4(%rip),%xmm2
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%r14
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
sub    %r14,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     114b <AverageRandom+0x3b>
cqto
idiv   %rbx
jmp    114f <AverageRandom+0x3f>
xor    %edx,%edx
div    %ebx
add    %r14,%rdx
xorps  %xmm0,%xmm0
cvtsi2sd %rdx,%xmm0
divsd  0xe9e(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @AverageRandom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %3
%10 = fmul double %9, 1.000000e+06
%11 = fptosi double %10 to i64
store i64 %11, i64* %5
%12 = load double, double* %4
%13 = fmul double %12, 1.000000e+06
%14 = fptosi double %13 to i64
store i64 %14, i64* %6
%15 = call i64 (...) @rand()
store i64 %15, i64* %7
%16 = load i64, i64* %6
%17 = load i64, i64* %5
%18 = sub nsw i64 %16, %17
store i64 %18, i64* %8
%19 = load i64, i64* %7
%20 = load i64, i64* %8
%21 = srem i64 %19, %20
%22 = load i64, i64* %5
%23 = add nsw i64 %21, %22
%24 = sitofp i64 %23 to double
%25 = fdiv double %24, 1.000000e+06
ret double %25
}

LLVM IR (-O2):
define double @AverageRandom(double %0, double %1) {
%3 = fmul double %0, 1.000000e+06
%4 = fptosi double %3 to i64
%5 = fmul double %1, 1.000000e+06
%6 = fptosi double %5 to i64
%7 = tail call i64 (...) @rand()
%8 = sub nsw i64 %6, %4
%9 = srem i64 %7, %8
%10 = add nsw i64 %9, %4
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+06
ret double %12
}
void swap(int *a, int i, int j) {
  int tmp;
  tmp = a[i];
  a[i] = a[j];
  a[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int vde_chain_nm8_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 4;
  if (n_out)
    *n_out = 3;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm8_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm8_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm8_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm8_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm8_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm8_init>:
test   %rdi,%rdi
je     110b <vde_chain_nm8_init+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm8_init+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm8_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm8_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm8_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void remove_newline(char *string) {
  if (string[strlen(string) - 1] == '\n')
    string[strlen(string) - 1] = 0;
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1167 <remove_newline+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1131 <remove_newline+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @remove_newline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i8*, i8** %2
%15 = call i32 @strlen(i8* %14)
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
store i8 0, i8* %18
br label %19
19: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @remove_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %1
ret void
}