xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
int /*<<< orphan*/ wifi_pm_gpio_ctrl(char *, int);
void sif_platform_target_poweron(void) {
  wifi_pm_gpio_ctrl("esp_wl_chip_en", 1);
  mdelay(100);
  wifi_pm_gpio_ctrl("esp_wl_rst", 1);
  mdelay(100);
}


x86 assembly (clang, -O0):
<sif_platform_target_poweron>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
call   1030 <mdelay@plt>
lea    0xec9(%rip),%rdi
mov    $0x1,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
call   1030 <mdelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sif_platform_target_poweron>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
call   1030 <mdelay@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <mdelay@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"esp_wl_chip_en\00"
@.str.1 = [11 x i8] c"esp_wl_rst\00"
define void @sif_platform_target_poweron() {
%1 = call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @mdelay(i32 100)
%3 = call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 @mdelay(i32 100)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"esp_wl_chip_en\00"
@.str.1 = [11 x i8] c"esp_wl_rst\00"
define void @sif_platform_target_poweron() {
%1 = tail call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @mdelay(i32 100)
%3 = tail call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = tail call i32 @mdelay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ inner();
void *malloc(int);
void middle(void) {
  void *ptr = malloc(1024);
  inner();
  free(ptr);
}


x86 assembly (clang, -O0):
<middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <inner@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle>:
push   %rbx
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <inner@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @middle() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1024)
store i8* %2, i8** %1
%3 = call i32 (...) @inner()
%4 = load i8*, i8** %1
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
define void @middle() {
%1 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%2 = tail call i32 (...) @inner()
%3 = tail call i32 @free(i8* %1)
ret void
}
int equal_live_vars(void *v1, void *v2) {
  if (v1 == v2) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<equal_live_vars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <equal_live_vars+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <equal_live_vars+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_live_vars>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equal_live_vars(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void tdefault_detach(struct target_ops *self, const char *arg1, int arg2) {}


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

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

LLVM IR (-O0):
%struct.target_ops = type opaque
define void @tdefault_detach(%struct.target_ops* %0, i8* %1, i32 %2) {
%4 = alloca %struct.target_ops*
%5 = alloca i8*
%6 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_detach(%struct.target_ops* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_set_rcvbuf() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_set_rcvbuf"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_set_rcvbuf>:
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_socket_set_rcvbuf>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_socket_set_rcvbuf\00"
define i32 @pa_socket_set_rcvbuf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ abort_report(char *, ...);
scalar_t__ fclose(int /*<<< orphan*/ *);
void sclose(FILE *file) {
  if (fclose(file) == EOF)
    (1 == 1) ? abort_report("Could not close file", "")
             : abort_report("Could not close file");
}


x86 assembly (clang, -O0):
<sclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
jne    115a <sclose+0x3a>
lea    0xeb4(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <abort_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sclose>:
push   %rax
call   1030 <fclose@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jne    1148 <sclose+0x28>
lea    0xec7(%rip),%rdi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <abort_report@plt>
pop    %rax
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [21 x i8] c"Could not close file\00"
@.str.1 = [1 x i8] zeroinitializer
define void @sclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [21 x i8] c"Could not close file\00"
@.str.1 = [1 x i8] zeroinitializer
define void @sclose(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
double square(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int semctl(int, int, int /*<<< orphan*/);
void jd_sem_close(int semid, int count) {
  int rc;
  rc = semctl(semid, count, IPC_RMID);
  if (rc == -1) {
    printf("semctl error");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<jd_sem_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
call   1040 <semctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1175 <jd_sem_close+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jd_sem_close>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
call   1040 <semctl@plt>
cmp    $0xffffffff,%eax
je     1146 <jd_sem_close+0x16>
pop    %rax
ret
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [13 x i8] c"semctl error\00"
define void @jd_sem_close(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* %3
%7 = load i32, i32* %4
%8 = load i32, i32* @IPC_RMID
%9 = call i32 @semctl(i32 %6, i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [13 x i8] c"semctl error\00"
define void @jd_sem_close(i32 %0, i32 %1) {
%3 = load i32, i32* @IPC_RMID
%4 = tail call i32 @semctl(i32 %0, i32 %1, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
int rotateLeft(int x, int n) {
  int mask = ~0 << n;
  int _32_minus_n = 32 + (~n + 1);
  return (x << n & mask) | (x >> _32_minus_n & ~mask);
}


x86 assembly (clang, -O0):
<rotateLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
add    $0x20,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
and    -0xc(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateLeft>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %edi,%edx
shl    %cl,%edx
neg    %cl
sar    %cl,%edi
not    %eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @rotateLeft(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 -1, %7
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = xor i32 %9, -1
%11 = add nsw i32 %10, 1
%12 = add nsw i32 32, %11
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 %13, %14
%16 = load i32, i32* %5
%17 = and i32 %15, %16
%18 = load i32, i32* %3
%19 = load i32, i32* %6
%20 = ashr i32 %18, %19
%21 = load i32, i32* %5
%22 = xor i32 %21, -1
%23 = and i32 %20, %22
%24 = or i32 %17, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @rotateLeft(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %1
%6 = ashr i32 %0, %4
%7 = xor i32 %3, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %5
ret i32 %9
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int *ivector(long nl, long nh) {
  int *v;
  void nrerror(char error_text[]);
  v = (int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  if (!v)
    nrerror("allocation failure in ivector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <ivector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <ivector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %17, label %16
16: ; preds = %2
br label %17
17: ; preds = %16, %2
%18 = load i32*, i32** %5
%19 = load i64, i64* %3
%20 = sub i64 0, %19
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = getelementptr inbounds i32, i32* %21, i64 1
ret i32* %22
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
tail call void @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %8, %2
%10 = inttoptr i64 %6 to i32*
%11 = sub i64 0, %0
%12 = getelementptr inbounds i32, i32* %10, i64 %11
%13 = getelementptr inbounds i32, i32* %12, i64 1
ret i32* %13
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar('5' + 3);
  putchar('5' - 3);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i8 signext 56)
%3 = call i32 @putchar(i8 signext 50)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 56)
%2 = tail call i32 @putchar(i8 signext 50)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int counter;
  for (counter = 1; counter < argc; counter++) {
    printf("Argument%d:  %s\n", counter, argv[counter]);
  }
  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   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Argument%d: %s\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 1, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Argument%d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ i2c_send_raw(int);
int /*<<< orphan*/ i2c_start();
void i2c_start_command() {
  i2c_start();
  i2c_send_raw(0x00);
}


x86 assembly (clang, -O0):
<i2c_start_command>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <i2c_start@plt>
xor    %edi,%edi
call   1030 <i2c_send_raw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_start_command>:
push   %rax
xor    %eax,%eax
call   1040 <i2c_start@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <i2c_send_raw@plt>

LLVM IR (-O0):
define void @i2c_start_command() {
%1 = call i32 (...) @i2c_start()
%2 = call i32 @i2c_send_raw(i32 0)
ret void
}

LLVM IR (-O2):
define void @i2c_start_command() {
%1 = tail call i32 (...) @i2c_start()
%2 = tail call i32 @i2c_send_raw(i32 0)
ret void
}
void up_abort(void) {}


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

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

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

LLVM IR (-O2):
define void @up_abort() {
ret void
}
void cpuhvfs_notify_cluster_on(unsigned int cluster) {}


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

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

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

LLVM IR (-O2):
define void @cpuhvfs_notify_cluster_on(i32 %0) {
ret void
}
void glGetVertexAttribIuiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetVertexAttribIuiv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void test_wait_child() { exit(42); }


x86 assembly (clang, -O0):
<test_wait_child>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<test_wait_child>:
push   %rax
mov    $0x2a,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @test_wait_child() {
%1 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
define void @test_wait_child() {
%1 = tail call i32 @exit(i32 42)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage: "
          "RNAsubopt [-e range] [-ep prange] [-s] [-p num] [-logML]\n"
          "          [-C] [-T temp] [-4] [-d[2]] [-noGU] [-noCloseGU]\n"
          "          [-noLP] [-P paramfile] [-nsp pairs] [-circ] [-z]");
}


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

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

LLVM IR (-O0):
@.str = [182 x i8] c"usage: RNAsubopt [-e range] [-ep prange] [-s] [-p num] [-logML]\0A [-C] [-T temp] [-4] [-d[2]] [-noGU] [-noCloseGU]\0A [-noLP] [-P paramfile] [-nsp pairs] [-circ] [-z]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [182 x i8] c"usage: RNAsubopt [-e range] [-ep prange] [-s] [-p num] [-logML]\0A [-C] [-T temp] [-4] [-d[2]] [-noGU] [-noCloseGU]\0A [-noLP] [-P paramfile] [-nsp pairs] [-circ] [-z]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strnlen(char const *, size_t);
int strn_has_null_terminator(const char *src, size_t size) {
  if (!src)
    return 0;
  return strnlen(src, size) < size;
}


x86 assembly (clang, -O0):
<strn_has_null_terminator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <strn_has_null_terminator+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1153 <strn_has_null_terminator+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strnlen@plt>
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strn_has_null_terminator>:
test   %rdi,%rdi
je     112b <strn_has_null_terminator+0x1b>
push   %rbx
mov    %rsi,%rbx
call   1030 <strnlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
setb   %al
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strn_has_null_terminator(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @strnlen(i8* %0, i64 %1)
%6 = icmp ult i64 %5, %1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int printf(char *, long);
int header_content_length(off_t len) {
  return printf("Content-Length: %ld\n", (long)len);
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"Content-Length: %ld\0A\00"
define i32 @header_content_length(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int _lseek(int fd, off_t pos, int whence) { return -1; }


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_lseek(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ foo(int, double, double, double);
int main() { return (int)foo(3, 1.0, 2.0, 3.0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
movsd  0xed4(%rip),%xmm2
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
mov    $0x3,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(i32 3, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00)
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 3, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int rmdir(char const *);
int fs_rmdir(const char *path) { return rmdir(path); }


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

x86 assembly (clang, -O2):
<fs_rmdir>:
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define i32 @fs_rmdir(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
float drand48();
float delta_n_step(float n, float lambda, float dt) {
  float rand_num = drand48();
  if (rand_num < lambda * n * dt) {
    return -1.0;
  } else {
    return 0.0;
  }
}


x86 assembly (clang, -O0):
<delta_n_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1162 <delta_n_step+0x52>
movss  0xea8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116a <delta_n_step+0x5a>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_n_step>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <drand48@plt>
movss  0xc(%rsp),%xmm1
mulss  0x10(%rsp),%xmm1
mulss  0x14(%rsp),%xmm1
cmpltss %xmm1,%xmm0
movss  0xeb4(%rip),%xmm1
andps  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @delta_n_step(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%9 = call float (...) @drand48()
store float %9, float* %8
%10 = load float, float* %8
%11 = load float, float* %6
%12 = load float, float* %5
%13 = fmul float %11, %12
%14 = load float, float* %7
%15 = fmul float %13, %14
%16 = fcmp olt float %10, %15
br i1 %16, label %17, label %18
17: ; preds = %3
store float -1.000000e+00, float* %4
br label %19
18: ; preds = %3
store float 0.000000e+00, float* %4
br label %19
19: ; preds = %18, %17
%20 = load float, float* %4
ret float %20
}

LLVM IR (-O2):
define float @delta_n_step(float %0, float %1, float %2) {
%4 = tail call float (...) @drand48()
%5 = fmul float %0, %1
%6 = fmul float %5, %2
%7 = fcmp olt float %4, %6
%8 = select i1 %7, float -1.000000e+00, float 0.000000e+00
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ PDCWrite(int, int);
void PDCLCDBacklightOn(void) { PDCWrite(0x1, 0x01); }


x86 assembly (clang, -O0):
<PDCLCDBacklightOn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <PDCWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDCLCDBacklightOn>:
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <PDCWrite@plt>

LLVM IR (-O0):
define void @PDCLCDBacklightOn() {
%1 = call i32 @PDCWrite(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @PDCLCDBacklightOn() {
%1 = tail call i32 @PDCWrite(i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(void *bar) {
  if (!bar)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112e <foo+0x1e>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %rdi,%rdi
je     1116 <foo+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @foo(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
int g_is_higher_f_2(float s, float d) { return (s > d); }


x86 assembly (clang, -O0):
<g_is_higher_f_2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_is_higher_f_2>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @g_is_higher_f_2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @g_is_higher_f_2(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
uint64_t sem_time_millis(struct timespec *ts) {
  return (uint64_t)(ts->tv_sec * 1000 + ts->tv_nsec / 1000000);
}


x86 assembly (clang, -O0):
<sem_time_millis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_time_millis>:
imul   $0x3e8,(%rdi),%ecx
movslq 0x4(%rdi),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @sem_time_millis(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @sem_time_millis(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000000
%8 = add nsw i32 %7, %4
ret i32 %8
}
void BN_nist_mod_224(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_nist_mod_224() {
ret void
}
double KMtoMI(double KM) { return KM * 0.621371192; }


x86 assembly (clang, -O0):
<KMtoMI>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @KMtoMI(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3FE3E245D68A2112
ret double %4
}

LLVM IR (-O2):
define double @KMtoMI(double %0) {
%2 = fmul double %0, 0x3FE3E245D68A2112
ret double %2
}
void my_io_aport() {}


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

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

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

LLVM IR (-O2):
define void @my_io_aport() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ diff(int, int, int, int, int, int);
void simple(int x, int y, int dr, int dg, int db) {
  diff(x + 1, y, 1, dr, dg, db);
}


x86 assembly (clang, -O0):
<simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    $0x1,%edx
call   1030 <diff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
add    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <diff@plt>

LLVM IR (-O0):
define void @simple(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @diff(i32 %12, i32 %13, i32 1, i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @simple(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %0, 1
%7 = tail call i32 @diff(i32 %6, i32 %1, i32 1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
void *xmalloc(size_t);
void *xrealloc(void *ptr, size_t size) {
  if (!ptr)
    return xmalloc(size);
  ptr = realloc(ptr, size);
  if (!ptr)
    error(1, 0, "virtual memory exhausted");
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <xrealloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1194 <xrealloc+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118c <xrealloc+0x5c>
mov    $0x1,%edi
xor    %esi,%esi
lea    0xe79(%rip),%rdx
call   1050 <error@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
test   %rdi,%rdi
je     115d <xrealloc+0x2d>
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <xrealloc+0x28>
lea    0xeb6(%rip),%rdx
xor    %ebx,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret
mov    %rsi,%rdi
jmp    1030 <xmalloc@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64, i64* %5
%10 = call i8* @xmalloc(i64 %9)
store i8* %10, i8** %3
br label %21
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %11
%18 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %11
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %21
21: ; preds = %19, %8
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @xmalloc(i64 %1)
br label %11
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %6, %9, %4
%12 = phi i8* [ %5, %4 ], [ null, %9 ], [ %7, %6 ]
ret i8* %12
}
/* Variables and functions */
size_t previous_size_index(size_t size_index) {
  if (size_index == 0)
    return size_index;
  return size_index - 1;
}


x86 assembly (clang, -O0):
<previous_size_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <previous_size_index+0x20>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <previous_size_index+0x2c>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<previous_size_index>:
xor    %eax,%eax
sub    $0x1,%rdi
cmovae %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @previous_size_index(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = add i64 %0, -1
%4 = select i1 %2, i64 0, i64 %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char *strcat(char *dest, const char *src) {
  char *ret = dest;
  while (*dest++)
    ;
  strcpy(--dest, src);
  return ret;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1145 <strcat+0x35>
jmp    1128 <strcat+0x18>
mov    -0x8(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <strcat+0x10>
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %4, i8* %1)
ret i8* %0
}
/* Variables and functions */
int ASNDerCalcNumLengthBytes(long);
long ASNDerCalcTokenLength(long nLength, long nDataLength) {
  long nTotalLength = ASNDerCalcNumLengthBytes(nLength) + 1;
  return nTotalLength + nDataLength;
}


x86 assembly (clang, -O0):
<ASNDerCalcTokenLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ASNDerCalcNumLengthBytes@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASNDerCalcTokenLength>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ASNDerCalcNumLengthBytes@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ASNDerCalcTokenLength(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i32 @ASNDerCalcNumLengthBytes(i64 %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = add nsw i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ASNDerCalcTokenLength(i64 %0, i64 %1) {
%3 = tail call i32 @ASNDerCalcNumLengthBytes(i64 %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %1
ret i64 %6
}
/* Variables and functions */
char *minisetlocale(char *a, char *b) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @minisetlocale(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int compare_intsDes(const void *p, const void *q) {
  int x = *(const int *)p;
  int y = *(const int *)q;
  if (x < y)
    return 1;
  else if (x > y)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_intsDes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <compare_intsDes+0x36>
movl   $0x1,-0x4(%rbp)
jmp    115a <compare_intsDes+0x5a>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <compare_intsDes+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <compare_intsDes+0x5a>
jmp    1153 <compare_intsDes+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_intsDes>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setg   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_intsDes(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %25
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %25
23: ; preds = %18
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %17
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @compare_intsDes(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *, char *);
void badsize(void) { cprintf("%s", "\n** illegal size field **\n"); }


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

x86 assembly (clang, -O2):
<badsize>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <cprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [27 x i8] c"\0A** illegal size field **\0A\00"
define void @badsize() {
%1 = call i32 @cprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [27 x i8] c"\0A** illegal size field **\0A\00"
define void @badsize() {
%1 = tail call i32 @cprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double tan(double x) {
  return ({
    extern __typeof__(tan) module_libc_tan;
    &module_libc_tan;
  })(x);
}


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
jmp    1030 <module_libc_tan@plt>

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
%3 = alloca double (double)*
store double %0, double* %2
store double (double)* @module_libc_tan, double (double)** %3
%4 = load double (double)*, double (double)** %3
%5 = load double, double* %2
%6 = call double %4(double %5)
ret double %6
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @module_libc_tan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *thread_worker(void *payload) {
  while (1) {
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<thread_worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111c <thread_worker+0xc>

x86 assembly (clang, -O2):
<thread_worker>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <thread_worker+0x10>

LLVM IR (-O0):
define i8* @thread_worker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @thread_worker(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}