xunge/DecIR huggingface dataset:
void int_fun(void) {}


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

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

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

LLVM IR (-O2):
define void @int_fun() {
ret void
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_getuid(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_getuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_getuid>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getuid(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getuid(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("powershell -executionpolicy bypass \"IEX (New-Object "
         "Net.WebClient).DownloadString('https://raw.githubusercontent.com/"
         "metalx1000/MyBin/master/games/mame/pacman/pacman.ps1'); \"");
}


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

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

LLVM IR (-O0):
@.str = [175 x i8] c"powershell -executionpolicy bypass \22IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/metalx1000/MyBin/master/games/mame/pacman/pacman.ps1'); \22\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [175 x i8] c"powershell -executionpolicy bypass \22IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/metalx1000/MyBin/master/games/mame/pacman/pacman.ps1'); \22\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void swap(int *nums, int m, int n) {
  int tmp = nums[m];
  nums[m] = nums[n];
  nums[n] = 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
}
void LL_LockEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @LL_LockEnd() {
ret void
}
void addvf(double *result, const double s1) {
  result[0] += s1;
  result[1] += s1;
  result[2] += s1;
}


x86 assembly (clang, -O0):
<addvf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addvf>:
movupd (%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
addpd  %xmm1,%xmm2
movupd %xmm2,(%rdi)
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @addvf(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fadd double %8, %5
store double %9, double* %7
%10 = load double, double* %4
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fadd double %13, %10
store double %14, double* %12
%15 = load double, double* %4
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = fadd double %18, %15
store double %19, double* %17
ret void
}

LLVM IR (-O2):
define void @addvf(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fadd <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fadd double %10, %1
store double %11, double* %9
ret void
}
int test_imm_BAuint8_reg(unsigned char val) {
  return ((val) & (-0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff46,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BAuint8_reg>:
test   $0x46,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BAuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 70
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
unsigned char stdin_lrc() {
  char count = 0;
  int c;
  while ((c = fgetc(stdin)) != EOF) {
    count += c;
  }
  return (unsigned char)(-count);
}


x86 assembly (clang, -O0):
<stdin_lrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     114d <stdin_lrc+0x3d>
mov    -0x8(%rbp),%ecx
movsbl -0x1(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    111c <stdin_lrc+0xc>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_lrc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2eca(%rip),%r14
mov    (%r14),%edi
call   1030 <fgetc@plt>
mov    0x2eb3(%rip),%r15
xor    %ebx,%ebx
cmp    (%r15),%eax
je     1157 <stdin_lrc+0x47>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ebp
add    %ebx,%ebp
movsbl %bpl,%ebx
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    (%r15),%eax
jne    1140 <stdin_lrc+0x30>
mov    %ebp,%ebx
neg    %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define zeroext i8 @stdin_lrc() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* @stdin
%5 = call i32 @fgetc(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i32, i32* %2
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, %9
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
br label %3
14: ; preds = %3
%15 = load i8, i8* %1
%16 = sext i8 %15 to i32
%17 = sub nsw i32 0, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define zeroext i8 @stdin_lrc() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %17, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %12, %5 ], [ %2, %0 ]
%7 = phi i32 [ %10, %5 ], [ 0, %0 ]
%8 = add nsw i32 %6, %7
%9 = shl i32 %8, 24
%10 = ashr exact i32 %9, 24
%11 = load i32, i32* @stdin
%12 = tail call i32 @fgetc(i32 %11)
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = trunc i32 %8 to i8
br label %17
17: ; preds = %15, %0
%18 = phi i8 [ 0, %0 ], [ %16, %15 ]
%19 = sub i8 0, %18
ret i8 %19
}
double foo(double a) {
  double tmp = 5.0;
  double tmp2 = a + tmp;
  tmp2 = tmp2 - a;
  return a + tmp2 - 5.0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 5.000000e+00, double* %3
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fadd double %5, %6
store double %7, double* %4
%8 = load double, double* %4
%9 = load double, double* %2
%10 = fsub double %8, %9
store double %10, double* %4
%11 = load double, double* %2
%12 = load double, double* %4
%13 = fadd double %11, %12
%14 = fsub double %13, 5.000000e+00
ret double %14
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fadd double %0, 5.000000e+00
%3 = fsub double %2, %0
%4 = fadd double %3, %0
%5 = fadd double %4, -5.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  i = 0;
  do {
    printf("\n%d %c", i, i);
    i++;
  } while (i < 255);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jl     1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%d %c\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 255
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
TEST(Term, hello) {}


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

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

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

LLVM IR (-O2):
define i32 @TEST(i32 %0, i32 %1) {
ret i32 undef
}
void g_type_check_value_holds() {}


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

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

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

LLVM IR (-O2):
define void @g_type_check_value_holds() {
ret void
}
/* Variables and functions */
int mprotect(void *addr, size_t len, int prot) { return -1; }


x86 assembly (clang, -O0):
<mprotect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mprotect(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @mprotect(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 -1
}
double mm2ptf(double x) { return x * 72 / 25.4; }


x86 assembly (clang, -O0):
<mm2ptf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm2ptf>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mm2ptf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 7.200000e+01
%5 = fdiv double %4, 2.540000e+01
ret double %5
}

LLVM IR (-O2):
define double @mm2ptf(double %0) {
%2 = fmul double %0, 7.200000e+01
%3 = fdiv double %2, 2.540000e+01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void print_usage() { exit(1); }


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @print_usage() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @print_usage() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int printargs(struct tcb *);
int sys_fstat64(struct tcb *tcp) { return printargs(tcp); }


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

x86 assembly (clang, -O2):
<sys_fstat64>:
jmp    1030 <printargs@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_fstat64(%struct.tcb* %0) {
%2 = tail call i32 @printargs(%struct.tcb* %0)
ret i32 %2
}
int t11(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @t11() {
ret i32 1
}

LLVM IR (-O2):
define i32 @t11() {
ret i32 1
}
/* Variables and functions */
int getch();
int inputch(void) { return (getch() & 0177); }


x86 assembly (clang, -O0):
<inputch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getch@plt>
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputch>:
push   %rax
xor    %eax,%eax
call   1030 <getch@plt>
and    $0x7f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @inputch() {
%1 = call i32 (...) @getch()
%2 = and i32 %1, 127
ret i32 %2
}

LLVM IR (-O2):
define i32 @inputch() {
%1 = tail call i32 (...) @getch()
%2 = and i32 %1, 127
ret i32 %2
}
int main(void) {
  int a;
  int b;
  if (&a >= &b) {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
lea    -0xc(%rbp),%rcx
cmp    %rcx,%rax
jb     1123 <main+0x23>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = icmp uge i32* %2, %3
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char is_blank(char c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<is_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_blank+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank>:
cmp    $0x20,%dil
sete   %cl
cmp    $0x9,%dil
sete   %al
or     %cl,%al
ret

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

LLVM IR (-O2):
define signext i8 @is_blank(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ putch(int);
void ascii(void) {
  int i;
  for (i = 0; i < 256; i++)
    putch(i);
}


x86 assembly (clang, -O0):
<ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1142 <ascii+0x32>
mov    -0x4(%rbp),%edi
call   1030 <putch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ascii+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <putch@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <ascii+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ascii() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @putch(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ascii() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @putch(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Type definitions */
struct lf_ordlist {
  int dummy;
};

/* Variables and functions */
void *lf_ordlist_cond_update(struct lf_ordlist *, int /*<<< orphan*/ *, void *);
void *lf_ordlist_add(struct lf_ordlist *lst, void *value) {
  return lf_ordlist_cond_update(lst, NULL, value);
}


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

x86 assembly (clang, -O2):
<lf_ordlist_add>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <lf_ordlist_cond_update@plt>

LLVM IR (-O0):
%struct.lf_ordlist = type { i32 }
define i8* @lf_ordlist_add(%struct.lf_ordlist* %0, i8* %1) {
%3 = alloca %struct.lf_ordlist*
%4 = alloca i8*
store %struct.lf_ordlist* %0, %struct.lf_ordlist** %3
store i8* %1, i8** %4
%5 = load %struct.lf_ordlist*, %struct.lf_ordlist** %3
%6 = load i8*, i8** %4
%7 = call i8* @lf_ordlist_cond_update(%struct.lf_ordlist* %5, i32* null, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.lf_ordlist = type { i32 }
define i8* @lf_ordlist_add(%struct.lf_ordlist* %0, i8* %1) {
%3 = tail call i8* @lf_ordlist_cond_update(%struct.lf_ordlist* %0, i32* null, i8* %1)
ret i8* %3
}
float sqrtf_babylonian(float x) {
  union {
    int i;
    float x;
  } u;
  u.x = x;
  u.i = (1 << 29) + (u.i >> 1) - (1 << 22);
  u.x = u.x + x / u.x;
  u.x = 0.25f * u.x + x / u.x;
  return u.x;
}


x86 assembly (clang, -O0):
<sqrtf_babylonian>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
add    $0x20000000,%eax
sub    $0x400000,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
movss  0xeab(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf_babylonian>:
movd   %xmm0,%eax
sar    %eax
add    $0x1fc00000,%eax
movd   %eax,%xmm1
movdqa %xmm0,%xmm2
divss  %xmm1,%xmm2
addss  %xmm1,%xmm2
divss  %xmm2,%xmm0
mulss  0xed9(%rip),%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @sqrtf_babylonian(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = add nsw i32 536870912, %8
%10 = sub nsw i32 %9, 4194304
%11 = bitcast %union.anon* %3 to i32*
store i32 %10, i32* %11
%12 = bitcast %union.anon* %3 to float*
%13 = load float, float* %12
%14 = load float, float* %2
%15 = bitcast %union.anon* %3 to float*
%16 = load float, float* %15
%17 = fdiv float %14, %16
%18 = fadd float %13, %17
%19 = bitcast %union.anon* %3 to float*
store float %18, float* %19
%20 = bitcast %union.anon* %3 to float*
%21 = load float, float* %20
%22 = load float, float* %2
%23 = bitcast %union.anon* %3 to float*
%24 = load float, float* %23
%25 = fdiv float %22, %24
%26 = call float @llvm.fmuladd.f32(float 2.500000e-01, float %21, float %25)
%27 = bitcast %union.anon* %3 to float*
store float %26, float* %27
%28 = bitcast %union.anon* %3 to float*
%29 = load float, float* %28
ret float %29
}

LLVM IR (-O2):
define float @sqrtf_babylonian(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = add nsw i32 %3, 532676608
%5 = bitcast i32 %4 to float
%6 = fdiv float %0, %5
%7 = fadd float %6, %5
%8 = fdiv float %0, %7
%9 = tail call float @llvm.fmuladd.f32(float %7, float 2.500000e-01, float %8)
ret float %9
}
struct s28 {
  int a;
  int b[];
} f28(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
%struct.s28 = type { i32, [0 x i32] }
define void @f28(%struct.s28* noalias sret(%struct.s28) align 4 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}

LLVM IR (-O2):
%struct.s28 = type { i32, [0 x i32] }
define void @f28(%struct.s28* noalias nocapture sret(%struct.s28) align 4 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ memmove(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
void path_basename(char *path) {
  char *new_path = basename(path);
  memmove(path, new_path, strlen(new_path) + 1);
}


x86 assembly (clang, -O0):
<path_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_basename>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <basename@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memmove@plt>

LLVM IR (-O0):
define void @path_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i32 @memmove(i8* %6, i8* %7, i64 %10)
ret void
}

LLVM IR (-O2):
define void @path_basename(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @memmove(i8* %0, i8* %2, i64 %4)
ret void
}
void exch3(int *a, int *b) {
  *a ^= *b;
  *b ^= *a;
  *a ^= *b;
}


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

x86 assembly (clang, -O2):
<exch3>:
mov    (%rdi),%eax
xor    (%rsi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @exch3(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = xor i32 %8, %6
store i32 %9, i32* %7
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = xor i32 %13, %11
store i32 %14, i32* %12
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = xor i32 %18, %16
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @exch3(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
unsigned npu_has_broken_slowport(void) {
  extern unsigned int processor_id;
  return (
      ((processor_id & 0xfffffff0) == 0x690541a0) ||
      (((processor_id & 0xfffffff0) == 0x69054190) && !(processor_id & 0xf)));
}


x86 assembly (clang, -O0):
<npu_has_broken_slowport>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
mov    $0x1,%al
cmp    $0x690541a0,%ecx
mov    %al,-0x1(%rbp)
je     115b <npu_has_broken_slowport+0x5b>
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
xor    %eax,%eax
cmp    $0x69054190,%ecx
mov    %al,-0x2(%rbp)
jne    1155 <npu_has_broken_slowport+0x55>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<npu_has_broken_slowport>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
and    $0xfffffff0,%ecx
cmp    $0x690541a0,%ecx
sete   %cl
cmp    $0x69054190,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
@processor_id = external global i32
define i32 @npu_has_broken_slowport() {
%1 = load i32, i32* @processor_id
%2 = and i32 %1, -16
%3 = icmp eq i32 %2, 1761952160
br i1 %3, label %15, label %4
4: ; preds = %0
%5 = load i32, i32* @processor_id
%6 = and i32 %5, -16
%7 = icmp eq i32 %6, 1761952144
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* @processor_id
%10 = and i32 %9, 15
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br label %13
13: ; preds = %8, %4
%14 = phi i1 [ false, %4 ], [ %12, %8 ]
br label %15
15: ; preds = %13, %0
%16 = phi i1 [ true, %0 ], [ %14, %13 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@processor_id = external global i32
define i32 @npu_has_broken_slowport() {
%1 = load i32, i32* @processor_id
%2 = and i32 %1, -16
%3 = icmp eq i32 %2, 1761952160
%4 = icmp eq i32 %1, 1761952144
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned int ick_smudgeright(unsigned int x) {
  x = x | (x >> 1);
  x = x | (x >> 2);
  x = x | (x >> 4);
  x = x | (x >> 8);
  x = x | (x >> 18);
  return x;
}


x86 assembly (clang, -O0):
<ick_smudgeright>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x12,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ick_smudgeright>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x12,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ick_smudgeright(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 18
%11 = or i32 %10, %9
ret i32 %11
}
void INT_Excep_LVD_LVD1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_LVD_LVD1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int exitFromHere(char args[128]) {
  printf("I am in exit\n");
  return -2;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"I am in exit\0A\00"
define i32 @exitFromHere(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 -2
}

LLVM IR (-O2):
@str = [13 x i8] c"I am in exit\00"
define i32 @exitFromHere(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 -2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int iface1_constructor(void *context) {
  printf("B - version 0 constructor context %p\n", context);
  return (0);
}


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

x86 assembly (clang, -O2):
<iface1_constructor>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"B - version 0 constructor context %p\0A\00"
define i32 @iface1_constructor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"B - version 0 constructor context %p\0A\00"
define i32 @iface1_constructor(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int __send_to_ppe(int, int, int *);
int dup(int oldfd) { return __send_to_ppe(0x2101, 30, &oldfd); }


x86 assembly (clang, -O0):
<dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2101,%edi
mov    $0x1e,%esi
lea    -0x4(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x2101,%edi
mov    $0x1e,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 30, i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 30, i32* %2)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_bin(const uint64_t value, int minbits, int maxbits) {
  for (int bit = maxbits; bit >= minbits; bit--) {
    if (value & ((uint64_t)1 << bit)) {
      putchar('1');
    } else {
      putchar('0');
    }
  }
}


x86 assembly (clang, -O0):
<print_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1179 <print_bin+0x69>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115c <print_bin+0x4c>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    1166 <print_bin+0x56>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    116b <print_bin+0x5b>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <print_bin+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bin>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edx
jl     113a <print_bin+0x2a>
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
nop
bt     %ebx,%r14d
mov    $0x31,%edi
adc    $0xffffffff,%edi
call   1030 <putchar@plt>
lea    -0x1(%rbx),%eax
cmp    %ebp,%ebx
mov    %eax,%ebx
jg     1120 <print_bin+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @print_bin(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* %6
store i32 %8, i32* %7
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %7
%16 = shl i32 1, %15
%17 = and i32 %14, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 @putchar(i8 signext 49)
br label %23
21: ; preds = %13
%22 = call i32 @putchar(i8 signext 48)
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23
%25 = load i32, i32* %7
%26 = add nsw i32 %25, -1
store i32 %26, i32* %7
br label %9
27: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @print_bin(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ %2, %3 ]
%8 = shl nuw i32 1, %7
%9 = and i32 %8, %0
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8 48, i8 49
%12 = tail call i32 @putchar(i8 signext %11)
%13 = add nsw i32 %7, -1
%14 = icmp sgt i32 %7, %1
br i1 %14, label %6, label %5
}
int SacarDato(int ind_c) {
  extern vector[100];
  return vector[ind_c];
}


x86 assembly (clang, -O0):
<SacarDato>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ed6(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SacarDato>:
movslq %edi,%rax
mov    0x2ede(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@vector = external global [100 x i32]
define i32 @SacarDato(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [100 x i32], [100 x i32]* @vector, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
@vector = external global [100 x i32]
define i32 @SacarDato(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [100 x i32], [100 x i32]* @vector, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int main() {
  open("fjfjfj", 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"fjfjfj\00"
define i32 @main() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int y_w;
typedef int x_w;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetTextSpace(unsigned char x_w, unsigned char y_w) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x43) & 0xFF);
  SendChar((x_w)&0xFF);
  SendChar((y_w)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetTextSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x43,%edi
call   1030 <SendChar@plt>
movzbl -0x1(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzbl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTextSpace>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x43,%edi
call   1030 <SendChar@plt>
mov    %ebp,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetTextSpace(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 @SendChar(i32 238)
%6 = call i32 @SendChar(i32 67)
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = and i32 %8, 255
%10 = call i32 @SendChar(i32 %9)
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = and i32 %12, 255
%14 = call i32 @SendChar(i32 %13)
%15 = call i32 @SendChar(i32 255)
%16 = call i32 @SendChar(i32 252)
%17 = call i32 @SendChar(i32 255)
%18 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetTextSpace(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @SendChar(i32 238)
%4 = tail call i32 @SendChar(i32 67)
%5 = zext i8 %0 to i32
%6 = tail call i32 @SendChar(i32 %5)
%7 = zext i8 %1 to i32
%8 = tail call i32 @SendChar(i32 %7)
%9 = tail call i32 @SendChar(i32 255)
%10 = tail call i32 @SendChar(i32 252)
%11 = tail call i32 @SendChar(i32 255)
%12 = tail call i32 @SendChar(i32 255)
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ sram_write_u8(int /*<<< orphan*/ *, int);
void sram_write_u16(FILE *file, uint16_t value) {
  sram_write_u8(file, value >> 8);
  sram_write_u8(file, value & 0xFF);
}


x86 assembly (clang, -O0):
<sram_write_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
call   1030 <sram_write_u8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <sram_write_u8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sram_write_u16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
sar    $0x8,%esi
call   1030 <sram_write_u8@plt>
movzbl %bl,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sram_write_u8@plt>

LLVM IR (-O0):
define void @sram_write_u16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 8
%8 = call i32 @sram_write_u8(i32* %5, i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = call i32 @sram_write_u8(i32* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @sram_write_u16(i32* %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = tail call i32 @sram_write_u8(i32* %0, i32 %3)
%5 = and i32 %1, 255
%6 = tail call i32 @sram_write_u8(i32* %0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void print_hex(const char *s) {
  while (*s)
    printf("%02x", (unsigned int)*s++);
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <print_hex+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    111c <print_hex+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <print_hex+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_hex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_hex(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void check(x) int x;
{
  if (!x)
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <check+0x1a>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1115 <check+0x5>
ret
push   %rax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @check(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret void
}
void swift_getGenericMetadata(void) {}


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

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

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

LLVM IR (-O2):
define void @swift_getGenericMetadata() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void serial_free_line(char *line) { free(line); }


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

x86 assembly (clang, -O2):
<serial_free_line>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @serial_free_line(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}