xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_231() {
  Assert_real((isqrt(231) == 15),
              "/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/stdlib/isqrt.c",
              1160, ("Integer square root of 231 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_231>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe7,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x488,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_231>:
push   %rax
mov    $0xe7,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x488,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 231 should be 15\00"
define void @t_sqrt_231() {
%1 = call i32 @isqrt(i32 231)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 231 should be 15\00"
define void @t_sqrt_231() {
%1 = tail call i32 @isqrt(i32 231)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int exec_shell_command(const char *cmd, const char **argv) {
  char *shell_cmd = prepare_shell_command(cmd);
  const char **new_argv = prepare_command(shell_cmd, argv);
  exec_command(new_argv[0], (char **)new_argv);
  free(shell_cmd);
  free(new_argv);
  return 0;
}


x86 assembly (clang, -O0):
<exec_shell_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <prepare_shell_command@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1060 <prepare_command@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <exec_command@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_shell_command>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
xor    %eax,%eax
call   1040 <prepare_shell_command@plt>
movslq %eax,%r15
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <prepare_command@plt>
movslq %eax,%rbx
mov    (%rbx),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <exec_command@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @exec_shell_command(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @prepare_shell_command to i32 (i8*, ...)*)(i8* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
%13 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @prepare_command to i32 (i8*, i8**, ...)*)(i8* %11, i8** %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8**
store i8** %15, i8*** %6
%16 = load i8**, i8*** %6
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %6
%20 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @exec_command to i32 (i8*, i8**, ...)*)(i8* %18, i8** %19)
%21 = load i8*, i8** %5
%22 = load i8**, i8*** %6
%23 = bitcast i8** %22 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @exec_shell_command(i8* %0, i8** %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @prepare_shell_command to i32 (i8*, ...)*)(i8* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @prepare_command to i32 (i8*, i8**, ...)*)(i8* %5, i8** %1)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8**
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @exec_command to i32 (i8*, i8**, ...)*)(i8* %9, i8** %8)
tail call void @free(i8* %5)
%11 = inttoptr i64 %7 to i8*
tail call void @free(i8* %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int);
nl() { outbyte(13); }


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

x86 assembly (clang, -O2):
<nl>:
mov    $0xd,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define i32 @nl() {
%1 = alloca i32
%2 = call i32 @outbyte(i32 13)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @nl() {
%1 = tail call i32 @outbyte(i32 13)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ initialise_windowing();
void initialise_devices() { initialise_windowing(); }


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

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

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

LLVM IR (-O2):
define void @initialise_devices() {
%1 = tail call i32 (...) @initialise_windowing()
ret void
}
/* Variables and functions */
int nla_attr_size(int);
int nla_total_size(int);
int nla_padlen(int payload) {
  return nla_total_size(payload) - nla_attr_size(payload);
}


x86 assembly (clang, -O0):
<nla_padlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <nla_total_size@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <nla_attr_size@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_padlen>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <nla_total_size@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <nla_attr_size@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nla_padlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nla_total_size(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @nla_attr_size(i32 %5)
%7 = sub nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @nla_padlen(i32 %0) {
%2 = tail call i32 @nla_total_size(i32 %0)
%3 = tail call i32 @nla_attr_size(i32 %0)
%4 = sub nsw i32 %2, %3
ret i32 %4
}
int nvr_is_leap(int year) {
  if (year % 400 == 0)
    return (1);
  if (year % 100 == 0)
    return (0);
  if (year % 4 == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<nvr_is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <nvr_is_leap+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116e <nvr_is_leap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <nvr_is_leap+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <nvr_is_leap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <nvr_is_leap+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <nvr_is_leap+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvr_is_leap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <nvr_is_leap+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <nvr_is_leap+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @nvr_is_leap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
void foo234(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo234(i32 %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, long, int);
main() {
  int c;
  long nc = 0;
  for (nc = 0; (c = getchar()) != EOF; ++nc) {
    printf("%ld : %c\n", nc, c);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     117c <main+0x5c>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113f <main+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%r15
cmp    (%r15),%eax
je     116d <main+0x4d>
lea    0xec1(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%eax
jne    1150 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [10 x i8] c"%ld : %c\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %9, %4 ], [ %1, %0 ]
%6 = phi i64 [ %8, %4 ], [ 0, %0 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %6, i32 %5)
%8 = add nuw nsw i64 %6, 1
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ wtotal(int /*<<< orphan*/);
void pad(int fd, uint64_t padding) {
  char *buf = malloc(padding);
  ssize_t rv = write(fd, buf, padding);
  wtotal(rv);
  free(buf);
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <wtotal@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %rax,%rsi
mov    %ebx,%edx
call   1040 <write@plt>
mov    %eax,%edi
call   1060 <wtotal@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pad(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i32, i32* %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = call i32 @wtotal(i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @pad(i32 %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @write(i32 %0, i8* %3, i32 %1)
%5 = tail call i32 @wtotal(i32 %4)
%6 = tail call i32 @free(i8* %3)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t SwapByteOrder_16(uint16_t value) {
  uint16_t Hi = value << 8;
  uint16_t Lo = value >> 8;
  return Hi | Lo;
}


x86 assembly (clang, -O0):
<SwapByteOrder_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapByteOrder_16>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @SwapByteOrder_16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = or i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @SwapByteOrder_16(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ ntohll(int /*<<< orphan*/);
char *read64Int(char *buf, uint64_t *val) {
  memcpy(val, buf, sizeof(uint64_t));
  *val = ntohll(*val);
  return buf + sizeof(uint64_t);
}


x86 assembly (clang, -O0):
<read64Int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohll@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read64Int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    (%r14),%edi
call   1030 <ntohll@plt>
mov    %eax,(%r14)
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @read64Int(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @memcpy(i32* %5, i8* %6, i32 4)
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @ntohll(i32 %9)
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 4
ret i8* %13
}

LLVM IR (-O2):
define i8* @read64Int(i8* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %1, i8* %0, i32 4)
%4 = load i32, i32* %1
%5 = tail call i32 @ntohll(i32 %4)
store i32 %5, i32* %1
%6 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ nstrcpy(char *, int, char *);
void bar(char *arg) {
  char buf[240];
  nstrcpy(buf, sizeof buf, arg);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xf0,%esi
call   1030 <nstrcpy@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0xf8,%rsp
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0xf0,%esi
call   1030 <nstrcpy@plt>
add    $0xf8,%rsp
ret

LLVM IR (-O0):
define void @bar(i8* %0) {
%2 = alloca i8*
%3 = alloca [240 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [240 x i8], [240 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @nstrcpy(i8* %4, i32 240, i8* %5)
ret void
}

LLVM IR (-O2):
define void @bar(i8* %0) {
%2 = alloca [240 x i8]
%3 = getelementptr inbounds [240 x i8], [240 x i8]* %2, i64 0, i64 0
%4 = call i32 @nstrcpy(i8* %3, i32 240, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ serve(int, int);
int socket_server_wait(int);
void echo_daemon(int sock, int fd) {
  pid_t pid;
  int sd;
  sd = socket_server_wait(sock);
  serve(sd, fd);
}


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

x86 assembly (clang, -O2):
<echo_daemon>:
push   %rbx
mov    %esi,%ebx
call   1040 <socket_server_wait@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <serve@plt>

LLVM IR (-O0):
define void @echo_daemon(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @socket_server_wait(i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = call i32 @serve(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @echo_daemon(i32 %0, i32 %1) {
%3 = tail call i32 @socket_server_wait(i32 %0)
%4 = tail call i32 @serve(i32 %3, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ia32_storeups(float *, int /*<<< orphan*/);
void __attribute__((__always___, __nodebug__))
_mm_storeu_ps(float *p, __m128 a) {
  __builtin_ia32_storeups(p, a);
}


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

x86 assembly (clang, -O2):
<_mm_storeu_ps>:
jmp    1030 <__builtin_ia32_storeups@plt>

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

LLVM IR (-O2):
define void @_mm_storeu_ps(float* %0, i32 %1) {
%3 = tail call i32 @__builtin_ia32_storeups(float* %0, i32 %1)
ret void
}
int test_imm_2Euint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Euint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x2e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Euint64_highword_reg>:
movabs $0x2e00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Euint64_highword_reg(i64 %0) {
%2 = and i64 %0, 197568495616
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cr(char c) { return c == '\r'; }


x86 assembly (clang, -O0):
<cr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cr>:
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @cr(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cr(i8 signext %0) {
%2 = icmp eq i8 %0, 13
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  const int A[5] = {1, 2, 3, 4, 5};
  int *p = (int *)A;
  *(p + 2) = 3;
  p[2] = 4;
  printf("%d\n", *(p + 2));
  printf("%d\n", p[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0x4,0x8(%rax)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
void main() { char cadena[100] = "Hola a todos"; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x64,%edx
call   1030 <memcpy@plt>
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.cadena = [100 x i8] c"Hola a todos\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = bitcast [100 x i8]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_word_format();
void usage(const char *x) {
  fprintf(stderr, "Usage: %s -c|-t|-x [-v789] [-Wformat] [-Cdir] [-f file]\n",
          x);
  usage_word_format();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: %s -c|-t|-x [-v789] [-Wformat] [-Cdir] [-f file]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @usage_word_format()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: %s -c|-t|-x [-v789] [-Wformat] [-Cdir] [-f file]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @usage_word_format()
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int increment_px() {
  int x = 9000;
  int *px;
  px = &x;
  *px = *px + 1;
  printf("*px = %d\n", *px);
}


x86 assembly (clang, -O0):
<increment_px>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2328,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_px>:
lea    0xee9(%rip),%rdi
mov    $0x2329,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"*px = %d\0A\00"
define i32 @increment_px() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 9000, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [10 x i8] c"*px = %d\0A\00"
define i32 @increment_px() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9001)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void pid_file_delete(char *pid_file) { unlink(pid_file); }


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

x86 assembly (clang, -O2):
<pid_file_delete>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @pid_file_delete(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_asl();
int /*<<< orphan*/ e_writeback();
void e_asl_abs() {
  e_abs();
  e_asl();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_asl_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_abs@plt>
mov    $0x0,%al
call   1040 <e_asl@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_asl_abs>:
push   %rax
xor    %eax,%eax
call   1050 <e_abs@plt>
xor    %eax,%eax
call   1040 <e_asl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_asl_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_asl()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_asl_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_asl()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void bfree(char *p) {
  if (p != (char *)(0)) {
    free(p);
  }
  return;
}


x86 assembly (clang, -O0):
<bfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <bfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfree>:
test   %rdi,%rdi
je     111a <bfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @bfree(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 %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @bfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x32() {
  Assert_real((isalpha(50) == 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_isalpha.c",
              255, ("isalpha should be 0 for 2"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x32>:
push   %rax
mov    $0x32,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xff,%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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for 2\00"
define void @t_isalpha_0x32() {
%1 = call i64 @isalpha(i32 50)
%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 255, 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for 2\00"
define void @t_isalpha_0x32() {
%1 = tail call i64 @isalpha(i32 50)
%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 255, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
long double copysignl(long double, long double);
int main() {
  long double neg = -1.0;
  long double pos = 1.0;
  long double res = copysignl(pos, neg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
fld1
fld    %st(0)
fchs
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
fstpt  -0x50(%rbp)
fabs
fld    %st(0)
fchs
mov    -0x47(%rbp),%al
test   $0x80,%al
fxch   %st(1)
fcmovne %st(1),%st
fstp   %st(1)
fstpt  -0x40(%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 x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store i32 0, i32* %1
store x86_fp80 0xKBFFF8000000000000000, x86_fp80* %2
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %2
%7 = call x86_fp80 @llvm.copysign.f80(x86_fp80 %5, x86_fp80 %6)
store x86_fp80 %7, x86_fp80* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printPiecesVerbose(void) {
  printf(" 0  --  Black Short Square Hollow\n"
         " 1  --  Black Short Square Solid \n"
         " 2  --  Black Short Round  Hollow\n"
         " 3  --  Black Short Round  Solid \n"
         " 4  --  Black Tall  Square Hollow\n"
         " 5  --  Black Tall  Square Solid \n"
         " 6  --  Black Tall  Round  Hollow\n"
         " 7  --  Black Tall  Round  Solid \n"
         " 8  --  White Short Square Hollow\n"
         " 9  --  White Short Square Solid \n"
         "10  --  White Short Round  Hollow\n"
         "11  --  White Short Round  Solid \n"
         "12  --  White Tall  Square Hollow\n"
         "13  --  White Tall  Square Solid \n"
         "14  --  White Tall  Round  Hollow\n"
         "15  --  White Tall  Round  Solid \n");
}


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

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

LLVM IR (-O0):
@.str = [545 x i8] c" 0 -- Black Short Square Hollow\0A 1 -- Black Short Square Solid \0A 2 -- Black Short Round Hollow\0A 3 -- Black Short Round Solid \0A 4 -- Black Tall Square Hollow\0A 5 -- Black Tall Square Solid \0A 6 -- Black Tall Round Hollow\0A 7 -- Black Tall Round Solid \0A 8 -- White Short Square Hollow\0A 9 -- White Short Square Solid \0A10 -- White Short Round Hollow\0A11 -- White Short Round Solid \0A12 -- White Tall Square Hollow\0A13 -- White Tall Square Solid \0A14 -- White Tall Round Hollow\0A15 -- White Tall Round Solid \0A\00"
define void @printPiecesVerbose() {
%1 = call i32 @printf(i8* getelementptr inbounds ([545 x i8], [545 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [544 x i8] c" 0 -- Black Short Square Hollow\0A 1 -- Black Short Square Solid \0A 2 -- Black Short Round Hollow\0A 3 -- Black Short Round Solid \0A 4 -- Black Tall Square Hollow\0A 5 -- Black Tall Square Solid \0A 6 -- Black Tall Round Hollow\0A 7 -- Black Tall Round Solid \0A 8 -- White Short Square Hollow\0A 9 -- White Short Square Solid \0A10 -- White Short Round Hollow\0A11 -- White Short Round Solid \0A12 -- White Tall Square Hollow\0A13 -- White Tall Square Solid \0A14 -- White Tall Round Hollow\0A15 -- White Tall Round Solid \00"
define void @printPiecesVerbose() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([544 x i8], [544 x i8]* @str, i64 0, i64 0))
ret void
}
int dbg_check_nondata_nodes_order(struct ubifs_info *c,
                                  struct list_head *head) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.list_head = type opaque
define i32 @dbg_check_nondata_nodes_order(%struct.ubifs_info* nocapture readnone %0, %struct.list_head* nocapture readnone %1) {
ret i32 0
}
unsigned int ascii_isdigit(char c) {
  if (c >= '0' && c <= '9')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ascii_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <ascii_isdigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <ascii_isdigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <ascii_isdigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ascii_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
float Sleef_rintf(float x) { return __builtin_rintf(x); }


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

x86 assembly (clang, -O2):
<Sleef_rintf>:
jmp    1030 <rintf@plt>

LLVM IR (-O0):
define float @Sleef_rintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.rint.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Sleef_rintf(float %0) {
%2 = tail call float @llvm.rint.f32(float %0)
ret float %2
}
/* Variables and functions */
int onig_initialize(int /*<<< orphan*/, int /*<<< orphan*/);
extern int onig_init(void) { return onig_initialize(0, 0); }


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

x86 assembly (clang, -O2):
<onig_init>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <onig_initialize@plt>

LLVM IR (-O0):
define i32 @onig_init() {
%1 = call i32 @onig_initialize(i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @onig_init() {
%1 = tail call i32 @onig_initialize(i32 0, i32 0)
ret i32 %1
}
unsigned long tegra_mipi_cal_read(struct tegra_mipi_cal *mipi_cal,
                                  unsigned long reg) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.tegra_mipi_cal = type opaque
define i64 @tegra_mipi_cal_read(%struct.tegra_mipi_cal* %0, i64 %1) {
%3 = alloca %struct.tegra_mipi_cal*
%4 = alloca i64
store %struct.tegra_mipi_cal* %0, %struct.tegra_mipi_cal** %3
store i64 %1, i64* %4
ret i64 0
}

LLVM IR (-O2):
%struct.tegra_mipi_cal = type opaque
define i64 @tegra_mipi_cal_read(%struct.tegra_mipi_cal* nocapture readnone %0, i64 %1) {
ret i64 0
}
int dpmov3(double xo, double yo, double zo, double dx, double dy, double dz,
           double *x, double *y, double *z) {
  *x = xo + dx;
  *y = yo + dy;
  *z = zo + dz;
  return 0;
}


x86 assembly (clang, -O0):
<dpmov3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpmov3>:
addsd  %xmm3,%xmm0
movsd  %xmm0,(%rdi)
addsd  %xmm4,%xmm1
movsd  %xmm1,(%rsi)
addsd  %xmm5,%xmm2
movsd  %xmm2,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dpmov3(double %0, double %1, double %2, double %3, double %4, double %5, double* %6, double* %7, double* %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double* %6, double** %16
store double* %7, double** %17
store double* %8, double** %18
%19 = load double, double* %10
%20 = load double, double* %13
%21 = fadd double %19, %20
%22 = load double*, double** %16
store double %21, double* %22
%23 = load double, double* %11
%24 = load double, double* %14
%25 = fadd double %23, %24
%26 = load double*, double** %17
store double %25, double* %26
%27 = load double, double* %12
%28 = load double, double* %15
%29 = fadd double %27, %28
%30 = load double*, double** %18
store double %29, double* %30
ret i32 0
}

LLVM IR (-O2):
define i32 @dpmov3(double %0, double %1, double %2, double %3, double %4, double %5, double* nocapture writeonly %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = fadd double %0, %3
store double %10, double* %6
%11 = fadd double %1, %4
store double %11, double* %7
%12 = fadd double %2, %5
store double %12, double* %8
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_u64(uint64_t x) { assert_or_panic(x == 0xfffffffffffffffcULL); }


x86 assembly (clang, -O0):
<c_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0xfffffffffffffffc,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_or_panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_u64>:
xor    %eax,%eax
cmp    $0xfffffffc,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_or_panic@plt>

LLVM IR (-O0):
define void @c_u64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp eq i64 %4, -4
%6 = zext i1 %5 to i32
%7 = call i32 @assert_or_panic(i32 %6)
ret void
}

LLVM IR (-O2):
define void @c_u64(i32 %0) {
%2 = icmp eq i32 %0, -4
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert_or_panic(i32 %3)
ret void
}
void gtk_text_mark_get_left_gravity() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_mark_get_left_gravity() {
ret void
}
void gtk_tree_view_set_headers_clickable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_headers_clickable() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void write_short(u_int16_t *s, FILE *f) { fwrite(s, 2, 1, f); }


x86 assembly (clang, -O0):
<write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_short>:
mov    %rsi,%rcx
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define void @write_short(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 @fwrite(i32* %5, i32 2, i32 1, i32* %6)
ret void
}

LLVM IR (-O2):
define void @write_short(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fwrite(i32* %0, i32 2, i32 1, i32* %1)
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ hello(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int res = add(2, 3);
  printf("%d", res);
  hello("hello world");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1050 <hello@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1050 <hello@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 2, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @hello(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}