xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int validMountainArray(int *, int);
int main(int argc, char **argv) {
  int list[] = {1, 3, 2};
  bool is = validMountainArray(list, 3);
  if (is) {
    printf("yes\n");
  } else {
    printf("no\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
call   1040 <validMountainArray@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1176 <main+0x56>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    1182 <main+0x62>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1040 <validMountainArray@plt>
test   %eax,%eax
lea    0xeba(%rip),%rax
lea    0xeb6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.list = [3 x i32] [i32 1, i32 3, i32 2]
@str = [3 x i8] c"no\00"
@str.2 = [4 x i8] c"yes\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = call i32 @validMountainArray(i32* %5, i32 3)
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test1(double);
int /*<<< orphan*/ test1f(float);
int /*<<< orphan*/ test1l(long double);
int /*<<< orphan*/ test2(double, double);
int /*<<< orphan*/ test2f(float, float);
int /*<<< orphan*/ test2l(long double, long double);
int main() {
  test1(1.0);
  test2(1.0, 2.0);
  test1f(1.0f);
  test2f(1.0f, 2.0f);
  test1l(1.0l);
  test2l(1.0l, 2.0l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe91(%rip),%xmm0
call   1030 <test1@plt>
movsd  0xe84(%rip),%xmm0
movsd  0xe84(%rip),%xmm1
call   1060 <test2@plt>
movss  0xe6b(%rip),%xmm0
call   1050 <test1f@plt>
movss  0xe5e(%rip),%xmm0
movss  0xe52(%rip),%xmm1
call   1070 <test2f@plt>
mov    %rsp,%rax
fld1
fstpt  (%rax)
call   1040 <test1l@plt>
mov    %rsp,%rax
flds   0xe38(%rip)
fstpt  0x10(%rax)
fld1
fstpt  (%rax)
call   1080 <test2l@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movsd  0xe94(%rip),%xmm0
call   1030 <test1@plt>
movsd  0xe8f(%rip),%xmm1
movsd  0xe7f(%rip),%xmm0
call   1060 <test2@plt>
movss  0xe82(%rip),%xmm0
call   1050 <test1f@plt>
movss  0xe79(%rip),%xmm1
movss  0xe6d(%rip),%xmm0
call   1070 <test2f@plt>
fld1
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
call   1040 <test1l@plt>
flds   0xe56(%rip)
fstpt  0x10(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
call   1080 <test2l@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test1(double 1.000000e+00)
%3 = call i32 @test2(double 1.000000e+00, double 2.000000e+00)
%4 = call i32 @test1f(float 1.000000e+00)
%5 = call i32 @test2f(float 1.000000e+00, float 2.000000e+00)
%6 = call i32 @test1l(x86_fp80 0xK3FFF8000000000000000)
%7 = call i32 @test2l(x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK40008000000000000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test1(double 1.000000e+00)
%2 = tail call i32 @test2(double 1.000000e+00, double 2.000000e+00)
%3 = tail call i32 @test1f(float 1.000000e+00)
%4 = tail call i32 @test2f(float 1.000000e+00, float 2.000000e+00)
%5 = tail call i32 @test1l(x86_fp80 0xK3FFF8000000000000000)
%6 = tail call i32 @test2l(x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK40008000000000000000)
ret i32 0
}
MF(par_f) { err(16); }


x86 assembly (clang, -O0):
<MF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x10,%edi
mov    $0x0,%al
call   1030 <err@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MF>:
mov    $0x10,%edi
xor    %eax,%eax
jmp    1030 <err@plt>

LLVM IR (-O0):
define i32 @MF(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @err to i32 (i32, ...)*)(i32 16)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @MF(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @err to i32 (i32, ...)*)(i32 16)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
void main() {
  char cadena[5];
  puts("Escriba un texto:");
  fgets(cadena, sizeof cadena, stdin);
  puts("El texto escrito es:");
  puts(cadena);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    -0x5(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%esi
call   1040 <fgets@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    -0x5(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <fgets@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Escriba un texto:\00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"El texto escrito es:\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 5, i32 %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Escriba un texto:\00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"El texto escrito es:\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 5, i32 %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @puts(i8* %2)
ret void
}
int mymax(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<mymax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <mymax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <mymax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @mymax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @mymax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ print_net(double *);
int main() {
  double *MLP = (double *)malloc(10 * (5 + 1) * (5 + 4) * sizeof(double));
  init(MLP);
  print_net(MLP);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10e0,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <init@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print_net@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10e0,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <init@plt>
mov    %rbx,%rdi
call   1030 <print_net@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4320)
%4 = inttoptr i64 %3 to double*
store double* %4, double** %2
%5 = load double*, double** %2
%6 = call i32 @init(double* %5)
%7 = load double*, double** %2
%8 = call i32 @print_net(double* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4320)
%2 = inttoptr i64 %1 to double*
%3 = tail call i32 @init(double* %2)
%4 = tail call i32 @print_net(double* %2)
ret i32 0
}
void avcodec_descriptor_get() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_descriptor_get() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void bar_write32(uint32_t bar, uint32_t offset, uint32_t value) {
  volatile uint32_t *preg = (volatile uint32_t *)(bar | (offset & 0xFF));
  *preg = value;
}


x86 assembly (clang, -O0):
<bar_write32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_write32>:
movzbl %sil,%eax
or     %edi,%eax
cltq
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @bar_write32(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 = and i32 %9, 255
%11 = or i32 %8, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %7
%14 = load i32, i32* %6
%15 = load i32*, i32** %7
store volatile i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @bar_write32(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = or i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %2, i32* %7
ret void
}
/* Type definitions */
struct minix2_inode {
  int dummy;
};

/* Variables and functions */
int mx_read_write_inode(int, int, struct minix2_inode *, int);
int mx_write_inode(int device, int i, struct minix2_inode *inodeptr) {
  return mx_read_write_inode(device, i, inodeptr, 1);
}


x86 assembly (clang, -O0):
<mx_write_inode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <mx_read_write_inode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_write_inode>:
mov    $0x1,%ecx
jmp    1030 <mx_read_write_inode@plt>

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

LLVM IR (-O2):
%struct.minix2_inode = type { i32 }
define i32 @mx_write_inode(i32 %0, i32 %1, %struct.minix2_inode* %2) {
%4 = tail call i32 @mx_read_write_inode(i32 %0, i32 %1, %struct.minix2_inode* %2, i32 1)
ret i32 %4
}
void insb(unsigned short port, void *addr, unsigned long count) {
  asm volatile("rep ; ins"
               "b"
               : "=D"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
rep insb (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
const char *lookup_name(const char **names, int size, int value) {
  return (value >= 0 && value < size) ? names[value] : NULL;
}


x86 assembly (clang, -O0):
<lookup_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1139 <lookup_name+0x39>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1139 <lookup_name+0x39>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
jmp    1144 <lookup_name+0x44>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1144 <lookup_name+0x44>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_name>:
xor    %eax,%eax
test   %edx,%edx
js     1110 <lookup_name+0x10>
cmp    %esi,%edx
jge    1110 <lookup_name+0x10>
mov    %edx,%eax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i8* @lookup_name(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %3
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8**, i8*** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
br label %20
19: ; preds = %9, %3
br label %20
20: ; preds = %19, %13
%21 = phi i8* [ %18, %13 ], [ null, %19 ]
ret i8* %21
}

LLVM IR (-O2):
define i8* @lookup_name(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, -1
%5 = icmp slt i32 %2, %1
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = zext i32 %2 to i64
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
br label %11
11: ; preds = %3, %7
%12 = phi i8* [ %10, %7 ], [ null, %3 ]
ret i8* %12
}
void cli(void) { *(int *)0x80001104 = 0; }


x86 assembly (clang, -O0):
<cli>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80001104,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli>:
mov    $0x80001104,%eax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @cli() {
store i32 0, i32* inttoptr (i64 2147488004 to i32*)
ret void
}

LLVM IR (-O2):
define void @cli() {
store i32 0, i32* inttoptr (i64 2147488004 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *spoji(char *, char *);
int main() {
  char s1[] = "Cao, cao, vozdrica";
  char s2[] = " cickovo ulje, kosica.";
  printf("%s", spoji(s1, s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0xe(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x2c(%rbp)
mov    0xead(%rip),%al
mov    %al,-0x2a(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <spoji@plt>
mov    %rax,%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x616369,0xf(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x2e616369736f6b,%rax
mov    %rax,0x2f(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1030 <spoji@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [19 x i8] c"Cao, cao, vozdrica\00"
@__const.main.s2 = [23 x i8] c" cickovo ulje, kosica.\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [19 x i8]
%3 = alloca [23 x i8]
store i32 0, i32* %1
%4 = bitcast [19 x i8]* %2 to i8*
%5 = bitcast [23 x i8]* %3 to i8*
%6 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [23 x i8], [23 x i8]* %3, i64 0, i64 0
%8 = call i8* @spoji(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [19 x i8] c"Cao, cao, vozdrica\00"
@__const.main.s2 = [23 x i8] c" cickovo ulje, kosica.\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [19 x i8]
%2 = alloca [23 x i8]
%3 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%5 = call i8* @spoji(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int f71(int *);
int f72(int *p) { return f71(p); }


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

x86 assembly (clang, -O2):
<f72>:
jmp    1030 <f71@plt>

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

LLVM IR (-O2):
define i32 @f72(i32* %0) {
%2 = tail call i32 @f71(i32* %0)
ret i32 %2
}
void limpar(char v[3][3]) {
  int i, j;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++)
      v[i][j] = ' ';
}


x86 assembly (clang, -O0):
<limpar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1162 <limpar+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    114f <limpar+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <limpar+0x20>
jmp    1154 <limpar+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <limpar+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpar>:
movabs $0x2020202020202020,%rax
20 20 20
mov    %rax,(%rdi)
movb   $0x20,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @limpar([3 x i8]* nocapture writeonly %0) {
%2 = getelementptr [3 x i8], [3 x i8]* %0, i64 0, i64 0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int print_a_message(const char *msg) {
  printf("A STRING %s\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<print_a_message>:
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):
<print_a_message>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"A STRING %s\0A\00"
define i32 @print_a_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x47() {
  Assert_real((isalnum(71)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              360, ("isalnum should be 1 for G"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x47>:
push   %rbp
mov    %rsp,%rbp
mov    $0x47,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x168,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x47>:
push   %rax
mov    $0x47,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x168,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for G\00"
define void @t_isalnum_0x47() {
%1 = call i32 @isalnum(i32 71)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for G\00"
define void @t_isalnum_0x47() {
%1 = tail call i32 @isalnum(i32 71)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void csi_cache_disable_profile(void) { ; }


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

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

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

LLVM IR (-O2):
define void @csi_cache_disable_profile() {
ret void
}
int compseq(char s[]) {
  int i = 0;
  char *p = s;
  while (*p++ != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<compseq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <compseq+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <compseq+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compseq>:
cmpb   $0x0,(%rdi)
je     111c <compseq+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <compseq+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @compseq(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
float media(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  float res;
  printf("Quantos floats irão ser dados? ");
  scanf("%d", &a);
  res = media(a);
  printf("A média é: %.2f\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <media@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <media@plt>
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Quantos floats ir\C3\A3o ser dados? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"A m\C3\A9dia \C3\A9: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call float @media(i32 %6)
store float %7, float* %3
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Quantos floats ir\C3\A3o ser dados? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"A m\C3\A9dia \C3\A9: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call float @media(i32 %5)
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ log_message(char const *, int, char const *, char *);
void *rlc_alloc(const char *filename, int line, const char *function,
                int size) {
  void *ptr;
  ptr = calloc(size, 1);
  if (NULL == ptr) {
    log_message(filename, line, function, "get memory error");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<rlc_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    116a <rlc_alloc+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe9b(%rip),%rcx
call   1040 <log_message@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlc_alloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbp
mov    %ecx,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <rlc_alloc+0x39>
lea    0xeb5(%rip),%rcx
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
call   1040 <log_message@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"get memory error\00"
define i8* @rlc_alloc(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = call i8* @calloc(i32 %10, i32 1)
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = icmp eq i8* null, %12
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = load i8*, i8** %7
%18 = call i32 @log_message(i8* %15, i32 %16, i8* %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %14, %4
%20 = load i8*, i8** %9
ret i8* %20
}

LLVM IR (-O2):
@.str = [17 x i8] c"get memory error\00"
define noalias i8* @rlc_alloc(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @calloc(i32 %3, i32 1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @log_message(i8* %0, i32 %1, i8* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printCommand();
int /*<<< orphan*/ printData();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readGPS(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void *MyGPS(int *fd) {
  while (1) {
    readGPS(*fd);
    printf("====================================================\n");
    printCommand();
    printData();
    sleep(1);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<MyGPS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1070 <readGPS@plt>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <printCommand@plt>
mov    $0x0,%al
call   1060 <printData@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    116c <MyGPS+0xc>

x86 assembly (clang, -O2):
<MyGPS>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xe91(%rip),%r14
mov    0x2e6a(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1070 <readGPS@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <printCommand@plt>
xor    %eax,%eax
call   1060 <printData@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    (%r15),%edi
call   1050 <fflush@plt>
jmp    1180 <MyGPS+0x20>

LLVM IR (-O0):
@.str = [54 x i8] c"====================================================\0A\00"
@stdout = global i32 0
define i8* @MyGPS(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %1, %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @readGPS(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @printCommand()
%9 = call i32 (...) @printData()
%10 = call i32 @sleep(i32 1)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
br label %3
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [53 x i8] c"====================================================\00"
define noalias i8* @MyGPS(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = load i32, i32* %0
%4 = tail call i32 @readGPS(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @printCommand()
%7 = tail call i32 (...) @printData()
%8 = tail call i32 @sleep(i32 1)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
br label %2
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int memcmp(int /*<<< orphan*/, char *, int);
int myfilter(const struct dirent *d) { return memcmp(d->d_name, ".", 1); }


x86 assembly (clang, -O0):
<myfilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x1,%edx
call   1030 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfilter>:
mov    (%rdi),%edi
lea    0xee7(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @myfilter(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @memcmp(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @myfilter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @memcmp(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %4
}
newpage(n) { return n; }


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

x86 assembly (clang, -O2):
<newpage>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @newpage(i32 returned %0) {
ret i32 %0
}
double rossler_event(int evtId, double t, double *Y, int n, double *pars) {
  return t - pars[3];
}


x86 assembly (clang, -O0):
<rossler_event>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
subsd  0x18(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rossler_event>:
subsd  0x18(%rcx),%xmm0
ret

LLVM IR (-O0):
define double @rossler_event(i32 %0, double %1, double* %2, i32 %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca i32
%10 = alloca double*
store i32 %0, i32* %6
store double %1, double* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double* %4, double** %10
%11 = load double, double* %7
%12 = load double*, double** %10
%13 = getelementptr inbounds double, double* %12, i64 3
%14 = load double, double* %13
%15 = fsub double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @rossler_event(i32 %0, double %1, double* nocapture readnone %2, i32 %3, double* nocapture %4) {
%6 = getelementptr inbounds double, double* %4, i64 3
%7 = load double, double* %6
%8 = fsub double %1, %7
ret double %8
}
void __ompc_mfence() { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @__ompc_mfence() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @__ompc_mfence() {
fence seq_cst
ret void
}
OP(dd, f0) {
  illegal_1();
  op_f0();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_f0()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f0()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfreenull(void **ptr) {
  if (!ptr)
    return;
  if (*ptr) {
    free(*ptr);
    *ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<xfreenull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <xfreenull+0x1c>
jmp    1151 <xfreenull+0x41>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1151 <xfreenull+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfreenull>:
push   %rbx
test   %rdi,%rdi
je     112d <xfreenull+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <xfreenull+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @xfreenull(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %1, %6, %3
ret void
}
void gtia_transfer_nothing(void) {}


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

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

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

LLVM IR (-O2):
define void @gtia_transfer_nothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void bun() { foo(); }


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

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

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

LLVM IR (-O2):
define void @bun() {
%1 = tail call i32 (...) @foo()
ret void
}
void R_EndDebugUtilsLabel() {}


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

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

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

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

/* Variables and functions */
struct event_base *event_init();
int /*<<< orphan*/ setenv(char *, char *, int);
struct event_base *osdep_event_init(void) {
  setenv("EVENT_NOKQUEUE", "1", 1);
  setenv("EVENT_NOPOLL", "1", 1);
  return (event_init());
}


x86 assembly (clang, -O0):
<osdep_event_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedd(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    0xece(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    $0x0,%al
call   1040 <event_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<osdep_event_init>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xee0(%rip),%rbx
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <event_init@plt>

LLVM IR (-O0):
%struct.event_base = type { i32 }
@.str = [15 x i8] c"EVENT_NOKQUEUE\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [13 x i8] c"EVENT_NOPOLL\00"
define %struct.event_base* @osdep_event_init() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call %struct.event_base* (...) @event_init()
ret %struct.event_base* %3
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
@.str = [15 x i8] c"EVENT_NOKQUEUE\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [13 x i8] c"EVENT_NOPOLL\00"
define %struct.event_base* @osdep_event_init() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call %struct.event_base* (...) @event_init()
ret %struct.event_base* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char x;
  scanf("%c", &x);
  if ('x' >= 65 && 'x' <= 90) {
    printf("Capital Letter");
  } else if ('x' >= 48 && 'x' <= 57) {
    printf("Digit");
  } else if ('x' >= 97 && 'x' <= 122) {
    printf("Small Letter");
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [13 x i8] c"Small Letter\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void ac_init_stat(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ __syscall(int, char const *, struct stat *, int, int /*<<< orphan*/,
                     int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int lstat(const char *path, struct stat *buf) {
  return (int)__syscall(6, (path), (buf), (1), (0), (0), (0), (0), (0));
}


x86 assembly (clang, -O0):
<lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x6,%edi
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <__syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
sub    $0x8,%rsp
mov    $0x6,%edi
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
call   1030 <__syscall@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i64 @__syscall(i32 6, i8* %5, %struct.stat* %6, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = tail call i64 @__syscall(i32 6, i8* %0, %struct.stat* %1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int bar(int x, int y) { return x - y; }


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

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @bar(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}