xunge/DecIR huggingface dataset:
/* Variables and functions */
double fabs(int);
double pow(double, int);
double f6(double x, double y) {
  return fabs(-15. + x * x * (45. - x * x * (-15. + x * x))) / pow(y, 6.);
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xea4(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe85(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x6,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xebe(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
cvttsd2si %xmm3,%edi
call   1030 <fabs@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x6,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f6(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fmul double %8, %9
%11 = load double, double* %3
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double -1.500000e+01)
%14 = fneg double %10
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double 4.500000e+01)
%16 = call double @llvm.fmuladd.f64(double %7, double %15, double -1.500000e+01)
%17 = fptosi double %16 to i32
%18 = call double @fabs(i32 %17)
%19 = load double, double* %4
%20 = call double @pow(double %19, i32 6)
%21 = fdiv double %18, %20
ret double %21
}

LLVM IR (-O2):
define double @f6(double %0, double %1) {
%3 = fmul double %0, %0
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -1.500000e+01)
%5 = fneg double %3
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double 4.500000e+01)
%7 = tail call double @llvm.fmuladd.f64(double %3, double %6, double -1.500000e+01)
%8 = fptosi double %7 to i32
%9 = tail call double @fabs(i32 %8)
%10 = tail call double @pow(double %1, i32 6)
%11 = fdiv double %9, %10
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ SXNET;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ SXNET_it;
SXNET *d2i_SXNET(SXNET **a, const unsigned char **in, long len) {
  return (SXNET *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &SXNET_it);
}


x86 assembly (clang, -O0):
<d2i_SXNET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_SXNET>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

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

LLVM IR (-O2):
@SXNET_it = global i32 0
define i32* @d2i_SXNET(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @SXNET_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void csv_emit_row_empty(void *ctx) { (void)ctx; }


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

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

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

LLVM IR (-O2):
define void @csv_emit_row_empty(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int errno;
int __tcp_accept(int s, struct sockaddr *sin, socklen_t *addrlen, int timeout) {
  int ret, fd;
  (void)timeout;
  fd = accept(s, sin, addrlen);
  if (fd < 0) {
    ret = errno;
    goto err_ret;
  }
  return fd;
err_ret:
  return -ret;
}


x86 assembly (clang, -O0):
<__tcp_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1154 <__tcp_accept+0x44>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
jmp    115f <__tcp_accept+0x4f>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <__tcp_accept+0x57>
xor    %eax,%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tcp_accept>:
push   %rax
call   1030 <accept@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @__tcp_accept(i32 %0, %struct.sockaddr* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.sockaddr*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store %struct.sockaddr* %1, %struct.sockaddr** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%12 = load i32, i32* %9
%13 = load i32, i32* %6
%14 = load %struct.sockaddr*, %struct.sockaddr** %7
%15 = load i32*, i32** %8
%16 = call i32 @accept(i32 %13, %struct.sockaddr* %14, i32* %15)
store i32 %16, i32* %11
%17 = load i32, i32* %11
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = load i32, i32* @errno
store i32 %20, i32* %10
br label %23
21: ; preds = %4
%22 = load i32, i32* %11
store i32 %22, i32* %5
br label %26
23: ; preds = %19
%24 = load i32, i32* %10
%25 = sub nsw i32 0, %24
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %21
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @__tcp_accept(i32 %0, %struct.sockaddr* %1, i32* %2, i32 %3) {
%5 = tail call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2)
%6 = icmp slt i32 %5, 0
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %5
ret i32 %9
}
/* Variables and functions */
int rom_readsect(int, void *);
int sdcard_readsect(int, void *);
int disk_readsect(int id, int lba, void *buf) {
  if (id == 0) {
    return rom_readsect(lba, buf);
  } else if (id == 0x80) {
    return sdcard_readsect(lba, buf);
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<disk_readsect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1150 <disk_readsect+0x30>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <rom_readsect@plt>
mov    %eax,-0x4(%rbp)
jmp    1178 <disk_readsect+0x58>
cmpl   $0x80,-0x8(%rbp)
jne    1171 <disk_readsect+0x51>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <sdcard_readsect@plt>
mov    %eax,-0x4(%rbp)
jmp    1178 <disk_readsect+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disk_readsect>:
cmp    $0x80,%edi
je     1136 <disk_readsect+0x16>
test   %edi,%edi
jne    1140 <disk_readsect+0x20>
mov    %esi,%edi
mov    %rdx,%rsi
jmp    1030 <rom_readsect@plt>
mov    %esi,%edi
mov    %rdx,%rsi
jmp    1040 <sdcard_readsect@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @disk_readsect(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = call i32 @rom_readsect(i32 %11, i8* %12)
store i32 %13, i32* %4
br label %22
14: ; preds = %3
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 128
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %6
%19 = load i8*, i8** %7
%20 = call i32 @sdcard_readsect(i32 %18, i8* %19)
store i32 %20, i32* %4
br label %22
21: ; preds = %14
store i32 -1, i32* %4
br label %22
22: ; preds = %21, %17, %10
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @disk_readsect(i32 %0, i32 %1, i8* %2) {
switch i32 %0, label %8 [
i32 0, label %4
i32 128, label %6
]
4: ; preds = %3
%5 = tail call i32 @rom_readsect(i32 %1, i8* %2)
br label %8
6: ; preds = %3
%7 = tail call i32 @sdcard_readsect(i32 %1, i8* %2)
br label %8
8: ; preds = %3, %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
void gtk_window_get_modal() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_modal() {
ret void
}
void get_nand(double *x) {
  union {
    double f;
    struct {
      unsigned : 1, e : 11;
    } s;
  } z;
  z.s.e = 0x7ff;
  *x = z.f;
}


x86 assembly (clang, -O0):
<get_nand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%ax
and    $0xf001,%ax
or     $0xffe,%ax
mov    %ax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nand>:
movq   $0xffe,(%rdi)
ret

LLVM IR (-O0):
%union.anon = type { double }
%struct.anon = type { i16, [2 x i8] }
define void @get_nand(double* %0) {
%2 = alloca double*
%3 = alloca %union.anon
store double* %0, double** %2
%4 = bitcast %union.anon* %3 to %struct.anon*
%5 = bitcast %struct.anon* %4 to i16*
%6 = load i16, i16* %5
%7 = and i16 %6, -4095
%8 = or i16 %7, 4094
store i16 %8, i16* %5
%9 = bitcast %union.anon* %3 to double*
%10 = load double, double* %9
%11 = load double*, double** %2
store double %10, double* %11
ret void
}

LLVM IR (-O2):
define void @get_nand(double* nocapture writeonly %0) {
store double 2.022700e-320, double* %0
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR59_set(void) { return U_WMRCORENONE_set("U_WMR59"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR59\00"
define i8* @U_WMR59_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR59\00"
define i8* @U_WMR59_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *stringyHexTo64(char *, int);
int main(int argc, char const *argv[]) {
  char *input = "49276d206b696c6c696e6720796f757220627261696e206c696b6520612070"
                "6f69736f6e6f7573206d757368726f6f6d";
  int input_length = 96;
  char *result = stringyHexTo64(input, input_length);
  printf("%s\n", result);
  free(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x60,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <stringyHexTo64@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xeee(%rip),%rdi
call   1050 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x60,%esi
call   1040 <stringyHexTo64@plt>
mov    %rax,%rbx
lea    0xf15(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [97 x i8] c"49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i8** %6
store i32 96, i32* %7
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = call i8* @stringyHexTo64(i8* %9, i32 %10)
store i8* %11, i8** %8
%12 = load i8*, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %8
%15 = call i32 @free(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [97 x i8] c"49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @stringyHexTo64(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i32 96)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 0
}
void DMA1_Channel3_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Channel3_IRQHandler() {
ret void
}
void I2SIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000C10))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<I2SIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0xc10(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0xc10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SIntDisable>:
not    %rsi
and    %rsi,0xc10(%rdi)
ret

LLVM IR (-O0):
define void @I2SIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 3088
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2SIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 3088
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ bkgdset(int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
void ncurses_shutdown(void) {
  bkgdset(COLOR_PAIR(0));
  clear();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<ncurses_shutdown>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <bkgdset@plt>
mov    $0x0,%al
call   1070 <clear@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncurses_shutdown>:
push   %rax
xor    %edi,%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <bkgdset@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
define void @ncurses_shutdown() {
%1 = call i32 @COLOR_PAIR(i32 0)
%2 = call i32 @bkgdset(i32 %1)
%3 = call i32 (...) @clear()
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @ncurses_shutdown() {
%1 = tail call i32 @COLOR_PAIR(i32 0)
%2 = tail call i32 @bkgdset(i32 %1)
%3 = tail call i32 (...) @clear()
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 (...) @endwin()
ret void
}
unsigned char inportb(unsigned short port) {
  unsigned char ret;
  asm volatile("inb %1, %0" : "=a"(ret) : "dN"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
signed int rt_thread_numprocessors(void) {
  signed int a = 1;
  signed long int return_value_sysconf$1;
  return_value_sysconf$1 = sysconf(84);
  a = (signed int)return_value_sysconf$1;
  return a;
}


x86 assembly (clang, -O0):
<rt_thread_numprocessors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x54,%edi
mov    $0x0,%al
call   1030 <sysconf@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_thread_numprocessors>:
mov    $0x54,%edi
xor    %eax,%eax
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
define i32 @rt_thread_numprocessors() {
%1 = alloca i32
%2 = alloca i64
store i32 1, i32* %1
%3 = call i32 (i32, ...) bitcast (i32 (...)* @sysconf to i32 (i32, ...)*)(i32 84)
%4 = sext i32 %3 to i64
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @rt_thread_numprocessors() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @sysconf to i32 (i32, ...)*)(i32 84)
ret i32 %1
}
RX0AR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movswl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     114a <RX0AR1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <RX0AR1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AR1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %5, i64 277777
%11 = load i16, i16* %10
%12 = icmp sle i16 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ pre_stats();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ user_dialog(int *);
int main(void) {
  int stop = 0;
  system("cls");
  while (stop == 0) {
    pre_stats();
    user_dialog(&stop);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <system@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1171 <main+0x41>
mov    $0x0,%al
call   1050 <pre_stats@plt>
lea    -0x8(%rbp),%rdi
call   1040 <user_dialog@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <pre_stats@plt>
mov    %rbx,%rdi
call   1040 <user_dialog@plt>
cmpl   $0x0,0xc(%rsp)
je     1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = call i32 (...) @pre_stats()
%9 = call i32 @user_dialog(i32* %2)
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @pre_stats()
%6 = call i32 @user_dialog(i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4
ret i32 0
}
/* Variables and functions */
int value();
int range(int min, int max) {
  int val = value();
  return val < min || max < val ? min : val;
}


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <value@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1140 <range+0x30>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114b <range+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <range+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <value@plt>
cmp    %ebx,%eax
mov    %eax,%ecx
cmovg  %ebp,%ecx
cmp    %ebp,%eax
cmovl  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @value()
%4 = icmp slt i32 %3, %0
%5 = icmp sgt i32 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %3
ret i32 %7
}
void erase(char *buff, int size) {
  int i;
  for (i = 0; i < size; i++) {
    buff[i] = 0;
  }
}


x86 assembly (clang, -O0):
<erase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <erase+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <erase+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase>:
test   %esi,%esi
jle    1122 <erase+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @erase(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void test4_GlobalInterrupts_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test4_GlobalInterrupts_targetInit__I() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
bool prs_argend(char c) { return isspace(c) || c == 0 || c == ','; }


x86 assembly (clang, -O0):
<prs_argend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <prs_argend+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     1158 <prs_argend+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prs_argend>:
push   %rbx
mov    %edi,%ebx
call   1030 <isspace@plt>
test   %rax,%rax
setne  %al
test   %bl,%bl
sete   %cl
cmp    $0x2c,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @prs_argend(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isspace(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 44
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @prs_argend(i8 signext %0) {
%2 = tail call i64 @isspace(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 0
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 44
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
float ss2qfra();
float ss2qfra_() { return ss2qfra(); }


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

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

LLVM IR (-O0):
define float @ss2qfra_() {
%1 = call float (...) @ss2qfra()
ret float %1
}

LLVM IR (-O2):
define float @ss2qfra_() {
%1 = tail call float (...) @ss2qfra()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ read_ranges();
int main() {
  read_ranges();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <read_ranges@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read_ranges()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int _chown_error(char *message, int ret) {
  fputs("chown"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_chown_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chown_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"chown: \00"
@stderr = global i32 0
define i32 @_chown_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"chown: \00"
@stderr = global i32 0
define i32 @_chown_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
void Test5(double X) {
  abc(&X);
  {
    int X;
    abc(&X);
    {
      float X;
      abc(&X);
    }
  }
}


x86 assembly (clang, -O0):
<Test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <abc@plt>
lea    -0xc(%rbp),%rdi
mov    $0x0,%al
call   1030 <abc@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <abc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test5>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <abc@plt>
lea    0x14(%rsp),%rdi
xor    %eax,%eax
call   1030 <abc@plt>
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1030 <abc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @Test5(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca float
store double %0, double* %2
%5 = call i32 (double*, ...) bitcast (i32 (...)* @abc to i32 (double*, ...)*)(double* %2)
%6 = call i32 (i32*, ...) bitcast (i32 (...)* @abc to i32 (i32*, ...)*)(i32* %3)
%7 = call i32 (float*, ...) bitcast (i32 (...)* @abc to i32 (float*, ...)*)(float* %4)
ret void
}

LLVM IR (-O2):
define void @Test5(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca float
store double %0, double* %2
%5 = call i32 (double*, ...) bitcast (i32 (...)* @abc to i32 (double*, ...)*)(double* %2)
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @abc to i32 (i32*, ...)*)(i32* %3)
%8 = bitcast float* %4 to i8*
%9 = call i32 (float*, ...) bitcast (i32 (...)* @abc to i32 (float*, ...)*)(float* %4)
ret void
}
int get(int *ptr) { return *ptr; }


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

x86 assembly (clang, -O2):
<get>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int func3(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @func3() {
ret i32 3
}

LLVM IR (-O2):
define i32 @func3() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, const char *argv[]) {
  long long k, p = 0;
  for (k = 0; k < 10000000000LL; k++)
    p++;
  if (p != k)
    abort();
  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)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
movabs $0x2540be400,%rax
cmp    %rax,-0x18(%rbp)
jge    1167 <main+0x57>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <main+0x26>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     117c <main+0x6c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
unsigned long strlen(char const *);
char *f(const char *c, unsigned long *l) {
  *l = strlen(c);
  return strdup(c);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,(%r14)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strdup@plt>

LLVM IR (-O0):
define i8* @f(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = load i64*, i64** %4
store i64 %6, i64* %7
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @f(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
store i64 %3, i64* %1
%4 = tail call i8* @strdup(i8* %0)
ret i8* %4
}
char *wind_strcpy(char *dest, const char *src) {
  char *tmp = dest;
  while ((*dest++ = *src++) != '\0')
    ;
  return tmp;
}


x86 assembly (clang, -O0):
<wind_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <wind_strcpy+0x47>
jmp    1114 <wind_strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wind_strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <wind_strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @wind_strcpy(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 = %15, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @wind_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error_not_a_license(const char *string) {
  fprintf(stderr,
          "%s is not included in the present version.\n"
          "Please write to <laprade.p@gmail.com> if you wish to include it.\n",
          string);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [109 x i8] c"%s is not included in the present version.\0APlease write to <laprade.p@gmail.com> if you wish to include it.\0A\00"
define void @error_not_a_license(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [109 x i8] c"%s is not included in the present version.\0APlease write to <laprade.p@gmail.com> if you wish to include it.\0A\00"
define void @error_not_a_license(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void wasm_fault(void) {
  char *oob = (char *)-1;
  *oob = 'x';
}


x86 assembly (clang, -O0):
<wasm_fault>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x78,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wasm_fault>:
movb   $0x78,0xffffffffffffffff
78
ret

LLVM IR (-O0):
define void @wasm_fault() {
%1 = alloca i8*
store i8* inttoptr (i64 -1 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 120, i8* %2
ret void
}

LLVM IR (-O2):
define void @wasm_fault() {
store i8 120, i8* inttoptr (i64 -1 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PlayOneGame() { printf(". . . play the game . . .\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c". . . play the game . . .\0A\00"
define void @PlayOneGame() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c". . . play the game . . .\00"
define void @PlayOneGame() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
void hardware_rand64_init(void) {}


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

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

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

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


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strnltrim(char *, int /*<<< orphan*/);
char *strltrim(char *str) {
  strnltrim(str, strlen(str));
  return (str);
}


x86 assembly (clang, -O0):
<strltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <strnltrim@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strltrim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strnltrim@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strltrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @strnltrim(i8* %3, i32 %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @strltrim(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strnltrim(i8* %0, i32 %2)
ret i8* %0
}
long long _itoll(unsigned int src2, unsigned int src1) {
  return (((long long)src2) << 32) | src1;
}


x86 assembly (clang, -O0):
<_itoll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x20,%rax
mov    -0x8(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_itoll>:
shl    $0x20,%rdi
mov    %esi,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @_itoll(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = shl i64 %6, 32
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = or i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @_itoll(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = shl nuw i64 %3, 32
%5 = zext i32 %1 to i64
%6 = or i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(volatile int *array, int arrayLength) {
  int i;
  for (i = 0; i < arrayLength; i++) {
    printf("%d", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printArray(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load volatile i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}