xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ *strcasestr(char const *, char *);
bool is_pnor_part(const char *str) { return strcasestr(str, "pnor") != NULL; }


x86 assembly (clang, -O0):
<is_pnor_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasestr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pnor_part>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasestr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"pnor\00"
define i32 @is_pnor_part(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @strcasestr(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"pnor\00"
define i32 @is_pnor_part(i8* %0) {
%2 = tail call i32* @strcasestr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getCwdTest();
int main() {
  getCwdTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getCwdTest()
ret i32 0
}
/* Variables and functions */
int syscall_dup2(int, int);
int dup2(int fd, int fd2) { return syscall_dup2(fd, fd2); }


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

x86 assembly (clang, -O2):
<dup2>:
jmp    1030 <syscall_dup2@plt>

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

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 @syscall_dup2(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void rte_mov128(uint8_t *dst, const uint8_t *src) { memcpy(dst, src, 128); }


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

x86 assembly (clang, -O2):
<rte_mov128>:
mov    $0x80,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @rte_mov128(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 = call i32 @memcpy(i32* %5, i32* %6, i32 128)
ret void
}

LLVM IR (-O2):
define void @rte_mov128(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appear_tabs_and_backslashes();
int main(int argc, char const *argv[]) {
  appear_tabs_and_backslashes();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @appear_tabs_and_backslashes()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @appear_tabs_and_backslashes()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *);
void warm(const char *war_msg) {
  printf("%s: %s\n", "[\033[34mWARNING\033[0m]", war_msg);
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [19 x i8] c"[\1B[34mWARNING\1B[0m]\00"
define void @warm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [19 x i8] c"[\1B[34mWARNING\1B[0m]\00"
define void @warm(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SNAPSHOT_UNFREEZE;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int unfreeze(int dev) { return ioctl(dev, SNAPSHOT_UNFREEZE, 0); }


x86 assembly (clang, -O0):
<unfreeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unfreeze>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@SNAPSHOT_UNFREEZE = global i32 0
define i32 @unfreeze(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SNAPSHOT_UNFREEZE
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@SNAPSHOT_UNFREEZE = global i32 0
define i32 @unfreeze(i32 %0) {
%2 = load i32, i32* @SNAPSHOT_UNFREEZE
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, int);
void errorInternal(int n) { error("%d (internal)\n", n); }


x86 assembly (clang, -O0):
<errorInternal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorInternal>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d (internal)\0A\00"
define void @errorInternal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d (internal)\0A\00"
define void @errorInternal(i32 %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmp2();
int cmp1(const void *foo, const void *bar) {
  cmp2();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @cmp1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @cmp2()
ret i32 0
}

LLVM IR (-O2):
define i32 @cmp1(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @cmp2()
ret i32 0
}
float vsphere(float a) {
  float b = 4 / 3;
  return (b * 3.141592 * a * a * a);
}


x86 assembly (clang, -O0):
<vsphere>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsphere>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @vsphere(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 1.000000e+00, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fmul double %5, 0x400921FAFC8B007A
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fmul double %9, %11
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fmul double %12, %14
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @vsphere(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FAFC8B007A
%4 = fmul double %3, %2
%5 = fmul double %4, %2
%6 = fptrunc double %5 to float
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int errno;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int ftruncate(int /*<<< orphan*/, int);
int tosStdio_truncate(FILE *file, int truncPos) {
  int res = 0;
  res = ftruncate(fileno(file), truncPos);
  if (res) {
    errno = res;
    res = -1;
  }
  return res;
}


x86 assembly (clang, -O0):
<tosStdio_truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1169 <tosStdio_truncate+0x49>
mov    -0x10(%rbp),%ecx
mov    0x2e80(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosStdio_truncate>:
push   %rbx
mov    %esi,%ebx
call   1040 <fileno@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <ftruncate@plt>
test   %eax,%eax
je     1145 <tosStdio_truncate+0x25>
mov    0x2ea4(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @tosStdio_truncate(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call i32 @ftruncate(i32 %3, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %2
store i32 %4, i32* @errno
br label %7
7: ; preds = %6, %2
%8 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_add(uintptr_t, uintptr_t, uintptr_t);
void fiat_poly1305_add(uint64_t out1[3], const uint64_t arg1[3],
                       const uint64_t arg2[3]) {
  internal_fiat_poly1305_add((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_poly1305_add>:
jmp    1030 <internal_fiat_poly1305_add@plt>

LLVM IR (-O0):
define void @fiat_poly1305_add(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_poly1305_add(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_poly1305_add(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_poly1305_add(i64 %4, i64 %5, i64 %6)
ret void
}
char desconversor(int l) {
  char letra;
  switch (l) {
  case 1:
    letra = 'A';
    break;
  case 2:
    letra = 'B';
    break;
  case 3:
    letra = 'C';
    break;
  case 4:
    letra = 'D';
    break;
  case 5:
    letra = 'E';
    break;
  case 6:
    letra = 'F';
    break;
  }
  return (letra);
}


x86 assembly (clang, -O0):
<desconversor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1161 <desconversor+0x61>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x5(%rbp)
jmp    1161 <desconversor+0x61>
movb   $0x42,-0x5(%rbp)
jmp    1161 <desconversor+0x61>
movb   $0x43,-0x5(%rbp)
jmp    1161 <desconversor+0x61>
movb   $0x44,-0x5(%rbp)
jmp    1161 <desconversor+0x61>
movb   $0x45,-0x5(%rbp)
jmp    1161 <desconversor+0x61>
movb   $0x46,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<desconversor>:
add    $0xfffffffe,%edi
lea    0x42(%rdi),%eax
cmp    $0x5,%edi
movzbl %al,%ecx
mov    $0x41,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @desconversor(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
]
5: ; preds = %1
store i8 65, i8* %3
br label %11
6: ; preds = %1
store i8 66, i8* %3
br label %11
7: ; preds = %1
store i8 67, i8* %3
br label %11
8: ; preds = %1
store i8 68, i8* %3
br label %11
9: ; preds = %1
store i8 69, i8* %3
br label %11
10: ; preds = %1
store i8 70, i8* %3
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5
%12 = load i8, i8* %3
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @desconversor(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 5
%4 = trunc i32 %2 to i8
%5 = add i8 %4, 66
%6 = select i1 %3, i8 %5, i8 65
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ free(char *);
char *gdp_files_getstring(int /*<<< orphan*/ *, char *);
int gdp_files_getint(FILE *fFile, char *cParameter) {
  char *charToInt = " ";
  int nRet = 0;
  charToInt = gdp_files_getstring(fFile, cParameter);
  nRet = atoi(charToInt);
  free(charToInt);
  return nRet;
}


x86 assembly (clang, -O0):
<gdp_files_getint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <gdp_files_getstring@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdp_files_getint>:
push   %rbp
push   %rbx
push   %rax
call   1040 <gdp_files_getstring@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @gdp_files_getint(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5
store i32 0, i32* %6
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i8* @gdp_files_getstring(i32* %7, i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @gdp_files_getint(i32* %0, i8* %1) {
%3 = tail call i8* @gdp_files_getstring(i32* %0, i8* %1)
%4 = tail call i32 @atoi(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 %4
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ printf(char *, char *, char *);
int usage(char **argv) {
  printf("Usage: %s [OPTION] -f APPNAME [USERNAME]\t find the strong password\n"
         "   or: %s [OPTION] -g APPNAME USERNAME  \t generate the strong "
         "password\n"
         "\t-l, --list \t list all the app and password \n",
         argv[0], argv[0]);
  return EXIT_FAILURE;
}


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

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

LLVM IR (-O0):
@.str = [184 x i8] c"Usage: %s [OPTION] -f APPNAME [USERNAME]\09 find the strong password\0A or: %s [OPTION] -g APPNAME USERNAME \09 generate the strong password\0A\09-l, --list \09 list all the app and password \0A\00"
@EXIT_FAILURE = global i32 0
define i32 @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
ret i32 %10
}

LLVM IR (-O2):
@.str = [184 x i8] c"Usage: %s [OPTION] -f APPNAME [USERNAME]\09 find the strong password\0A or: %s [OPTION] -g APPNAME USERNAME \09 generate the strong password\0A\09-l, --list \09 list all the app and password \0A\00"
@EXIT_FAILURE = global i32 0
define i32 @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
FILE *fileno2FILE(int fileno) {
  switch (fileno) {
  case 0:
    return stdin;
  case 1:
    return stdout;
  case 2:
    return stderr;
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<fileno2FILE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <fileno2FILE+0x3c>
jmp    111a <fileno2FILE+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114f <fileno2FILE+0x4f>
jmp    112b <fileno2FILE+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1162 <fileno2FILE+0x62>
jmp    1175 <fileno2FILE+0x75>
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <fileno2FILE+0x7d>
mov    0x2e7a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <fileno2FILE+0x7d>
mov    0x2e6f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <fileno2FILE+0x7d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileno2FILE>:
cmp    $0x2,%edi
je     1119 <fileno2FILE+0x19>
cmp    $0x1,%edi
je     1124 <fileno2FILE+0x24>
test   %edi,%edi
jne    112f <fileno2FILE+0x2f>
mov    0x2ed3(%rip),%rax
mov    (%rax),%rax
ret
mov    0x2eb8(%rip),%rax
mov    (%rax),%rax
ret
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
@stderr = global i32* null
define i32* @fileno2FILE(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 0, label %5
i32 1, label %7
i32 2, label %9
]
5: ; preds = %1
%6 = load i32*, i32** @stdin
store i32* %6, i32** %2
br label %12
7: ; preds = %1
%8 = load i32*, i32** @stdout
store i32* %8, i32** %2
br label %12
9: ; preds = %1
%10 = load i32*, i32** @stderr
store i32* %10, i32** %2
br label %12
11: ; preds = %1
store i32* null, i32** %2
br label %12
12: ; preds = %11, %9, %7, %5
%13 = load i32*, i32** %2
ret i32* %13
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
@stderr = global i32* null
define i32* @fileno2FILE(i32 %0) {
switch i32 %0, label %8 [
i32 0, label %2
i32 1, label %4
i32 2, label %6
]
2: ; preds = %1
%3 = load i32*, i32** @stdin
br label %8
4: ; preds = %1
%5 = load i32*, i32** @stdout
br label %8
6: ; preds = %1
%7 = load i32*, i32** @stderr
br label %8
8: ; preds = %1, %6, %4, %2
%9 = phi i32* [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ null, %1 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x52() {
  Assert_real((ispunct(82) == 0),
              "/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_ispunct.c",
              415, ("ispunct should be 0 for R"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x52>:
push   %rbp
mov    %rsp,%rbp
mov    $0x52,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x19f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x52>:
push   %rax
mov    $0x52,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19f,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for R\00"
define void @t_ispunct_0x52() {
%1 = call i64 @ispunct(i32 82)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for R\00"
define void @t_ispunct_0x52() {
%1 = tail call i64 @ispunct(i32 82)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double getusec(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  double t = 1.e6 * tv.tv_sec + 1. * tv.tv_usec;
  return t;
}


x86 assembly (clang, -O0):
<getusec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm2
movsd  0xed1(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getusec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @getusec() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double 1.000000e+00, %8
%10 = call double @llvm.fmuladd.f64(double 1.000000e+06, double %5, double %9)
store double %10, double* %2
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @getusec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e+06, double %8)
ret double %9
}
int ft_isdigit(int c) {
  if (c >= (int)'0' && c <= (int)'9')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isdigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void eapol_sm_set_ext_pw_ctx(struct eapol_sm *sm,
                             struct ext_password_data *ext) {}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type opaque
%struct.ext_password_data = type opaque
define void @eapol_sm_set_ext_pw_ctx(%struct.eapol_sm* nocapture %0, %struct.ext_password_data* nocapture %1) {
ret void
}
char *id_arch() {
  return ("x64");
  return ("unk");
}


x86 assembly (clang, -O0):
<id_arch>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_arch>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"x64\00"
define i8* @id_arch() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"x64\00"
define i8* @id_arch() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
unsigned int ones8(register unsigned char n) {
  n -= ((n >> 1) & 0x55);
  n = ((n & 0x33) + ((n >> 2) & 0x33));
  n = ((n + (n >> 4)) & 0x0F);
  return n;
}


x86 assembly (clang, -O0):
<ones8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55,%ecx
movzbl -0x1(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x33,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones8>:
mov    %edi,%eax
shr    %al
and    $0x55,%al
sub    %al,%dil
mov    %edi,%eax
and    $0x33,%al
shr    $0x2,%dil
and    $0x33,%dil
add    %al,%dil
mov    %edi,%eax
shr    $0x4,%al
add    %dil,%al
and    $0xf,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @ones8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 1
%6 = and i32 %5, 85
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = and i32 %12, 51
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = ashr i32 %15, 2
%17 = and i32 %16, 51
%18 = add nsw i32 %13, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = load i8, i8* %2
%23 = zext i8 %22 to i32
%24 = ashr i32 %23, 4
%25 = add nsw i32 %21, %24
%26 = and i32 %25, 15
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
%28 = load i8, i8* %2
%29 = zext i8 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @ones8(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = and i8 %2, 85
%4 = sub i8 %0, %3
%5 = and i8 %4, 51
%6 = lshr i8 %4, 2
%7 = and i8 %6, 51
%8 = add nuw nsw i8 %7, %5
%9 = lshr i8 %8, 4
%10 = add nuw nsw i8 %9, %8
%11 = and i8 %10, 15
%12 = zext i8 %11 to i32
ret i32 %12
}
int term_width(int fd) {
  int ans = 80;
  if (ans > 256)
    ans = 256;
  else if (ans < 12)
    ans = 12;
  return (ans);
}


x86 assembly (clang, -O0):
<term_width>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x50,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jle    1127 <term_width+0x27>
movl   $0x100,-0x8(%rbp)
jmp    113d <term_width+0x3d>
cmpl   $0xc,-0x8(%rbp)
jge    1138 <term_width+0x38>
movl   $0xc,-0x8(%rbp)
jmp    113d <term_width+0x3d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @term_width(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 80, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 256
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 256, i32* %3
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 12
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 12, i32* %3
br label %11
11: ; preds = %10, %7
br label %12
12: ; preds = %11, %6
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @term_width(i32 %0) {
ret i32 80
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void main(void) { foo(123); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x7b,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @foo(i32 123)
ret void
}
char *strcpy(char *s1, const char *s2) {
  char *s = s1;
  while ((*s++ = *s2++) != '\0')
    ;
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Type definitions */
struct mapper {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mapper *);
void mapper_free(struct mapper *map) { free(map); }


x86 assembly (clang, -O0):
<mapper_free>:
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):
<mapper_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.mapper = type { i32 }
define void @mapper_free(%struct.mapper* nocapture %0) {
%2 = tail call i32 @free(%struct.mapper* %0)
ret void
}
void main() {
  int f;
  int y;
  int x = 0;
  if (f > 0) {
    x = 1;
    y = 1;
  } else {
    x = 2;
    y = 3;
  }
  if (y == 2) {
    x = x - 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1128 <main+0x28>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    1136 <main+0x36>
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1149 <main+0x49>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void rest() {
  printf("\e[K");
  printf("\e[1A");
  usleep(60000);
}


x86 assembly (clang, -O0):
<rest>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xea60,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rest>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xea60,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[K\00"
@.str.1 = [5 x i8] c"\1B[1A\00"
define void @rest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @usleep(i32 60000)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[K\00"
@.str.1 = [5 x i8] c"\1B[1A\00"
define void @rest() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @usleep(i32 60000)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ gdp_files_close(int /*<<< orphan*/ *);
int gdp_files_getint(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *gdp_files_open(char *);
int gdp_files_quick_getint(char *FileName, char *cParameter) {
  FILE *fAux = gdp_files_open(FileName);
  int ret = gdp_files_getint(fAux, cParameter);
  gdp_files_close(fAux);
  return ret;
}


x86 assembly (clang, -O0):
<gdp_files_quick_getint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <gdp_files_open@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gdp_files_getint@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <gdp_files_close@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdp_files_quick_getint>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
call   1040 <gdp_files_open@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <gdp_files_getint@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <gdp_files_close@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gdp_files_quick_getint(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32* @gdp_files_open(i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i8*, i8** %4
%11 = call i32 @gdp_files_getint(i32* %9, i8* %10)
store i32 %11, i32* %6
%12 = load i32*, i32** %5
%13 = call i32 @gdp_files_close(i32* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @gdp_files_quick_getint(i8* %0, i8* %1) {
%3 = tail call i32* @gdp_files_open(i8* %0)
%4 = tail call i32 @gdp_files_getint(i32* %3, i8* %1)
%5 = tail call i32 @gdp_files_close(i32* %3)
ret i32 %4
}
/* Type definitions */
struct mtwist_state {
  int dummy;
};

/* Variables and functions */
int mtwist_next(struct mtwist_state *);
int mtwist_int(struct mtwist_state *mtstate, int n) {
  return (int)(mtwist_next(mtstate) % n);
}


x86 assembly (clang, -O0):
<mtwist_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mtwist_next@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtwist_int>:
push   %rbx
mov    %esi,%ebx
call   1030 <mtwist_next@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mtwist_state = type { i32 }
define i32 @mtwist_int(%struct.mtwist_state* %0, i32 %1) {
%3 = alloca %struct.mtwist_state*
%4 = alloca i32
store %struct.mtwist_state* %0, %struct.mtwist_state** %3
store i32 %1, i32* %4
%5 = load %struct.mtwist_state*, %struct.mtwist_state** %3
%6 = call i32 @mtwist_next(%struct.mtwist_state* %5)
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.mtwist_state = type { i32 }
define i32 @mtwist_int(%struct.mtwist_state* %0, i32 %1) {
%3 = tail call i32 @mtwist_next(%struct.mtwist_state* %0)
%4 = srem i32 %3, %1
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t c_ret_u16() { return 0xffff; }


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

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

LLVM IR (-O0):
define i32 @c_ret_u16() {
ret i32 65535
}

LLVM IR (-O2):
define i32 @c_ret_u16() {
ret i32 65535
}
/* Type definitions */
struct opt_odb_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __opt_process_options(struct opt_odb_t *, int, char **,
                                         int /*<<< orphan*/);
void opt_process_options(struct opt_odb_t *odb, int argc, char **argv) {
  if (argc < 2)
    return;
  __opt_process_options(odb, argc - 1, argv + 1, 0);
}


x86 assembly (clang, -O0):
<opt_process_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1132 <opt_process_options+0x22>
jmp    114b <opt_process_options+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
xor    %ecx,%ecx
call   1030 <__opt_process_options@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_process_options>:
cmp    $0x2,%esi
jge    1116 <opt_process_options+0x6>
ret
add    $0xffffffff,%esi
add    $0x8,%rdx
xor    %ecx,%ecx
jmp    1030 <__opt_process_options@plt>

LLVM IR (-O0):
%struct.opt_odb_t = type { i32 }
define void @opt_process_options(%struct.opt_odb_t* %0, i32 %1, i8** %2) {
%4 = alloca %struct.opt_odb_t*
%5 = alloca i32
%6 = alloca i8**
store %struct.opt_odb_t* %0, %struct.opt_odb_t** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %3
br label %17
10: ; preds = %3
%11 = load %struct.opt_odb_t*, %struct.opt_odb_t** %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = load i8**, i8*** %6
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = call i32 @__opt_process_options(%struct.opt_odb_t* %11, i32 %13, i8** %15, i32 0)
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
%struct.opt_odb_t = type { i32 }
define void @opt_process_options(%struct.opt_odb_t* %0, i32 %1, i8** %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add nsw i32 %1, -1
%7 = getelementptr inbounds i8*, i8** %2, i64 1
%8 = tail call i32 @__opt_process_options(%struct.opt_odb_t* %0, i32 %6, i8** %7, i32 0)
br label %9
9: ; preds = %3, %5
ret void
}
void jacFun_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @jacFun_decref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 2 * -(1 - 1);
  printf("%d", i);
  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
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int abs(int v) {
  if (v < 0)
    return -v;
  else
    return v;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ print_str(char *);
void task2_func(void) {
  print_str("task2: Created!\n");
  while (1) {
    print_str("task2: Running...\n");
    delay(1000);
  }
}


x86 assembly (clang, -O0):
<task2_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <print_str@plt>
lea    0xeda(%rip),%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1130 <task2_func+0x10>

x86 assembly (clang, -O2):
<task2_func>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <print_str@plt>
lea    0xedd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1140 <task2_func+0x20>

LLVM IR (-O0):
@.str = [17 x i8] c"task2: Created!\0A\00"
@.str.1 = [19 x i8] c"task2: Running...\0A\00"
define void @task2_func() {
%1 = call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @delay(i32 1000)
br label %2
}

LLVM IR (-O2):
@.str = [17 x i8] c"task2: Created!\0A\00"
@.str.1 = [19 x i8] c"task2: Running...\0A\00"
define void @task2_func() {
%1 = tail call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @delay(i32 1000)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ addscore(int, int);
void scoreeatm(int n, int msc) { addscore(n, msc * 200); }


x86 assembly (clang, -O0):
<scoreeatm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   $0xc8,-0x8(%rbp),%esi
call   1030 <addscore@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scoreeatm>:
imul   $0xc8,%esi,%esi
jmp    1030 <addscore@plt>

LLVM IR (-O0):
define void @scoreeatm(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 = mul nsw i32 %6, 200
%8 = call i32 @addscore(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @scoreeatm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 200
%4 = tail call i32 @addscore(i32 %0, i32 %3)
ret void
}