xunge/DecIR huggingface dataset:
/* Variables and functions */
int booster_fstat(int, void *);
int fstat(int fd, void *buf) { return booster_fstat(fd, buf); }


x86 assembly (clang, -O0):
<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 <booster_fstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fstat(i32 %0, i8* %1) {
%3 = tail call i32 @booster_fstat(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_real_date_end(char *end) { write("csv-task.csv", "%s,", end); }


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

x86 assembly (clang, -O2):
<function_real_date_end>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_real_date_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s,\00"
define void @function_real_date_end(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsspn(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninitvar_wcsspn(void) {
  wchar_t *ds;
  wchar_t *ss;
  (void)wcsspn(ds, ss);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcsspn>:
jmp    1030 <wcsspn@plt>

LLVM IR (-O0):
define void @uninitvar_wcsspn() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcsspn(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcsspn() {
%1 = tail call i32 @wcsspn(i32* undef, i32* undef)
ret void
}
/* Variables and functions */
float cos(unsigned char);
float sin(unsigned char);
float anglec2f(unsigned char angle, int trig) {
  if (trig)
    return sin((angle / (double)255) * 360);
  return cos((angle / (double)255) * 360);
}


x86 assembly (clang, -O0):
<anglec2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1171 <anglec2f+0x51>
movzbl -0x5(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%edi
call   1030 <sin@plt>
movss  %xmm0,-0x4(%rbp)
jmp    11a2 <anglec2f+0x82>
movzbl -0x5(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7b(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%edi
call   1040 <cos@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anglec2f>:
cvtsi2sd %edi,%xmm0
divsd  0xed4(%rip),%xmm0
mulsd  0xed4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%edi
test   %esi,%esi
je     1144 <anglec2f+0x24>
jmp    1030 <sin@plt>
jmp    1040 <cos@plt>

LLVM IR (-O0):
define float @anglec2f(i8 zeroext %0, i32 %1) {
%3 = alloca float
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 2.550000e+02
%13 = fmul double %12, 3.600000e+02
%14 = fptoui double %13 to i8
%15 = call float @sin(i8 zeroext %14)
store float %15, float* %3
br label %24
16: ; preds = %2
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = sitofp i32 %18 to double
%20 = fdiv double %19, 2.550000e+02
%21 = fmul double %20, 3.600000e+02
%22 = fptoui double %21 to i8
%23 = call float @cos(i8 zeroext %22)
store float %23, float* %3
br label %24
24: ; preds = %16, %8
%25 = load float, float* %3
ret float %25
}

LLVM IR (-O2):
define float @anglec2f(i8 zeroext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = uitofp i8 %0 to double
%5 = fdiv double %4, 2.550000e+02
%6 = fmul double %5, 3.600000e+02
%7 = fptoui double %6 to i8
br i1 %3, label %10, label %8
8: ; preds = %2
%9 = tail call float @sin(i8 zeroext %7)
br label %12
10: ; preds = %2
%11 = tail call float @cos(i8 zeroext %7)
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}
void hanoi(int n, int *count) {
  if (n == 1) {
    *count += 4;
  } else {
    hanoi(n - 1, &*count);
    *count += 2;
    hanoi(n - 1, &*count);
    *count += 2;
    hanoi(n - 1, &*count);
  }
}


x86 assembly (clang, -O0):
<hanoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1139 <hanoi+0x29>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x4,%ecx
mov    %ecx,(%rax)
jmp    117c <hanoi+0x6c>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <hanoi@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <hanoi@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <hanoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hanoi>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jne    111f <hanoi+0xf>
mov    (%rbx),%eax
jmp    1153 <hanoi+0x43>
mov    %edi,%ebp
add    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <hanoi@plt>
addl   $0x2,(%rbx)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <hanoi@plt>
mov    (%rbx),%eax
add    $0x2,%eax
mov    %eax,(%rbx)
add    $0xffffffff,%ebp
jne    1130 <hanoi+0x20>
add    $0x4,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @hanoi(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 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 4
store i32 %10, i32* %8
br label %27
11: ; preds = %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = load i32*, i32** %4
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 2
store i32 %17, i32* %15
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32*, i32** %4
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 2
store i32 %23, i32* %21
%24 = load i32, i32* %3
%25 = sub nsw i32 %24, 1
%26 = load i32*, i32** %4
br label %27
27: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
define void @hanoi(i32 %0, i32* %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* %1
br label %6
6: ; preds = %9, %4
%7 = phi i32 [ %5, %4 ], [ %15, %9 ]
%8 = add nsw i32 %7, 4
store i32 %8, i32* %1
ret void
9: ; preds = %2, %9
%10 = phi i32 [ %11, %9 ], [ %0, %2 ]
%11 = add nsw i32 %10, -1
tail call void @hanoi(i32 %11, i32* %1)
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 2
store i32 %13, i32* %1
tail call void @hanoi(i32 %11, i32* %1)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 2
store i32 %15, i32* %1
%16 = icmp eq i32 %11, 1
br i1 %16, label %6, label %9
}
void isr_pendsv(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<isr_pendsv>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <isr_pendsv+0x9>
jmp    1109 <isr_pendsv+0x9>

x86 assembly (clang, -O2):
<isr_pendsv>:
jmp    1100 <isr_pendsv>

LLVM IR (-O0):
define void @isr_pendsv() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @isr_pendsv() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int epoll_create(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int CreateEpollOrDie() {
  int epollfd = epoll_create(1);
  if (epollfd == -1) {
    perror("epoll_create");
    exit(1);
  }
  return epollfd;
}


x86 assembly (clang, -O0):
<CreateEpollOrDie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <epoll_create@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1165 <CreateEpollOrDie+0x35>
lea    0xeaa(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateEpollOrDie>:
push   %rax
mov    $0x1,%edi
call   1040 <epoll_create@plt>
cmp    $0xffffffff,%eax
je     1142 <CreateEpollOrDie+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"epoll_create\00"
define i32 @CreateEpollOrDie() {
%1 = alloca i32
%2 = call i32 @epoll_create(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"epoll_create\00"
define i32 @CreateEpollOrDie() {
%1 = tail call i32 @epoll_create(i32 1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret i32 %1
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void add(struct DynArr *stack) {
  double i = topDynArr(stack);
  popDynArr(stack);
  double j = topDynArr(stack);
  popDynArr(stack);
  pushDynArr(stack, (i + j));
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @add(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call double @topDynArr(%struct.DynArr* %5)
store double %6, double* %3
%7 = load %struct.DynArr*, %struct.DynArr** %2
%8 = call i32 @popDynArr(%struct.DynArr* %7)
%9 = load %struct.DynArr*, %struct.DynArr** %2
%10 = call double @topDynArr(%struct.DynArr* %9)
store double %10, double* %4
%11 = load %struct.DynArr*, %struct.DynArr** %2
%12 = call i32 @popDynArr(%struct.DynArr* %11)
%13 = load %struct.DynArr*, %struct.DynArr** %2
%14 = load double, double* %3
%15 = load double, double* %4
%16 = fadd double %14, %15
%17 = call i32 @pushDynArr(%struct.DynArr* %13, double %16)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @add(%struct.DynArr* %0) {
%2 = tail call double @topDynArr(%struct.DynArr* %0)
%3 = tail call i32 @popDynArr(%struct.DynArr* %0)
%4 = tail call double @topDynArr(%struct.DynArr* %0)
%5 = tail call i32 @popDynArr(%struct.DynArr* %0)
%6 = fadd double %2, %4
%7 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %6)
ret void
}
void nseel_asm_sqr(void) { __asm__("fmul %st(0), %st(0)\n"); }


x86 assembly (clang, -O0):
<nseel_asm_sqr>:
push   %rbp
mov    %rsp,%rbp
fmul   %st(0),%st
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_sqr>:
fmul   %st(0),%st
ret

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

LLVM IR (-O2):
define void @nseel_asm_sqr() {
tail call void asm sideeffect "fmul %st(0), %st(0)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int end_index(int *, int);
scalar_t__ start_index(int *, int);
int test_reverse_ordered() {
  int n[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  return 0 == start_index(n, 10) && 9 == end_index(n, 10);
}


x86 assembly (clang, -O0):
<test_reverse_ordered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <start_index@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x31(%rbp)
jne    118b <test_reverse_ordered+0x5b>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <end_index@plt>
mov    %eax,%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reverse_ordered>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <start_index@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1163 <test_reverse_ordered+0x43>
add    $0x28,%rsp
ret
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <end_index@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
sete   %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_reverse_ordered.n = [10 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @test_reverse_ordered() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i64 @start_index(i32* %3, i32 10)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @end_index(i32* %7, i32 10)
%9 = icmp eq i32 9, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test_reverse_ordered.n = [10 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @test_reverse_ordered() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i64 @start_index(i32* %3, i32 10)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @end_index(i32* %3, i32 10)
%8 = icmp eq i32 %7, 9
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
int sub3(int a) { return (3 - a) != 0; }


x86 assembly (clang, -O0):
<sub3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3,%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub3>:
xor    %eax,%eax
cmp    $0x3,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @sub3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 3, %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sub3(i32 %0) {
%2 = icmp ne i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
int is_g7x(int chipset) {
  if (chipset < 0x46 || chipset == 0x4a || chipset == 0x4e || chipset == 0x50 ||
      chipset >= 0x70)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_g7x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x46,-0x8(%rbp)
jl     1139 <is_g7x+0x39>
cmpl   $0x4a,-0x8(%rbp)
je     1139 <is_g7x+0x39>
cmpl   $0x4e,-0x8(%rbp)
je     1139 <is_g7x+0x39>
cmpl   $0x50,-0x8(%rbp)
je     1139 <is_g7x+0x39>
cmpl   $0x70,-0x8(%rbp)
jl     1145 <is_g7x+0x45>
movl   $0x0,-0x4(%rbp)
jmp    114c <is_g7x+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_g7x>:
cmp    $0x46,%edi
setge  %al
mov    %edi,%ecx
and    $0xfffffffb,%ecx
cmp    $0x4a,%ecx
setne  %cl
cmp    $0x50,%edi
setne  %dl
and    %al,%dl
and    %cl,%dl
cmp    $0x70,%edi
setl   %al
and    %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_g7x(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 70
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 74
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 78
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 80
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sge i32 %16, 112
br i1 %17, label %18, label %19
18: ; preds = %15, %12, %9, %6, %1
store i32 0, i32* %2
br label %20
19: ; preds = %15
store i32 1, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_g7x(i32 %0) {
%2 = icmp slt i32 %0, 70
%3 = and i32 %0, -5
%4 = icmp eq i32 %3, 74
%5 = or i1 %2, %4
%6 = icmp eq i32 %0, 80
%7 = or i1 %6, %5
%8 = icmp sgt i32 %0, 111
%9 = or i1 %8, %7
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}
void tux3_xattr_read_and_clear(struct inode *inode) {}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define void @tux3_xattr_read_and_clear(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
define void @tux3_xattr_read_and_clear(%struct.inode* nocapture %0) {
ret void
}
void g_closure_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_unref() {
ret void
}
int x36_process_request(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x36_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ putchar(int /*<<< orphan*/);
void alien(char *p) {
  while (putchar(*(p += *(p + 1) - *p)))
    ;
}


x86 assembly (clang, -O0):
<alien>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
mov    %rax,%rdx
add    %rcx,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
cmp    $0x0,%rax
je     1156 <alien+0x46>
jmp    111c <alien+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alien>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbq 0x1(%rdi),%rax
movsbq (%rdi),%rcx
sub    %rcx,%rax
lea    (%rdi,%rax,1),%rbx
movsbl (%rdi,%rax,1),%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
test   %rax,%rax
jne    1120 <alien+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @alien(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %10, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = load i8, i8* %3
%8 = sext i8 %7 to i64
%9 = sub nsw i64 %6, %8
%10 = getelementptr inbounds i8, i8* %3, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i64 @putchar(i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %2
15: ; preds = %2
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int socketcall(int (*)(int, struct sockaddr *, int /*<<< orphan*/ *), int,
               struct sockaddr *, int /*<<< orphan*/ *, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int getsockname(int fd, struct sockaddr *restrict addr,
                socklen_t *restrict len) {
  return socketcall(getsockname, fd, addr, len, 0, 0, 0);
}


x86 assembly (clang, -O0):
<getsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    0x2eab(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockname>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2eb9(%rip),%rdi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* noalias %1, i32* noalias %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @socketcall(i32 (i32, %struct.sockaddr*, i32*)* @getsockname, i32 %7, %struct.sockaddr* %8, i32* %9, i32 0, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getsockname(i32 %0, %struct.sockaddr* noalias %1, i32* noalias %2) {
%4 = tail call i32 @socketcall(i32 (i32, %struct.sockaddr*, i32*)* @getsockname, i32 %0, %struct.sockaddr* %1, i32* %2, i32 0, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write4bits(int, char);
void send(int file, char value, char mode) {
  char h = value & 0xf0;
  char l = (value << 4) & 0xf0;
  write4bits(file, h | mode);
  write4bits(file, l | mode);
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
and    $0xf0,%eax
mov    %al,-0x7(%rbp)
movsbl -0x5(%rbp),%eax
shl    $0x4,%eax
and    $0xf0,%eax
mov    %al,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movsbl -0x7(%rbp),%eax
movsbl -0x6(%rbp),%ecx
or     %ecx,%eax
movsbl %al,%esi
call   1030 <write4bits@plt>
mov    -0x4(%rbp),%edi
movsbl -0x8(%rbp),%eax
movsbl -0x6(%rbp),%ecx
or     %ecx,%eax
movsbl %al,%esi
call   1030 <write4bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %ebp,%eax
and    $0xf0,%al
shl    $0x4,%bpl
or     %bl,%al
movsbl %al,%esi
call   1030 <write4bits@plt>
or     %bl,%bpl
movsbl %bpl,%esi
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write4bits@plt>

LLVM IR (-O0):
define void @send(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = and i32 %10, 240
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = shl i32 %14, 4
%16 = and i32 %15, 240
%17 = trunc i32 %16 to i8
store i8 %17, i8* %8
%18 = load i32, i32* %4
%19 = load i8, i8* %7
%20 = sext i8 %19 to i32
%21 = load i8, i8* %6
%22 = sext i8 %21 to i32
%23 = or i32 %20, %22
%24 = trunc i32 %23 to i8
%25 = call i32 @write4bits(i32 %18, i8 signext %24)
%26 = load i32, i32* %4
%27 = load i8, i8* %8
%28 = sext i8 %27 to i32
%29 = load i8, i8* %6
%30 = sext i8 %29 to i32
%31 = or i32 %28, %30
%32 = trunc i32 %31 to i8
%33 = call i32 @write4bits(i32 %26, i8 signext %32)
ret void
}

LLVM IR (-O2):
define void @send(i32 %0, i8 signext %1, i8 signext %2) {
%4 = and i8 %1, -16
%5 = shl i8 %1, 4
%6 = or i8 %4, %2
%7 = tail call i32 @write4bits(i32 %0, i8 signext %6)
%8 = or i8 %5, %2
%9 = tail call i32 @write4bits(i32 %0, i8 signext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void t_setdefault(void) { fprintf(stdout, "\033[0m"); }


x86 assembly (clang, -O0):
<t_setdefault>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_setdefault>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[0m\00"
define void @t_setdefault() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[0m\00"
define void @t_setdefault() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *alloca(int);
void *q(void) { return alloca(10); }


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

x86 assembly (clang, -O2):
<q>:
mov    $0xa,%edi
jmp    1030 <alloca@plt>

LLVM IR (-O0):
define i8* @q() {
%1 = call i8* @alloca(i32 10)
ret i8* %1
}

LLVM IR (-O2):
define i8* @q() {
%1 = tail call i8* @alloca(i32 10)
ret i8* %1
}
/* Variables and functions */
int strcmp(char const *, char const *);
int w_str_equal(const void *s1, const void *s2) {
  return strcmp((const char *)s1, (const char *)s2);
}


x86 assembly (clang, -O0):
<w_str_equal>:
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   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_str_equal>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @w_str_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello hello\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int checkResolution(int res) {
  if (!(res == 9 || res == 10 || res == 11 || res == 12)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkResolution>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
je     113b <checkResolution+0x3b>
cmpl   $0xa,-0x8(%rbp)
je     113b <checkResolution+0x3b>
cmpl   $0xb,-0x8(%rbp)
je     113b <checkResolution+0x3b>
cmpl   $0xc,-0x8(%rbp)
je     113b <checkResolution+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <checkResolution+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkResolution>:
add    $0xfffffff7,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @checkResolution(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
int root_askend(struct cnode *cnode, const struct cnodefuncs *type) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.cnode = type opaque
%struct.cnodefuncs = type opaque
define i32 @root_askend(%struct.cnode* nocapture readnone %0, %struct.cnodefuncs* nocapture readnone %1) {
ret i32 0
}
int main() {
  int four = 2 + 2;
  int eight = four + four;
  int twelve = four + eight;
  return twelve;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 12
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_Resume() {
  char msg[] = "Aborting: "
               "_Unwind_Resume"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_Resume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x46,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x45,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_Resume>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa2964656c6261,%rax
mov    %rax,0x3e(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x45,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_Resume.msg = [70 x i8] c"Aborting: _Unwind_Resume called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_Resume() {
%1 = alloca [70 x i8]
%2 = bitcast [70 x i8]* %1 to i8*
%3 = getelementptr inbounds [70 x i8], [70 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 69)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_Resume.msg = [70 x i8] c"Aborting: _Unwind_Resume called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_Resume() {
%1 = alloca [70 x i8]
%2 = getelementptr inbounds [70 x i8], [70 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 69)
%4 = tail call i32 (...) @abort()
unreachable
}
void XDrawSegments() {}


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

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

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

LLVM IR (-O2):
define void @XDrawSegments() {
ret void
}
int sys$ulwset(struct _va_range *inadr, struct _va_range *retadr,
               unsigned int acmode) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(acmode);
    register long int _a2 asm("rsi") = (long)(retadr);
    register long int _a1 asm("rdi") = (long)(inadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(60), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$ulwset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x3c,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$ulwset>:
mov    %edx,%edx
mov    $0x3c,%rax
int    $0x81
ret

LLVM IR (-O0):
%struct._va_range = type opaque
define i32 @"sys$ulwset"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = alloca %struct._va_range*
%5 = alloca %struct._va_range*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._va_range* %0, %struct._va_range** %4
store %struct._va_range* %1, %struct._va_range** %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
store i64 %13, i64* %8
%14 = load %struct._va_range*, %struct._va_range** %5
%15 = ptrtoint %struct._va_range* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._va_range*, %struct._va_range** %4
%17 = ptrtoint %struct._va_range* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 60, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._va_range = type opaque
define i32 @"sys$ulwset"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = ptrtoint %struct._va_range* %1 to i64
%6 = ptrtoint %struct._va_range* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 60, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
float sinf(float);
float cbuiltin_sinf(float x) { return sinf(x); }


x86 assembly (clang, -O0):
<cbuiltin_sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuiltin_sinf>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @cbuiltin_sinf(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ diagonalParse(int **, int, int);
int main() {
  int mat[4][2] = {{1, 2}, {3, 4}, {5, 6}, {7, 8}};
  diagonalParse(mat, 2, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <diagonalParse@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <diagonalParse@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.mat = [4 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4], [2 x i32] [i32 5, i32 6], [2 x i32] [i32 7, i32 8]]
define i32 @main() {
%1 = alloca [4 x [2 x i32]]
%2 = bitcast [4 x [2 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %1, i64 0, i64 0
%4 = bitcast [2 x i32]* %3 to i32**
%5 = call i32 @diagonalParse(i32** %4, i32 2, i32 4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mat = [4 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4], [2 x i32] [i32 5, i32 6], [2 x i32] [i32 7, i32 8]]
define i32 @main() {
%1 = alloca [4 x [2 x i32]]
%2 = bitcast [4 x [2 x i32]]* %1 to i8*
%3 = bitcast [4 x [2 x i32]]* %1 to i32**
%4 = call i32 @diagonalParse(i32** %3, i32 2, i32 4)
ret i32 0
}
void CursorBack(HowMuch) int HowMuch;
{
  char Str[10];
  if (HowMuch == 0)
    return;
  sprintf(Str, "\033[%dD", HowMuch);
  WRITETEST(Str);
}


x86 assembly (clang, -O0):
<CursorBack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <CursorBack+0x1a>
jmp    115a <CursorBack+0x3a>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CursorBack>:
test   %edi,%edi
je     1150 <CursorBack+0x30>
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xece(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dD\00"
define void @CursorBack(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dD\00"
define void @CursorBack(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %3)
br label %8
8: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mem_remap_top_384k();
int /*<<< orphan*/ ps1_common_init();
int /*<<< orphan*/ ps1mb_init();
void ps1_m2011_init() {
  ps1_common_init();
  ps1mb_init();
  mem_remap_top_384k();
}


x86 assembly (clang, -O0):
<ps1_m2011_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ps1_common_init@plt>
mov    $0x0,%al
call   1040 <ps1mb_init@plt>
mov    $0x0,%al
call   1030 <mem_remap_top_384k@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps1_m2011_init>:
push   %rax
xor    %eax,%eax
call   1050 <ps1_common_init@plt>
xor    %eax,%eax
call   1040 <ps1mb_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mem_remap_top_384k@plt>

LLVM IR (-O0):
define void @ps1_m2011_init() {
%1 = call i32 (...) @ps1_common_init()
%2 = call i32 (...) @ps1mb_init()
%3 = call i32 (...) @mem_remap_top_384k()
ret void
}

LLVM IR (-O2):
define void @ps1_m2011_init() {
%1 = tail call i32 (...) @ps1_common_init()
%2 = tail call i32 (...) @ps1mb_init()
%3 = tail call i32 (...) @mem_remap_top_384k()
ret void
}
void *test_anti_range_63(unsigned char n) {
  extern void *alloc_anti_range_63(unsigned char)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 0)
    n = 0 - 1;
  return alloc_anti_range_63(n);
}


x86 assembly (clang, -O0):
<test_anti_range_63>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     113d <test_anti_range_63+0x2d>
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jg     113d <test_anti_range_63+0x2d>
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_63@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_63>:
cmp    $0x1,%edi
sbb    %eax,%eax
or     %dil,%al
movzbl %al,%edi
jmp    1030 <alloc_anti_range_63@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_63(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8 -1, i8 %0
%4 = tail call i8* @alloc_anti_range_63(i8 zeroext %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ serial_putc(char, int);
void putDebugChar(char c) { serial_putc(c, 1 + 1); }


x86 assembly (clang, -O0):
<putDebugChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%esi
movsbl -0x1(%rbp),%edi
call   1030 <serial_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putDebugChar>:
mov    $0x2,%esi
jmp    1030 <serial_putc@plt>

LLVM IR (-O0):
define void @putDebugChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @serial_putc(i8 signext %3, i32 2)
ret void
}

LLVM IR (-O2):
define void @putDebugChar(i8 signext %0) {
%2 = tail call i32 @serial_putc(i8 signext %0, i32 2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t endian_fix32(uint32_t x) {
  return (x << 24) + ((x << 8) & 0xff0000) + ((x >> 8) & 0xff00) + (x >> 24);
}


x86 assembly (clang, -O0):
<endian_fix32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_fix32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @endian_fix32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = and i32 %6, 16711680
%8 = add nsw i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 %10, 65280
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 24
%15 = add nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @endian_fix32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int isakmp_validate_transform_id(u_int8_t proto, u_int8_t transform_id) {
  return -1;
}


x86 assembly (clang, -O0):
<isakmp_validate_transform_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isakmp_validate_transform_id(i32 %0, i32 %1) {
ret i32 -1
}
test_function(f, args, val) {}


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

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

LLVM IR (-O0):
define i32 @test_function(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_function(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void delayMicroseconds(unsigned int d) { usleep(d); }


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

x86 assembly (clang, -O2):
<delayMicroseconds>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @delayMicroseconds(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
void __attribute__((format(printf, 2, 3)))
udev_log_null(struct udev *udev, const char *format, ...) {}


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

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

LLVM IR (-O0):
%struct.udev = type opaque
define void @udev_log_null(%struct.udev* %0, i8* %1, ...) {
%3 = alloca %struct.udev*
%4 = alloca i8*
store %struct.udev* %0, %struct.udev** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.udev = type opaque
define void @udev_log_null(%struct.udev* nocapture %0, i8* nocapture %1, ...) {
ret void
}