xunge/DecIR huggingface dataset:
signed long int signedlongint_ignoring_signedshortint(signed long int x,
                                                      signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlongint_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedlongint_ignoring_signedshortint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlongint_ignoring_signedshortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct qspi_ip6514e_dev_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ qspi_ip6514e_send_cmd(
    struct qspi_ip6514e_dev_t *, int /*<<< orphan*/, int /*<<< orphan*/ *,
    int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/,
    int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
void qspi_ip6514e_send_simple_cmd(struct qspi_ip6514e_dev_t *dev,
                                  uint8_t opcode) {
  (void)qspi_ip6514e_send_cmd(dev, opcode, NULL, 0, NULL, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<qspi_ip6514e_send_simple_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rdx
mov    %r9d,%ecx
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <qspi_ip6514e_send_cmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qspi_ip6514e_send_simple_cmd>:
push   %rax
sub    $0x8,%rsp
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
call   1030 <qspi_ip6514e_send_cmd@plt>
add    $0x20,%rsp
pop    %rax
ret

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

LLVM IR (-O2):
%struct.qspi_ip6514e_dev_t = type { i32 }
define void @qspi_ip6514e_send_simple_cmd(%struct.qspi_ip6514e_dev_t* %0, i32 %1) {
%3 = tail call i32 @qspi_ip6514e_send_cmd(%struct.qspi_ip6514e_dev_t* %0, i32 %1, i32* null, i32 0, i32* null, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void PrintTreeTabs(FILE *f, char *separator, int count) {
  int i;
  for (i = 0; i < count; i++)
    fprintf(f, "%s", separator);
}


x86 assembly (clang, -O0):
<PrintTreeTabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1158 <PrintTreeTabs+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <PrintTreeTabs+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintTreeTabs>:
push   %r15
push   %r14
push   %rbx
test   %edx,%edx
jle    1140 <PrintTreeTabs+0x30>
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <fputs@plt>
add    $0xffffffff,%ebx
jne    1130 <PrintTreeTabs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @PrintTreeTabs(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %16, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i8*, i8** %5
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @PrintTreeTabs(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @fputs(i8* %1, i32* %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %2
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret void
}
signed short
signedshort_ignoring_unsignedlonglongint(signed short x,
                                         unsigned long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_unsignedlonglongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_unsignedlonglongint(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_unsignedlonglongint(i16 returned signext %0, i64 %1) {
ret i16 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int memory_seek(void *data, off_t len) { return 0; }


x86 assembly (clang, -O0):
<memory_seek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @memory_seek(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "Usage: %s [OPTION]...\n"
          "  -a          annotated mode\n"
          "  -b [num]    baud rate in bits per second, default: %d\n"
          "  -c          map CR to NL on input\n"
          "  -d          debug mode\n"
          "  -f          enable hardware flow control\n"
          "  -h          prints this message\n"
          "  -o [0,1,2]  NL mapping on output, 0=none 1=CR 2=CRNL\n"
          "  -p [file]   serial port device to open, default: '%s'\n"
          "  -t          trace mode, with relative time stamps\n",
          progname, 115200, "/dev/ttyS0");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x1c200,%ecx
lea    0x105d(%rip),%r8
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0x106f(%rip),%r8
mov    $0x1c200,%ecx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [409 x i8] c"Usage: %s [OPTION]...\0A -a annotated mode\0A -b [num] baud rate in bits per second, default: %d\0A -c map CR to NL on input\0A -d debug mode\0A -f enable hardware flow control\0A -h prints this message\0A -o [0,1,2] NL mapping on output, 0=none 1=CR 2=CRNL\0A -p [file] serial port device to open, default: '%s'\0A -t trace mode, with relative time stamps\0A\00"
@.str.1 = [11 x i8] c"/dev/ttyS0\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 ([409 x i8], [409 x i8]* @.str, i64 0, i64 0), i8* %4, i32 115200, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [409 x i8] c"Usage: %s [OPTION]...\0A -a annotated mode\0A -b [num] baud rate in bits per second, default: %d\0A -c map CR to NL on input\0A -d debug mode\0A -f enable hardware flow control\0A -h prints this message\0A -o [0,1,2] NL mapping on output, 0=none 1=CR 2=CRNL\0A -p [file] serial port device to open, default: '%s'\0A -t trace mode, with relative time stamps\0A\00"
@.str.1 = [11 x i8] c"/dev/ttyS0\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([409 x i8], [409 x i8]* @.str, i64 0, i64 0), i8* %0, i32 115200, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *fizzbuzz(int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  for (int i = 0; i < 32; i++) {
    printf("%d: %s\n", i, fizzbuzz(i));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    116e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fizzbuzz@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1030 <fizzbuzz@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %s\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i8* @fizzbuzz(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 32
br i1 %7, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_exit();
int /*<<< orphan*/ lw_sock_exit();
void lw_server_exit(int code) {
  lw_sock_exit();
  log_exit();
  exit(code);
}


x86 assembly (clang, -O0):
<lw_server_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lw_sock_exit@plt>
mov    $0x0,%al
call   1040 <log_exit@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<lw_server_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lw_sock_exit@plt>
xor    %eax,%eax
call   1040 <log_exit@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @lw_server_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @lw_sock_exit()
%4 = call i32 (...) @log_exit()
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @lw_server_exit(i32 %0) {
%2 = tail call i32 (...) @lw_sock_exit()
%3 = tail call i32 (...) @log_exit()
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: stripeofeol file [file2 ...]\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: stripeofeol file [file2 ...]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: stripeofeol file [file2 ...]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int FS_Mount(void *FAT, const char *drive) {
  (void)FAT;
  (void)drive;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @FS_Mount(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(int *p) { printf("%d\n", *p); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
double getScaledValue(double oldValue, double oldMin, double oldMax,
                      double newMin, double newMax) {
  double oldRange = (oldMax - oldMin);
  double newRange = (newMax - newMin);
  double newValue = (((oldValue - oldMin) * newRange) / oldRange) + newMin;
  return newValue;
}


x86 assembly (clang, -O0):
<getScaledValue>:
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  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getScaledValue>:
subsd  %xmm1,%xmm2
subsd  %xmm3,%xmm4
subsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @getScaledValue(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %2, %1
%7 = fsub double %4, %3
%8 = fsub double %0, %1
%9 = fmul double %8, %7
%10 = fdiv double %9, %6
%11 = fadd double %10, %3
ret double %11
}
int __ffs(x)
int x;
{
  int cnt;
  int tmp;
  asm("bsfl %2,%0\n"
      "cmovel %1,%0\n"
      : "=&r"(cnt), "=r"(tmp)
      : "rm"(x), "1"(-1));
  return cnt + 1;
}


x86 assembly (clang, -O0):
<__ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xffffffff,%eax
bsf    -0x10(%rbp),%ecx
cmove  %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ffs>:
mov    %edi,-0x4(%rsp)
mov    $0xffffffff,%ecx
bsf    -0x4(%rsp),%eax
cmove  %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "bsfl $2,$0\0Acmovel $1,$0\0A", "=&r,=r,rm,1,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 -1)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @__ffs(i32 %0) {
%2 = tail call { i32, i32 } asm "bsfl $2,$0\0Acmovel $1,$0\0A", "=&r,=r,rm,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 -1)
%3 = extractvalue { i32, i32 } %2, 0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
bool gladiator_gets_the_girl(bool no_change, int door_glad, bool *is_girl) {
  if (no_change) {
    return is_girl[door_glad];
  } else {
    return !is_girl[door_glad];
  }
}


x86 assembly (clang, -O0):
<gladiator_gets_the_girl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112b <gladiator_gets_the_girl+0x2b>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <gladiator_gets_the_girl+0x44>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gladiator_gets_the_girl>:
movslq %esi,%rax
mov    (%rdx,%rax,4),%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
test   %edi,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gladiator_gets_the_girl(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp eq i32 %0, 0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %2, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = select i1 %4, i32 %9, i32 %7
ret i32 %10
}
char *strdup(s)
char *s;
{
  char *result = (char *)malloc(strlen(s) + 1);
  if (result == (char *)0)
    return (char *)0;
  strcpy(result, s);
  return result;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i8* @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
typedef double time_t;
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
int SQLITE_OK;
double time(int /*<<< orphan*/);
int wrap_CurrentTime(sqlite3_vfs *pVfs, double *pTime) {
  time_t t = time(0);
  *pTime = t / 86400.0 + 2440587.5;
  return SQLITE_OK;
}


x86 assembly (clang, -O0):
<wrap_CurrentTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <time@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_CurrentTime>:
push   %rbx
mov    %rsi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
divsd  0xedd(%rip),%xmm0
addsd  0xedd(%rip),%xmm0
movsd  %xmm0,(%rbx)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
define i32 @wrap_CurrentTime(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
%5 = alloca double
store i32* %0, i32** %3
store double* %1, double** %4
%6 = call double @time(i32 0)
store double %6, double* %5
%7 = load double, double* %5
%8 = fdiv double %7, 8.640000e+04
%9 = fadd double %8, 0x41429EC5C0000000
%10 = load double*, double** %4
store double %9, double* %10
%11 = load i32, i32* @SQLITE_OK
ret i32 %11
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @wrap_CurrentTime(i32* nocapture readnone %0, double* nocapture writeonly %1) {
%3 = tail call double @time(i32 0)
%4 = fdiv double %3, 8.640000e+04
%5 = fadd double %4, 0x41429EC5C0000000
store double %5, double* %1
%6 = load i32, i32* @SQLITE_OK
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
unsigned int readLittleEndian(const uint8_t *values) {
  return (unsigned int)((values[0] << 24) | (values[1] << 16) |
                        (values[2] << 8) | values[3]);
}


x86 assembly (clang, -O0):
<readLittleEndian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLittleEndian>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @readLittleEndian(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
void caller_2_2_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_1_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t const);
void *xMalloc(size_t const);
void *xCalloc(const size_t count, const size_t eltsize) {
  void *temp = xMalloc(count * eltsize);
  memset(temp, 0, count * eltsize);
  return temp;
}


x86 assembly (clang, -O0):
<xCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <xMalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xCalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <xMalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @xMalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @xCalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @xMalloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void zeros(int *list, int n) {
  if (n == 0)
    return;
  memset(list, 0, n * sizeof(int));
}


x86 assembly (clang, -O0):
<zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112e <zeros+0x1e>
jmp    1143 <zeros+0x33>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeros>:
test   %esi,%esi
je     1120 <zeros+0x10>
mov    %esi,%edx
shl    $0x2,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>
ret

LLVM IR (-O0):
define void @zeros(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %15
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call i32 @memset(i32* %9, i32 0, i32 %13)
br label %15
15: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @zeros(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = shl i32 %1, 2
%6 = tail call i32 @memset(i32* %0, i32 0, i32 %5)
br label %7
7: ; preds = %2, %4
ret void
}
void plog(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @plog(i8* nocapture %0, ...) {
ret void
}
int stack_empty(unsigned int op_stack_pos) { return op_stack_pos == 0; }


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

x86 assembly (clang, -O2):
<stack_empty>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @stack_empty(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ptr_set_to_zero(int *);
void call_by_ptr_bad() {
  int arr[10];
  int i = 5;
  ptr_set_to_zero(&i);
  arr[i - 1] = 123;
}


x86 assembly (clang, -O0):
<call_by_ptr_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x5,-0x34(%rbp)
lea    -0x34(%rbp),%rdi
call   1030 <ptr_set_to_zero@plt>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
cltq
movl   $0x7b,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_by_ptr_bad>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ptr_set_to_zero@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_by_ptr_bad() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 5, i32* %2
%3 = call i32 @ptr_set_to_zero(i32* %2)
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %6
store i32 123, i32* %7
ret void
}

LLVM IR (-O2):
define void @call_by_ptr_bad() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @ptr_set_to_zero(i32* %1)
ret void
}
const char *MOZ_Z_zlibVersion() { return "1.2.5"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.5\00"
define i8* @MOZ_Z_zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World ! \n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello World ! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void outb(unsigned char v, unsigned short port) {
  asm volatile("outb %0,%1" : : "a"(v), "dN"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb $0,$1", "{ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_14849() {
  Assert_real((isqrt(14849) == 121),
              "/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",
              1595, ("Integer square root of 14849 should be 121"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_14849>:
push   %rax
mov    $0x3a01,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x79,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x63b,%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 = [43 x i8] c"Integer square root of 14849 should be 121\00"
define void @t_sqrt_14849() {
%1 = call i32 @isqrt(i32 14849)
%2 = icmp eq i32 %1, 121
%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 1595, i8* getelementptr inbounds ([43 x i8], [43 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 = [43 x i8] c"Integer square root of 14849 should be 121\00"
define void @t_sqrt_14849() {
%1 = tail call i32 @isqrt(i32 14849)
%2 = icmp eq i32 %1, 121
%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 1595, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, int);
void callee(int *v) {
  printf("*v: %d\n", *v);
  assert(*v == 0xBEEF);
}


x86 assembly (clang, -O0):
<callee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0xbeef,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callee>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
cmpl   $0xbeef,(%rbx)
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"*v: %d\0A\00"
define void @callee(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 48879
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"*v: %d\0A\00"
define void @callee(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 48879
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t
__checkint_uint32_div_unsigned_unsigned(uint32_t x, uint32_t y, int32_t *err) {
  return x / y;
}


x86 assembly (clang, -O0):
<__checkint_uint32_div_unsigned_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__checkint_uint32_div_unsigned_unsigned>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @__checkint_uint32_div_unsigned_unsigned(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sdiv i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__checkint_uint32_div_unsigned_unsigned(i32 %0, i32 %1, i32* nocapture readnone %2) {
%4 = sdiv i32 %0, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void alexandria_visit() {
  printf("You are surrounded by wisdom and knowledge. You feel enlightened.\n");
}


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

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

LLVM IR (-O0):
@.str = [67 x i8] c"You are surrounded by wisdom and knowledge. You feel enlightened.\0A\00"
define void @alexandria_visit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [66 x i8] c"You are surrounded by wisdom and knowledge. You feel enlightened.\00"
define void @alexandria_visit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void check_bool(bool b, bool target) {
  if (b == target)
    printf("==> success\n");
  else
    printf("==> failure\n");
}


x86 assembly (clang, -O0):
<check_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113b <check_bool+0x2b>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
jmp    1147 <check_bool+0x37>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_bool>:
cmp    %esi,%edi
lea    0xef3(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [12 x i8] c"==> failure\00"
@str.2 = [12 x i8] c"==> success\00"
define void @check_bool(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mill_msleep(int /*<<< orphan*/, char *);
int send(int, char *, int, int /*<<< orphan*/);
void trigger(int fd, int64_t deadline) {
  mill_msleep(
      (deadline),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/libmill/refs/heads/master/tests/fdwait.c"
      ":"
      "35");
  ssize_t sz = send(fd, "A", 1, 0);
  assert(sz == 1);
}


x86 assembly (clang, -O0):
<trigger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xeb8(%rip),%rsi
call   1050 <mill_msleep@plt>
mov    -0x4(%rbp),%edi
lea    0xf32(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trigger>:
push   %rbx
mov    %esi,%eax
mov    %edi,%ebx
lea    0xec4(%rip),%rsi
mov    %eax,%edi
call   1050 <mill_msleep@plt>
lea    0xf3f(%rip),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/libmill/refs/heads/master/tests/fdwait.c:35\00"
@.str.1 = [2 x i8] c"A\00"
define void @trigger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @mill_msleep(i32 %6, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = call i32 @send(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/libmill/refs/heads/master/tests/fdwait.c:35\00"
@.str.1 = [2 x i8] c"A\00"
define void @trigger(i32 %0, i32 %1) {
%3 = tail call i32 @mill_msleep(i32 %1, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
int callback3_short_int_int(int (*f)(short)) { return f(3); }


x86 assembly (clang, -O0):
<callback3_short_int_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_short_int_int>:
mov    %rdi,%rax
mov    $0x3,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @callback3_short_int_int(i32 (i16)* nocapture %0) {
%2 = tail call i32 %0(i16 signext 3)
ret i32 %2
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, oldx;
  x = __VERIFIER_nondet_int();
  while (x > 1 && 2 * x <= oldx) {
    oldx = x;
    x = __VERIFIER_nondet_int();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    1147 <main+0x37>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1157 <main+0x47>
jmp    116c <main+0x5c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x2,%eax
jl     1136 <main+0x26>
mov    %eax,%ebx
nop
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x2,%eax
jl     1136 <main+0x26>
mov    %eax,%ecx
add    %eax,%ecx
cmp    %ebx,%ecx
mov    %eax,%ebx
jle    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %2
store i32 %16, i32* %3
%17 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %17, i32* %2
br label %5
18: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %5, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = icmp sgt i32 %5, 1
%7 = shl nsw i32 %5, 1
%8 = icmp sle i32 %7, %4
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret i32 0
}