xunge/DecIR huggingface dataset:
/* Type definitions */
struct ejson_driver_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void d_close_array(struct ejson_driver_t *d) {
  printf("],");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<d_close_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_close_array>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
%struct.ejson_driver_t = type { i32 }
@.str = [3 x i8] c"],\00"
@stdout = global i32 0
define void @d_close_array(%struct.ejson_driver_t* %0) {
%2 = alloca %struct.ejson_driver_t*
store %struct.ejson_driver_t* %0, %struct.ejson_driver_t** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.ejson_driver_t = type { i32 }
@.str = [3 x i8] c"],\00"
@stdout = global i32 0
define void @d_close_array(%struct.ejson_driver_t* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void __SLIC_ERROR(char *error_string) {
  {
    assert(0);
    return;
  }
}


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

x86 assembly (clang, -O2):
<__SLIC_ERROR>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @__SLIC_ERROR(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ ino_t;

/* Variables and functions */
int dir_symlink_loop(const ino_t inode_no, const ino_t *dir_stack,
                     const int depth) {
  int i;
  for (i = 0; i < depth; i++)
    if (dir_stack[i] == inode_no)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dir_symlink_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1157 <dir_symlink_loop+0x57>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x10(%rbp),%rax
jne    1144 <dir_symlink_loop+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115e <dir_symlink_loop+0x5e>
jmp    1149 <dir_symlink_loop+0x49>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <dir_symlink_loop+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_symlink_loop>:
test   %edx,%edx
jle    111f <dir_symlink_loop+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %rdi,(%rsi,%rcx,8)
je     1122 <dir_symlink_loop+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <dir_symlink_loop+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @dir_symlink_loop(i64 %0, i64* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i64, i64* %1, i64 %10
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(int /*<<< orphan*/);
main() {
  if (f(0) != 0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <f@plt>
cmp    $0x0,%rax
je     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <f@plt>
test   %rax,%rax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __xpg_strerror_r(int, char *, size_t);
char *__glibc_strerror_r(int errnum, char *strerrbuf, size_t buflen) {
  __xpg_strerror_r(errnum, strerrbuf, buflen);
  return strerrbuf;
}


x86 assembly (clang, -O0):
<__glibc_strerror_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__xpg_strerror_r@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glibc_strerror_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__xpg_strerror_r@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__glibc_strerror_r(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @__xpg_strerror_r(i32 %7, i8* %8, i64 %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @__glibc_strerror_r(i32 %0, i8* returned %1, i64 %2) {
%4 = tail call i32 @__xpg_strerror_r(i32 %0, i8* %1, i64 %2)
ret i8* %1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int unix_stat(const char *fn, struct stat *s_p) { return stat(fn, s_p); }


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

x86 assembly (clang, -O2):
<unix_stat>:
jmp    1030 <stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @unix_stat(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 i32 @stat(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @unix_stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
pid_t _vfork() {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_vfork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vfork>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_vfork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_vfork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ all_off();
int /*<<< orphan*/ mcp_init();
int /*<<< orphan*/ send_bytes(int, int, int, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  mcp_init();
  send_bytes(0x11, 53, 0144, 0b10101010);
  sleep(5);
  all_off();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <mcp_init@plt>
mov    $0x11,%edi
mov    $0x35,%esi
mov    $0x64,%edx
mov    $0xaa,%ecx
call   1050 <send_bytes@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1040 <all_off@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <mcp_init@plt>
mov    $0x11,%edi
mov    $0x35,%esi
mov    $0x64,%edx
mov    $0xaa,%ecx
call   1050 <send_bytes@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1040 <all_off@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mcp_init()
%3 = call i32 @send_bytes(i32 17, i32 53, i32 100, i32 170)
%4 = call i32 @sleep(i32 5)
%5 = call i32 (...) @all_off()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mcp_init()
%2 = tail call i32 @send_bytes(i32 17, i32 53, i32 100, i32 170)
%3 = tail call i32 @sleep(i32 5)
%4 = tail call i32 (...) @all_off()
ret i32 0
}
void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev) {}


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

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

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

LLVM IR (-O2):
%struct.brcmf_sdio_dev = type opaque
define void @brcmf_of_probe(%struct.brcmf_sdio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Exit(char *);
void Usage(void) {
  Exit(
      "Usage: MTE filename rules codesize minsize maxsize number total output\n"
      "\n"
      "filename ... text file to analyze\n"
      "rules ...... rules table file\n"
      "codesize ... MTE code size\n"
      "minsize .... minimum MTE string length\n"
      "maxsize .... maximum MTE string length\n"
      "number ..... minimum number of occurrences\n"
      "control .... add the MTE size in the operations (0/1)\n"
      "total ...... number of MTE to search\n"
      "output ..... output file name\n");
}


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

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

LLVM IR (-O0):
@.str = [406 x i8] c"Usage: MTE filename rules codesize minsize maxsize number total output\0A\0Afilename ... text file to analyze\0Arules ...... rules table file\0Acodesize ... MTE code size\0Aminsize .... minimum MTE string length\0Amaxsize .... maximum MTE string length\0Anumber ..... minimum number of occurrences\0Acontrol .... add the MTE size in the operations (0/1)\0Atotal ...... number of MTE to search\0Aoutput ..... output file name\0A\00"
define void @Usage() {
%1 = call i32 @Exit(i8* getelementptr inbounds ([406 x i8], [406 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [406 x i8] c"Usage: MTE filename rules codesize minsize maxsize number total output\0A\0Afilename ... text file to analyze\0Arules ...... rules table file\0Acodesize ... MTE code size\0Aminsize .... minimum MTE string length\0Amaxsize .... maximum MTE string length\0Anumber ..... minimum number of occurrences\0Acontrol .... add the MTE size in the operations (0/1)\0Atotal ...... number of MTE to search\0Aoutput ..... output file name\0A\00"
define void @Usage() {
%1 = tail call i32 @Exit(i8* getelementptr inbounds ([406 x i8], [406 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __builtin_vsx_xstdivdp_fe(double, double);
int __builtin_vsx_xstdivdp_fg(double, double);
void test_div_df_1(double a, double b, int *p) {
  p[0] = __builtin_vsx_xstdivdp_fe(a, b);
  p[1] = __builtin_vsx_xstdivdp_fg(a, b);
}


x86 assembly (clang, -O0):
<test_div_df_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__builtin_vsx_xstdivdp_fe@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <__builtin_vsx_xstdivdp_fg@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_div_df_1>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <__builtin_vsx_xstdivdp_fe@plt>
mov    %eax,(%rbx)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <__builtin_vsx_xstdivdp_fg@plt>
mov    %eax,0x4(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_div_df_1(double %0, double %1, i32* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32*
store double %0, double* %4
store double %1, double* %5
store i32* %2, i32** %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call i32 @__builtin_vsx_xstdivdp_fe(double %7, double %8)
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load double, double* %4
%13 = load double, double* %5
%14 = call i32 @__builtin_vsx_xstdivdp_fg(double %12, double %13)
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @test_div_df_1(double %0, double %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @__builtin_vsx_xstdivdp_fe(double %0, double %1)
store i32 %4, i32* %2
%5 = tail call i32 @__builtin_vsx_xstdivdp_fg(double %0, double %1)
%6 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %5, i32* %6
ret void
}
int main(void) {
  char s[100];
  int nrows;
  while (~scanf("%s%d", s, &nrows))
    puts(convert(s, nrows));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
lea    -0x74(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     1180 <main+0x50>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    $0x0,%al
call   1030 <convert@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <puts@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xebd(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0xffffffff,%eax
je     119c <main+0x6c>
lea    0x10(%rsp),%rbx
lea    0xe9b(%rip),%r14
lea    0xc(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <convert@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0xffffffff,%eax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i32* %3)
%7 = xor i32 %6, -1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @convert to i32 (i8*, i32, ...)*)(i8* %10, i32 %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @puts to i32 (i32, ...)*)(i32 %12)
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %0, %7
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @convert to i32 (i8*, i32, ...)*)(i8* %3, i32 %8)
%10 = call i32 (i32, ...) bitcast (i32 (...)* @puts to i32 (i32, ...)*)(i32 %9)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %7
13: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
double fabs(double);
double abs_fun_double(double a) { return fabs(a); }


x86 assembly (clang, -O0):
<abs_fun_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_fun_double>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @abs_fun_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @abs_fun_double(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ ugl_AddBytecode(int);
int /*<<< orphan*/ ugl_plog(char *);
void ugl_bytecode_return_from_procedure(void) {
  ugl_plog("BC return from procedure");
  ugl_AddBytecode((0x3f));
}


x86 assembly (clang, -O0):
<ugl_bytecode_return_from_procedure>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <ugl_plog@plt>
mov    $0x3f,%edi
call   1030 <ugl_AddBytecode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ugl_bytecode_return_from_procedure>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ugl_plog@plt>
mov    $0x3f,%edi
pop    %rax
jmp    1030 <ugl_AddBytecode@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"BC return from procedure\00"
define void @ugl_bytecode_return_from_procedure() {
%1 = call i32 @ugl_plog(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ugl_AddBytecode(i32 63)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"BC return from procedure\00"
define void @ugl_bytecode_return_from_procedure() {
%1 = tail call i32 @ugl_plog(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ugl_AddBytecode(i32 63)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ task_vseprint(char *, char *, char *, int /*<<< orphan*/);
int write(int, char *, int /*<<< orphan*/);
int task_vfprint(int fd, char *fmt, va_list arg) {
  char buf[256];
  task_vseprint(buf, buf + sizeof buf, fmt, arg);
  return write(fd, buf, strlen(buf));
}


x86 assembly (clang, -O0):
<task_vfprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x120(%rbp),%rdi
lea    -0x120(%rbp),%rsi
add    $0x100,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1050 <task_vseprint@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x12c(%rbp)
lea    -0x120(%rbp),%rax
mov    %rax,-0x128(%rbp)
lea    -0x120(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x12c(%rbp),%edi
mov    -0x128(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_vfprint>:
push   %rbp
push   %rbx
sub    $0x108,%rsp
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0x100(%rsp),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <task_vseprint@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @task_vfprint(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [256 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %9, i64 256
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @task_vseprint(i8* %8, i8* %10, i8* %11, i32 %12)
%14 = load i32, i32* %4
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = call i32 @write(i32 %14, i8* %15, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @task_vfprint(i32 %0, i8* %1, i32 %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 256
%7 = call i32 @task_vseprint(i8* %5, i8* %6, i8* %1, i32 %2)
%8 = call i32 @strlen(i8* %5)
%9 = call i32 @write(i32 %0, i8* %5, i32 %8)
ret i32 %9
}
int main(void) {
  float f = 125.064f;
  double d = 89.010240240104F;
  long double ld = 256.0105050612056063673L;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x42fa20c5,-0x8(%rbp)
movabs $0x405640a7c0000000,%rax
40 56 40
mov    %rax,-0x10(%rbp)
fldt   0xeda(%rip)
fstpt  -0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca x86_fp80
store i32 0, i32* %1
store float 0x405F4418A0000000, float* %2
store double 0x405640A7C0000000, double* %3
store x86_fp80 0xK40078001583AD7290809, x86_fp80* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int bitcount(unsigned x) {
  int b;
  for (b = 0; x != 0; x >>= 1)
    if (x & 01)
      b++;
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <bitcount+0x43>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <bitcount+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <bitcount+0x35>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <bitcount+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
void gtk_file_chooser_set_extra_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_set_extra_widget() {
ret void
}
int Mini_AigLitConst1() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Mini_AigLitConst1() {
ret i32 1
}
int digit_count(int num) {
  int result = 2;
  int temp = 9 * 9;
  while (num > temp) {
    result++;
    temp *= 9;
  }
  return result;
}


x86 assembly (clang, -O0):
<digit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x51,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1136 <digit_count+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   $0x9,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <digit_count+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_count>:
mov    $0x2,%eax
cmp    $0x52,%edi
jl     112a <digit_count+0x2a>
mov    $0x2,%eax
mov    $0x51,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
lea    (%rcx,%rcx,8),%ecx
cmp    %edi,%ecx
jl     1120 <digit_count+0x20>
ret

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

LLVM IR (-O2):
define i32 @digit_count(i32 %0) {
%2 = icmp sgt i32 %0, 81
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 81, %1 ]
%5 = phi i32 [ %6, %3 ], [ 2, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = mul nsw i32 %4, 9
%8 = icmp slt i32 %7, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 2, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_is_negative(int n) {
  char s;
  if (n < 0)
    s = 'N';
  else
    s = 'P';
  ft_putchar(s);
}


x86 assembly (clang, -O0):
<ft_is_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112e <ft_is_negative+0x1e>
movb   $0x4e,-0x5(%rbp)
jmp    1132 <ft_is_negative+0x22>
movb   $0x50,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_negative>:
not    %edi
shr    $0x1f,%edi
add    %edi,%edi
add    $0x4e,%edi
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_is_negative(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 78, i8* %3
br label %8
7: ; preds = %1
store i8 80, i8* %3
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %3
%10 = call i32 @ft_putchar(i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @ft_is_negative(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8 78, i8 80
%4 = tail call i32 @ft_putchar(i8 signext %3)
ret void
}
float EaseQuadOut(float t, float b, float c, float d) {
  t /= d;
  return (-c * t * (t - 2.0f) + b);
}


x86 assembly (clang, -O0):
<EaseQuadOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xeb1(%rip),%xmm1
subss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EaseQuadOut>:
divss  %xmm3,%xmm0
mulss  %xmm0,%xmm2
addss  0xef0(%rip),%xmm0
mulss  %xmm2,%xmm0
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @EaseQuadOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %8
%10 = load float, float* %5
%11 = fdiv float %10, %9
store float %11, float* %5
%12 = load float, float* %7
%13 = fneg float %12
%14 = load float, float* %5
%15 = fmul float %13, %14
%16 = load float, float* %5
%17 = fsub float %16, 2.000000e+00
%18 = load float, float* %6
%19 = call float @llvm.fmuladd.f32(float %15, float %17, float %18)
ret float %19
}

LLVM IR (-O2):
define float @EaseQuadOut(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fneg float %2
%7 = fmul float %5, %6
%8 = fadd float %5, -2.000000e+00
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %1)
ret float %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sdio_read_byte(int);
uint8_t adns2080_product_id_read(void) { return sdio_read_byte((0x00U)); }


x86 assembly (clang, -O0):
<adns2080_product_id_read>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <sdio_read_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adns2080_product_id_read>:
xor    %edi,%edi
jmp    1030 <sdio_read_byte@plt>

LLVM IR (-O0):
define i32 @adns2080_product_id_read() {
%1 = call i32 @sdio_read_byte(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @adns2080_product_id_read() {
%1 = tail call i32 @sdio_read_byte(i32 0)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ stderr;
bool bad_header_value(char *field_name, uint8_t value) {
  fprintf(stderr, "Bad mod header field %s value %d (0x%02x)\n", field_name,
          value, value);
  return false;
}


x86 assembly (clang, -O0):
<bad_header_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_header_value>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
mov    %ecx,%r8d
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Bad mod header field %s value %d (0x%02x)\0A\00"
define i32 @bad_header_value(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Bad mod header field %s value %d (0x%02x)\0A\00"
define i32 @bad_header_value(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int sm_accept_add(void *data, int len) {
  printf("%s:recv accept add\n", (char *)data);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"%s:recv accept add\0A\00"
define i32 @sm_accept_add(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s:recv accept add\0A\00"
define i32 @sm_accept_add(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int bar(int x) { return !(x == 1); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp ne i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int stat();
int main(int argc, char *argv[], char *envp[]) {
  int g3;
  int g3_1;
  int local0;
  g3_1 = stat();
  printf("Stat returns %d; size of file is %d\n", g3_1, local0);
  return g3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <stat@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <stat@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Stat returns %d; size of file is %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%11 = call i32 (...) @stat()
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = load i32, i32* %10
%14 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32, i32* %8
ret i32 %15
}

LLVM IR (-O2):
@.str = [37 x i8] c"Stat returns %d; size of file is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @stat()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %4, i32 undef)
ret i32 undef
}
const char *Sort_Brief(void) { return "Sortable"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Sortable\00"
define i8* @Sort_Brief() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
void cadd(void) {
  printf("%s, %s, %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/"
         "base-usage/make_study/files.c",
         __func__, 19);
}


x86 assembly (clang, -O0):
<cadd>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xf85(%rip),%rdx
mov    $0x13,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cadd>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf89(%rip),%rdx
mov    $0x13,%ecx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/files.c\00"
@__func__.cadd = [5 x i8] c"cadd\00"
define void @cadd() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.cadd, i64 0, i64 0), i32 19)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/files.c\00"
@__func__.cadd = [5 x i8] c"cadd\00"
define void @cadd() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.cadd, i64 0, i64 0), i32 19)
ret void
}
/* Variables and functions */
char *__body_init_status(char **, int *, int);
void body_init_status_conc(char *buffer[3], char **header, int *num_lines) {
  int z;
  for (z = 0; z < 3; z++)
    buffer[z] = __body_init_status(header, num_lines, (z + 8));
}


x86 assembly (clang, -O0):
<body_init_status_conc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1165 <body_init_status_conc+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
add    $0x8,%edx
call   1030 <__body_init_status@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <body_init_status_conc+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<body_init_status_conc>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x8,%edx
call   1030 <__body_init_status@plt>
mov    %rax,(%r15)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1030 <__body_init_status@plt>
mov    %rax,0x8(%r15)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1030 <__body_init_status@plt>
mov    %rax,0x10(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @body_init_status_conc(i8** nocapture writeonly %0, i8** %1, i32* %2) {
%4 = tail call i8* @__body_init_status(i8** %1, i32* %2, i32 8)
store i8* %4, i8** %0
%5 = tail call i8* @__body_init_status(i8** %1, i32* %2, i32 9)
%6 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %5, i8** %6
%7 = tail call i8* @__body_init_status(i8** %1, i32* %2, i32 10)
%8 = getelementptr inbounds i8*, i8** %0, i64 2
store i8* %7, i8** %8
ret void
}
void simtec_cpu_halt() {}


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

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

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

LLVM IR (-O2):
define void @simtec_cpu_halt() {
ret void
}
long FlashMassErase() {
  (*((volatile unsigned long *)(0x400FD000 + 0x00000014))) =
      (0x00000001 | 0x00000200 | 0x00000800);
  (*((volatile unsigned long *)(0x400FD000 + 0x00000008))) =
      0xA4420000 | 0x00000004;
  while ((*((volatile unsigned long *)(0x400FD000 + 0x00000008))) &
         0x00000004) {
  }
  if ((*((volatile unsigned long *)(0x400FD000 + 0x0000000C))) &
      (0x00000001 | 0x00000200 | 0x00000800)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<FlashMassErase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fd014,%eax
movq   $0xa01,(%rax)
mov    $0x400fd008,%eax
mov    $0xa4420004,%ecx
mov    %rcx,(%rax)
mov    $0x400fd008,%eax
mov    (%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
je     1138 <FlashMassErase+0x38>
jmp    111d <FlashMassErase+0x1d>
mov    $0x400fd00c,%eax
mov    (%rax),%rax
and    $0xa01,%rax
cmp    $0x0,%rax
je     115d <FlashMassErase+0x5d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1165 <FlashMassErase+0x65>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashMassErase>:
movq   $0xa01,0x400fd014
mov    $0xa4420004,%eax
mov    %rax,0x400fd008
40
nopl   0x0(%rax)
testq  $0x4,0x400fd008
jne    1120 <FlashMassErase+0x20>
mov    0x400fd00c,%rax
40
and    $0xa01,%eax
neg    %rax
sbb    %rax,%rax
ret

LLVM IR (-O0):
define i64 @FlashMassErase() {
%1 = alloca i64
store volatile i64 2561, i64* inttoptr (i64 1074778132 to i64*)
store volatile i64 2755788804, i64* inttoptr (i64 1074778120 to i64*)
br label %2
2: ; preds = %6, %0
%3 = load volatile i64, i64* inttoptr (i64 1074778120 to i64*)
%4 = and i64 %3, 4
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load volatile i64, i64* inttoptr (i64 1074778124 to i64*)
%9 = and i64 %8, 2561
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i64 -1, i64* %1
br label %13
12: ; preds = %7
store i64 0, i64* %1
br label %13
13: ; preds = %12, %11
%14 = load i64, i64* %1
ret i64 %14
}

LLVM IR (-O2):
define i64 @FlashMassErase() {
store volatile i64 2561, i64* inttoptr (i64 1074778132 to i64*)
store volatile i64 2755788804, i64* inttoptr (i64 1074778120 to i64*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1074778120 to i64*)
%3 = and i64 %2, 4
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 1074778124 to i64*)
%7 = and i64 %6, 2561
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i64
ret i64 %9
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _fstat(int file, struct stat *st) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @ENOTSUP
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = load i32, i32* @ENOTSUP
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Safe_free(void *);
void setToNull(void **item) {
  if (!item)
    return;
  if (!*item)
    return;
  Safe_free(*item);
  *item = NULL;
}


x86 assembly (clang, -O0):
<setToNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <setToNull+0x1c>
jmp    1156 <setToNull+0x46>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113f <setToNull+0x2f>
jmp    1156 <setToNull+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <Safe_free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @setToNull(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 %16
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %6
br label %16
11: ; preds = %6
%12 = load i8**, i8*** %2
%13 = load i8*, i8** %12
%14 = call i32 @Safe_free(i8* %13)
%15 = load i8**, i8*** %2
store i8* null, i8** %15
br label %16
16: ; preds = %11, %10, %5
ret void
}

LLVM IR (-O2):
define void @setToNull(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 @Safe_free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %3, %1, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f_s();
void g2(void) { f_s(); }


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

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

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

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