xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char *argv[]) {
  unsigned int close_to_min = 0;
  close_to_min -= 1;
  printf("close_to_min = %u\n", close_to_min);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"close_to_min = %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %6
%8 = sub i32 %7, 1
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"close_to_min = %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void baz() {
  printf("baz: started\n");
  sleep(1);
  printf("baz: done\n");
}


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

x86 assembly (clang, -O2):
<baz>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"baz: started\0A\00"
@.str.1 = [11 x i8] c"baz: done\0A\00"
define void @baz() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"baz: started\00"
@str.2 = [10 x i8] c"baz: done\00"
define void @baz() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCSI_Out_Bits_RestoreConfig();
void SCSI_Out_Bits_Wakeup(void) { SCSI_Out_Bits_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @SCSI_Out_Bits_Wakeup() {
%1 = tail call i32 (...) @SCSI_Out_Bits_RestoreConfig()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int write_pid_file(const char *file, int pid) {
  FILE *f;
  if ((f = fopen(file, "w")) == NULL)
    return -1;
  fprintf(f, "%d\n", pid);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<write_pid_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1169 <write_pid_file+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <write_pid_file+0x5c>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pid_file>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1166 <write_pid_file+0x36>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    116b <write_pid_file+0x3b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @write_pid_file(i8* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void system_set_ec_clock(void) { (*(uint32_t *)(0x40080120)) = 1; }


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

x86 assembly (clang, -O2):
<system_set_ec_clock>:
movl   $0x1,0x40080120
ret

LLVM IR (-O0):
define void @system_set_ec_clock() {
store i32 1, i32* inttoptr (i64 1074266400 to i32*)
ret void
}

LLVM IR (-O2):
define void @system_set_ec_clock() {
store i32 1, i32* inttoptr (i64 1074266400 to i32*)
ret void
}
int addToZero(int x) {
  if (!x)
    return 0;
  return x + addToZero(x - 1);
}


x86 assembly (clang, -O0):
<addToZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <addToZero+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <addToZero+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <addToZero@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addToZero>:
test   %edi,%edi
je     1119 <addToZero+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @addToZero(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
int ioctl(int, int, int /*<<< orphan*/ *);
int cachedev_ioctl(int cache_fd, int request) {
  pid_t pid = getpid();
  int retval = 0;
  if (cache_fd != -1)
    retval = ioctl(cache_fd, request, &pid);
  return retval;
}


x86 assembly (clang, -O0):
<cachedev_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     115b <cachedev_ioctl+0x3b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
call   1040 <ioctl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cachedev_ioctl>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,0xc(%rsp)
cmp    $0xffffffff,%ebp
je     1150 <cachedev_ioctl+0x30>
lea    0xc(%rsp),%rdx
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <ioctl@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cachedev_ioctl(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 = call i32 (...) @getpid()
store i32 %7, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @ioctl(i32 %11, i32 %12, i32* %5)
store i32 %13, i32* %6
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @cachedev_ioctl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @getpid()
store i32 %5, i32* %3
%6 = icmp eq i32 %0, -1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @ioctl(i32 %0, i32 %1, i32* %3)
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ %8, %7 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkI() {
  blinkdot();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xec6(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkI>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xec9(%rip),%xmm0
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkI() {
%1 = call i32 (...) @blinkdot()
%2 = call i32 (...) @blinkdot()
%3 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkI() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
void private(name) char *name;
{
  outccname(name);
  outnbyte(':');
}


x86 assembly (clang, -O0):
<private>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <outccname@plt>
mov    $0x3a,%edi
mov    $0x0,%al
call   1030 <outnbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<private>:
push   %rax
xor    %eax,%eax
call   1040 <outccname@plt>
mov    $0x3a,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <outnbyte@plt>

LLVM IR (-O0):
define void @private(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @outnbyte to i32 (i32, ...)*)(i32 58)
ret void
}

LLVM IR (-O2):
define void @private(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @outnbyte to i32 (i32, ...)*)(i32 58)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(double, double, double, double);
void init() { glClearColor(0.0, 0.0, 0.0, 0.0); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
jmp    1030 <glClearColor@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}
float voltage_read(void) { return 3.985f; }


x86 assembly (clang, -O0):
<voltage_read>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltage_read>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @voltage_read() {
ret float 0x400FE147A0000000
}

LLVM IR (-O2):
define float @voltage_read() {
ret float 0x400FE147A0000000
}
/* Type definitions */
struct ibv_device_attr {
  int dummy;
};
struct ibv_context {
  int dummy;
};

/* Variables and functions */
int _query_device(struct ibv_context *, struct ibv_device_attr *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_query_device(struct ibv_context *context,
                     struct ibv_device_attr *device_attr) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _query_device(context, device_attr);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_query_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_query_device@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_query_device>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <_query_device@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
%struct.ibv_device_attr = type { i32 }
define i32 @ibv_query_device(%struct.ibv_context* %0, %struct.ibv_device_attr* %1) {
%3 = alloca %struct.ibv_context*
%4 = alloca %struct.ibv_device_attr*
%5 = alloca i32
store %struct.ibv_context* %0, %struct.ibv_context** %3
store %struct.ibv_device_attr* %1, %struct.ibv_device_attr** %4
%6 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%7 = load %struct.ibv_context*, %struct.ibv_context** %3
%8 = load %struct.ibv_device_attr*, %struct.ibv_device_attr** %4
%9 = call i32 @_query_device(%struct.ibv_context* %7, %struct.ibv_device_attr* %8)
store i32 %9, i32* %5
%10 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
%struct.ibv_device_attr = type { i32 }
define i32 @ibv_query_device(%struct.ibv_context* %0, %struct.ibv_device_attr* %1) {
%3 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%4 = tail call i32 @_query_device(%struct.ibv_context* %0, %struct.ibv_device_attr* %1)
%5 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %4
}
char *getenv(const char *name) { return ((void *)0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @getenv(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test2();
int main(int argc, char **argv) {
  if (!test2())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test2@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test2@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test2()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
size_t get_frame_size();
size_t get_mmap_video_size(void) { return get_frame_size() + 4096; }


x86 assembly (clang, -O0):
<get_mmap_video_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_frame_size@plt>
add    $0x1000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mmap_video_size>:
push   %rax
xor    %eax,%eax
call   1030 <get_frame_size@plt>
add    $0x1000,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_mmap_video_size() {
%1 = call i64 (...) @get_frame_size()
%2 = add i64 %1, 4096
ret i64 %2
}

LLVM IR (-O2):
define i64 @get_mmap_video_size() {
%1 = tail call i64 (...) @get_frame_size()
%2 = add i64 %1, 4096
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_putu8() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_putu8"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_tagstruct_putu8\00"
define i32 @pa_tagstruct_putu8() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a = __VERIFIER_nondet_int();
  int b = a;
  a = a + 10;
  b = 5 + b + 5;
  if (a != b) {
  ERROR:
    return -1;
  }
}


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)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     115c <main+0x4c>
jmp    1155 <main+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
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
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 10
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 5, %8
%10 = add nsw i32 %9, 5
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %0
br label %15
15: ; preds = %14
store i32 -1, i32* %1
br label %16
16: ; preds = %15, %0
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  int b;
  int c;
  int ans;
  a = 5;
  b = 5;
  c = a + b;
  ans = (a + b) * (a + b);
  printf("%d", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void target_ops_request(struct target *target) {
  printf("target::request()\n");
}


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

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

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [19 x i8] c"target::request()\0A\00"
define void @target_ops_request(%struct.target* %0) {
%2 = alloca %struct.target*
store %struct.target* %0, %struct.target** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.target = type { i32 }
@str = [18 x i8] c"target::request()\00"
define void @target_ops_request(%struct.target* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
float logf(float x) {
  float r;
  if (!x)
    return __pole_error(1);
  __asm__ __volatile__("fyl2x; fldl2e; fdivp" : "=t"(r) : "0"(x), "u"(1.));
  return r;
}


x86 assembly (clang, -O0):
<logf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    114e <logf+0x3e>
jp     114e <logf+0x3e>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <__pole_error@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    117e <logf+0x6e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
flds   -0x10(%rbp)
fld1
fxch   %st(1)
fyl2x
fldl2e
fdivp  %st,%st(1)
fstp   %st(1)
fstps  -0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    111b <logf+0xb>
jnp    113b <logf+0x2b>
movss  %xmm0,0x4(%rsp)
flds   0x4(%rsp)
fld1
fxch   %st(1)
fyl2x
fldl2e
fdivp  %st,%st(1)
fstp   %st(1)
fstps  (%rsp)
movss  (%rsp),%xmm0
pop    %rax
ret
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <__pole_error@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @logf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp une float %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 (i32, ...) bitcast (i32 (...)* @__pole_error to i32 (i32, ...)*)(i32 1)
%9 = sitofp i32 %8 to float
store float %9, float* %2
br label %14
10: ; preds = %1
%11 = load float, float* %3
%12 = call float asm sideeffect "fyl2x; fldl2e; fdivp", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(float %11, double 1.000000e+00)
store float %12, float* %4
%13 = load float, float* %4
store float %13, float* %2
br label %14
14: ; preds = %10, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @logf(float %0) {
%2 = fcmp une float %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @__pole_error to i32 (i32, ...)*)(i32 1)
%5 = sitofp i32 %4 to float
br label %8
6: ; preds = %1
%7 = tail call float asm sideeffect "fyl2x; fldl2e; fdivp", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(float %0, double 1.000000e+00)
br label %8
8: ; preds = %6, %3
%9 = phi float [ %7, %6 ], [ %5, %3 ]
ret float %9
}
void gdk_display_sync() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_sync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ thuemorse(int);
int main() {
  thuemorse(128);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
call   1030 <thuemorse@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @thuemorse(i32 128)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int suma() {
  int d1, d2, d3;
  printf("Dame tres numeros\n");
  scanf("%d %d %d", &d1, &d2, &d3);
  return d1 + d2 + d3;
}


x86 assembly (clang, -O0):
<suma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suma>:
sub    $0x18,%rsp
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@str = [18 x i8] c"Dame tres numeros\00"
define i32 @suma() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SII9234_GPIO_INIT();
void MHD_GPIO_INIT(void) { SII9234_GPIO_INIT(); }


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

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

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

LLVM IR (-O2):
define void @MHD_GPIO_INIT() {
%1 = tail call i32 (...) @SII9234_GPIO_INIT()
ret void
}
__attribute__((const)) int av_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    c ^= 0x20;
  return c;
}


x86 assembly (clang, -O0):
<av_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <av_toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <av_toupper+0x24>
mov    -0x4(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_toupper>:
lea    -0x61(%rdi),%ecx
mov    %edi,%eax
xor    $0x20,%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @av_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void introduction() {
  printf("\t\t***%c%c CRISS-CROSS GAME %c%c***\n\n\n", 2, 1, 1, 2);
  printf("## You can play against computer or human.\n");
  printf("## Every player will get chance by turns.\n\n");
  return;
}


x86 assembly (clang, -O0):
<introduction>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%r8d
mov    $0x1,%ecx
mov    %r8d,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<introduction>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\09\09***%c%c CRISS-CROSS GAME %c%c***\0A\0A\0A\00"
@.str.1 = [44 x i8] c"## You can play against computer or human.\0A\00"
@.str.2 = [44 x i8] c"## Every player will get chance by turns.\0A\0A\00"
define void @introduction() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i32 1, i32 2)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\09\09***%c%c CRISS-CROSS GAME %c%c***\0A\0A\0A\00"
@str = [43 x i8] c"## You can play against computer or human.\00"
@str.3 = [43 x i8] c"## Every player will get chance by turns.\0A\00"
define void @introduction() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i32 1, i32 2)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
ret void
}
char **__backtrace_symbols(void *__const *__array, int __size) {
  return (char **)0;
}


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

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

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

LLVM IR (-O2):
define noalias i8** @__backtrace_symbols(i8** nocapture readnone %0, i32 %1) {
ret i8** null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int silnia(int);
int main(void) {
  int a;
  printf("Podaj niezbyt duza liczbe naturanla :)\n");
  scanf("%d", &a);
  printf("silnia(%d)\n", silnia(a - 1) * a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <silnia@plt>
mov    %eax,%esi
imul   -0x4(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
add    $0xffffffff,%edi
call   1050 <silnia@plt>
imul   0x4(%rsp),%eax
lea    0xe8d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Podaj niezbyt duza liczbe naturanla :)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"silnia(%d)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sub nsw i32 %4, 1
%6 = call i32 @silnia(i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %6, %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"silnia(%d)\0A\00"
@str = [39 x i8] c"Podaj niezbyt duza liczbe naturanla :)\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
%7 = call i32 @silnia(i32 %6)
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
double fahrenheit_to_celsius(double F) {
  double C = 0.0;
  return C;
}


x86 assembly (clang, -O0):
<fahrenheit_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit_to_celsius>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @fahrenheit_to_celsius(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @fahrenheit_to_celsius(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_add();
int /*<<< orphan*/ test_cast();
int /*<<< orphan*/ test_complex();
int /*<<< orphan*/ test_div();
int /*<<< orphan*/ test_mul();
int /*<<< orphan*/ test_sub();
int main(void) {
  test_add();
  test_sub();
  test_mul();
  test_div();
  test_cast();
  test_complex();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <test_add@plt>
mov    $0x0,%al
call   1050 <test_sub@plt>
mov    $0x0,%al
call   1030 <test_mul@plt>
mov    $0x0,%al
call   1060 <test_div@plt>
mov    $0x0,%al
call   1040 <test_cast@plt>
mov    $0x0,%al
call   1080 <test_complex@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <test_add@plt>
xor    %eax,%eax
call   1050 <test_sub@plt>
xor    %eax,%eax
call   1030 <test_mul@plt>
xor    %eax,%eax
call   1060 <test_div@plt>
xor    %eax,%eax
call   1040 <test_cast@plt>
xor    %eax,%eax
call   1080 <test_complex@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_add()
%3 = call i32 (...) @test_sub()
%4 = call i32 (...) @test_mul()
%5 = call i32 (...) @test_div()
%6 = call i32 (...) @test_cast()
%7 = call i32 (...) @test_complex()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_add()
%2 = tail call i32 (...) @test_sub()
%3 = tail call i32 (...) @test_mul()
%4 = tail call i32 (...) @test_div()
%5 = tail call i32 (...) @test_cast()
%6 = tail call i32 (...) @test_complex()
%7 = tail call i32 @exit(i32 0)
unreachable
}
void lgtd_proto_power_on(struct lgtd_client *client,
                         const struct lgtd_proto_target_list *targets) {
  (void)client;
  (void)targets;
}


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

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

LLVM IR (-O0):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_power_on(%struct.lgtd_client* %0, %struct.lgtd_proto_target_list* %1) {
%3 = alloca %struct.lgtd_client*
%4 = alloca %struct.lgtd_proto_target_list*
store %struct.lgtd_client* %0, %struct.lgtd_client** %3
store %struct.lgtd_proto_target_list* %1, %struct.lgtd_proto_target_list** %4
%5 = load %struct.lgtd_client*, %struct.lgtd_client** %3
%6 = load %struct.lgtd_proto_target_list*, %struct.lgtd_proto_target_list** %4
ret void
}

LLVM IR (-O2):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_power_on(%struct.lgtd_client* nocapture %0, %struct.lgtd_proto_target_list* nocapture %1) {
ret void
}
void WF_GpioInit() {
  if (1)
    *(volatile unsigned *)(0xBF800000 + (0x60628)) = 1 << 1;
  else
    *(volatile unsigned *)(0xBF800000 + (0x60624)) = 1 << 1;
  if (0)
    *(volatile unsigned *)(0xBF800000 + (0x60618)) = 1 << 1;
  else
    *(volatile unsigned *)(0xBF800000 + (0x60614)) = 1 << 1;
  if (0)
    *(volatile unsigned *)(0xBF800000 + (0x60528)) = 1 << 4;
  else
    *(volatile unsigned *)(0xBF800000 + (0x60524)) = 1 << 4;
  if (0)
    *(volatile unsigned *)(0xBF800000 + (0x60518)) = 1 << 4;
  else
    *(volatile unsigned *)(0xBF800000 + (0x60514)) = 1 << 4;
}


x86 assembly (clang, -O0):
<WF_GpioInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf860628,%eax
movl   $0x2,(%rax)
mov    $0xbf860614,%eax
movl   $0x2,(%rax)
mov    $0xbf860524,%eax
movl   $0x10,(%rax)
mov    $0xbf860514,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WF_GpioInit>:
mov    $0xbf860514,%eax
movl   $0x2,0x114(%rax)
movl   $0x2,0x100(%rax)
movl   $0x10,0x10(%rax)
movl   $0x10,(%rax)
ret

LLVM IR (-O0):
define void @WF_GpioInit() {
store volatile i32 2, i32* inttoptr (i64 3213231656 to i32*)
store volatile i32 2, i32* inttoptr (i64 3213231636 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213231396 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213231380 to i32*)
ret void
}

LLVM IR (-O2):
define void @WF_GpioInit() {
store volatile i32 2, i32* inttoptr (i64 3213231656 to i32*)
store volatile i32 2, i32* inttoptr (i64 3213231636 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213231396 to i32*)
store volatile i32 16, i32* inttoptr (i64 3213231380 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lirerr(int);
void find_preceeding_part(void) { lirerr(888100); }


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

x86 assembly (clang, -O2):
<find_preceeding_part>:
mov    $0xd8d24,%edi
jmp    1030 <lirerr@plt>

LLVM IR (-O0):
define void @find_preceeding_part() {
%1 = call i32 @lirerr(i32 888100)
ret void
}

LLVM IR (-O2):
define void @find_preceeding_part() {
%1 = tail call i32 @lirerr(i32 888100)
ret void
}
double foo(double *x, double *y) {
  double z[2];
  int i;
  for (i = 0; i < 2; i++)
    z[i] = x[i] + y[i];
  return z[0] * z[1];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    114f <foo+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movslq -0x24(%rbp),%rax
movsd  %xmm0,-0x20(%rbp,%rax,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1113 <foo+0x13>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movupd (%rdi),%xmm0
movupd (%rsi),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @foo(double* nocapture %0, double* nocapture %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = bitcast double* %1 to <2 x double>*
%6 = load <2 x double>, <2 x double>* %5
%7 = fadd <2 x double> %4, %6
%8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%9 = fmul <2 x double> %7, %8
%10 = extractelement <2 x double> %9, i64 0
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void die_errno(const char *desc) {
  if (errno)
    perror(desc);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
cmpq   $0x0,(%rax)
je     1146 <die_errno+0x26>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_errno>:
push   %rax
mov    0x2eb8(%rip),%rax
cmpq   $0x0,(%rax)
je     1133 <die_errno+0x13>
call   1030 <perror@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@EXIT_FAILURE = global i32 0
define void @die_errno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@EXIT_FAILURE = global i32 0
define void @die_errno(i8* nocapture %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned short, int /*<<< orphan*/ *);
unsigned short unicode_to_koi8(unsigned short);
void koi8_putc(unsigned short ch, FILE *fout) {
  ch = unicode_to_koi8(ch);
  if (!ch)
    ch = '?';
  putc(ch, fout);
}


x86 assembly (clang, -O0):
<koi8_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <unicode_to_koi8@plt>
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1151 <koi8_putc+0x31>
movw   $0x3f,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<koi8_putc>:
push   %rbx
mov    %rsi,%rbx
call   1030 <unicode_to_koi8@plt>
test   %ax,%ax
mov    $0x3f,%ecx
cmovne %eax,%ecx
movzwl %cx,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @koi8_putc(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = call zeroext i16 @unicode_to_koi8(i16 zeroext %5)
store i16 %6, i16* %3
%7 = load i16, i16* %3
%8 = icmp ne i16 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i16 63, i16* %3
br label %10
10: ; preds = %9, %2
%11 = load i16, i16* %3
%12 = load i32*, i32** %4
%13 = call i32 @putc(i16 zeroext %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @koi8_putc(i16 zeroext %0, i32* nocapture %1) {
%3 = tail call zeroext i16 @unicode_to_koi8(i16 zeroext %0)
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i16 63, i16 %3
%6 = tail call i32 @putc(i16 zeroext %5, i32* %1)
ret void
}