xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printhex1(char hexch) {
  if (hexch > 9) {
    printf("%c", hexch + 'A' - 10);
  } else {
    printf("%c", hexch + '0');
  }
}


x86 assembly (clang, -O0):
<printhex1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jle    1149 <printhex1+0x39>
movsbl -0x1(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
lea    0xec4(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    115f <printhex1+0x4f>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
lea    0xea9(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhex1>:
cmp    $0xa,%dil
mov    $0x37,%eax
mov    $0x30,%ecx
cmovge %eax,%ecx
add    %dil,%cl
movsbl %cl,%esi
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printhex1(i8 signext %0) {
%2 = icmp sgt i8 %0, 9
%3 = select i1 %2, i8 55, i8 48
%4 = add i8 %3, %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret void
}
int imx_sema4_mutex_trylock(struct imx_sema4_mutex *mutex_ptr) { return 0; }


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

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

LLVM IR (-O0):
%struct.imx_sema4_mutex = type opaque
define i32 @imx_sema4_mutex_trylock(%struct.imx_sema4_mutex* %0) {
%2 = alloca %struct.imx_sema4_mutex*
store %struct.imx_sema4_mutex* %0, %struct.imx_sema4_mutex** %2
ret i32 0
}

LLVM IR (-O2):
%struct.imx_sema4_mutex = type opaque
define i32 @imx_sema4_mutex_trylock(%struct.imx_sema4_mutex* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__7__GeneralIO__clr();
void LedsP__Led0__clr(void) { Msp430GpioC__7__GeneralIO__clr(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__clr() {
%1 = tail call i32 (...) @Msp430GpioC__7__GeneralIO__clr()
ret void
}
/* Variables and functions */
int LYRA2(void *, size_t, void const *, size_t, void const *, size_t,
          unsigned int, unsigned int, int);
int PHS(void *out, size_t outlen, const void *in, size_t inlen,
        const void *salt, size_t saltlen, unsigned int t_cost,
        unsigned int m_cost) {
  return LYRA2(out, outlen, in, inlen, salt, saltlen, t_cost, m_cost, 256);
}


x86 assembly (clang, -O0):
<PHS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x100,0x10(%rsp)
call   1030 <LYRA2@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PHS>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%eax
sub    $0x8,%rsp
push   $0x100
push   %rax
push   %r10
call   1030 <LYRA2@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PHS(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32
%16 = alloca i32
store i8* %0, i8** %9
store i64 %1, i64* %10
store i8* %2, i8** %11
store i64 %3, i64* %12
store i8* %4, i8** %13
store i64 %5, i64* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i8*, i8** %9
%18 = load i64, i64* %10
%19 = load i8*, i8** %11
%20 = load i64, i64* %12
%21 = load i8*, i8** %13
%22 = load i64, i64* %14
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32 @LYRA2(i8* %17, i64 %18, i8* %19, i64 %20, i8* %21, i64 %22, i32 %23, i32 %24, i32 256)
ret i32 %25
}

LLVM IR (-O2):
define i32 @PHS(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7) {
%9 = tail call i32 @LYRA2(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7, i32 256)
ret i32 %9
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
void e_1_19() {
  int len = 0;
  char line[1000];
  while ((len = getline(line, 1000)) > 0) {
    reverse(line);
    printf("Reversed: %s", line);
  }
}


x86 assembly (clang, -O0):
<e_1_19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1183 <e_1_19+0x53>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <e_1_19+0x12>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_1_19>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    1184 <e_1_19+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1160 <e_1_19+0x30>
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Reversed: %s\00"
define void @e_1_19() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @getline(i8* %4, i32 1000)
store i32 %5, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 @reverse(i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Reversed: %s\00"
define void @e_1_19() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @getline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
void gpio_spi_active(int cspi_mod) {}


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

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

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

LLVM IR (-O2):
define void @gpio_spi_active(i32 %0) {
ret void
}
/* Variables and functions */
double average(int, int, int, ...);
int /*<<< orphan*/ printf(char *, double);
void main(int argc, char **argv) {
  printf("the average of 3 and 8 is %f\n", average(2, 3, 8));
  printf("the average of 3 and 8 and 11 is %f\n", average(3, 3, 8, 11));
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <average@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%esi
mov    $0x8,%edx
mov    $0xb,%ecx
mov    %esi,%edi
mov    $0x0,%al
call   1040 <average@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <average@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x8,%edx
mov    $0xb,%ecx
xor    %eax,%eax
call   1040 <average@plt>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"the average of 3 and 8 is %f\0A\00"
@.str.1 = [37 x i8] c"the average of 3 and 8 and 11 is %f\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call double (i32, i32, i32, ...) @average(i32 2, i32 3, i32 8)
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %5)
%7 = call double (i32, i32, i32, ...) @average(i32 3, i32 3, i32 8, i32 11)
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), double %7)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"the average of 3 and 8 is %f\0A\00"
@.str.1 = [37 x i8] c"the average of 3 and 8 and 11 is %f\0A\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double (i32, i32, i32, ...) @average(i32 2, i32 3, i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double (i32, i32, i32, ...) @average(i32 3, i32 3, i32 8, i32 11)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), double %5)
ret void
}
int openFittizia() { return 0; }


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

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

LLVM IR (-O0):
define i32 @openFittizia() {
ret i32 0
}

LLVM IR (-O2):
define i32 @openFittizia() {
ret i32 0
}
void fdmi_dtype_op_MAX_float(void *a, void *b) {
  (*(float *)a = (((*(float *)a) > (*(float *)b)) ? *(float *)a : *(float *)b));
}


x86 assembly (clang, -O0):
<fdmi_dtype_op_MAX_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    1133 <fdmi_dtype_op_MAX_float+0x33>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1140 <fdmi_dtype_op_MAX_float+0x40>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdmi_dtype_op_MAX_float>:
movss  (%rdi),%xmm0
maxss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @fdmi_dtype_op_MAX_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp ogt float %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to float*
%15 = load float, float* %14
br label %20
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to float*
%19 = load float, float* %18
br label %20
20: ; preds = %16, %12
%21 = phi float [ %15, %12 ], [ %19, %16 ]
%22 = load i8*, i8** %3
%23 = bitcast i8* %22 to float*
store float %21, float* %23
ret void
}

LLVM IR (-O2):
define void @fdmi_dtype_op_MAX_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = select i1 %7, float %4, float %6
store float %8, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getpid(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getpid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getpid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
int test_imm_18uint32_reg(unsigned int val) {
  return ((val) & (0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x18,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_18uint32_reg>:
test   $0x18,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_18uint32_reg(i32 %0) {
%2 = and i32 %0, 24
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gdk_window_get_origin() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_origin() {
ret void
}
void *duplicate(char *string) {
  char *p;
  p = malloc(strlen(string));
  strcpy(p, string);
  return p;
}


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

x86 assembly (clang, -O2):
<duplicate>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @duplicate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @duplicate(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i8* @malloc(i64 %2)
%4 = tail call i8* @strcpy(i8* dereferenceable(1) %3, i8* dereferenceable(1) %0)
ret i8* %3
}
void foo807(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo807(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int iscntrl(int /*<<< orphan*/);
int iswcntrl(wint_t c) { return iscntrl(c); }


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

x86 assembly (clang, -O2):
<iswcntrl>:
jmp    1030 <iscntrl@plt>

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

LLVM IR (-O2):
define i32 @iswcntrl(i32 %0) {
%2 = tail call i32 @iscntrl(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t minipack_unpack_bin8(void *ptr, size_t *sz) {
  *sz = 2;
  return ((uint8_t *)ptr)[1];
}


x86 assembly (clang, -O0):
<minipack_unpack_bin8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_bin8>:
movq   $0x2,(%rsi)
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @minipack_unpack_bin8(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 2, i64* %5
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @minipack_unpack_bin8(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 2, i64* %1
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int read(int, int *, int);
int read_int(int fd) {
  int n = 0;
  int next = read(fd, &n, sizeof(int));
  if (next <= 0)
    return -1;
  return n;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     114c <read_int+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <read_int+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jle    1137 <read_int+0x27>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_int(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @read(i32 %0, i32* %2, i32 4)
%5 = icmp slt i32 %4, 1
%6 = load i32, i32* %2
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
/* Variables and functions */
double exp(double);
double kneeslope(double x, double k, double linearthreshold) {
  return k * x /
         ((k * linearthreshold + 1.0) * exp(k * (x - linearthreshold)) - 1.0);
}


x86 assembly (clang, -O0):
<kneeslope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe7a(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kneeslope>:
sub    $0x18,%rsp
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
movsd  %xmm3,0x10(%rsp)
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm1
addsd  0xeca(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0xeb9(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @kneeslope(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double 1.000000e+00)
%13 = load double, double* %5
%14 = load double, double* %4
%15 = load double, double* %6
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = call double @exp(double %17)
%19 = call double @llvm.fmuladd.f64(double %12, double %18, double -1.000000e+00)
%20 = fdiv double %9, %19
ret double %20
}

LLVM IR (-O2):
define double @kneeslope(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = tail call double @llvm.fmuladd.f64(double %1, double %2, double 1.000000e+00)
%6 = fsub double %0, %2
%7 = fmul double %6, %1
%8 = tail call double @exp(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %5, double %8, double -1.000000e+00)
%10 = fdiv double %4, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ __set_errno(int);
long __syscall_error(void) {
  register int err_no __asm__("%r8");
  __set_errno(err_no);
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_error>:
push   %rax
call   1030 <__set_errno@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @__syscall_error() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @__set_errno(i32 %2)
ret i64 -1
}

LLVM IR (-O2):
define i64 @__syscall_error() {
%1 = tail call i32 @__set_errno(i32 undef)
ret i64 -1
}
/* Variables and functions */
scalar_t__ ceil(int);
int log(int);
int ceilmylogk(int n, int k) { return (int)(ceil(log(n) / (log(k)))); }


x86 assembly (clang, -O0):
<ceilmylogk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <log@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilmylogk>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <log@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @ceilmylogk(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 = call i32 @log(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @log(i32 %7)
%9 = sdiv i32 %6, %8
%10 = call i64 @ceil(i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @ceilmylogk(i32 %0, i32 %1) {
%3 = tail call i32 @log(i32 %0)
%4 = tail call i32 @log(i32 %1)
%5 = sdiv i32 %3, %4
%6 = tail call i64 @ceil(i32 %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ scache_close();
void fat_closeDriver() { scache_close(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
pid_t getsid(pid_t pid) {
  __set_errno(ENOSYS);
  return (pid_t)-1;
}


x86 assembly (clang, -O0):
<getsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @getsid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @getsid(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
void get_proc_info(char *info) {
  __asm__ __volatile__("int $0x40" : : "a"(9), "b"(info), "c"(-1));
}


x86 assembly (clang, -O0):
<get_proc_info>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x9,%eax
mov    $0xffffffff,%ecx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_proc_info>:
push   %rbx
mov    %rdi,%rbx
mov    $0x9,%eax
mov    $0xffffffff,%ecx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @get_proc_info(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 9, i8* %0, i32 -1)
ret void
}
long getTimeout() { return 1800; }


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

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

LLVM IR (-O0):
define i64 @getTimeout() {
ret i64 1800
}

LLVM IR (-O2):
define i64 @getTimeout() {
ret i64 1800
}
int do_557() { return 557; }


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

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

LLVM IR (-O0):
define i32 @do_557() {
ret i32 557
}

LLVM IR (-O2):
define i32 @do_557() {
ret i32 557
}
/* Variables and functions */
int /*<<< orphan*/ cpu();
int /*<<< orphan*/ io();
int main(int argc, char *argv[]) {
  io();
  cpu();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @io()
%6 = call i32 (...) @cpu()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @io()
%4 = tail call i32 (...) @cpu()
ret i32 0
}
int pgmDrawCircle(int **pixels, int numRows, int numCols, int centerRow,
                  int centerCol, int radius, char **header) {}


x86 assembly (clang, -O0):
<pgmDrawCircle>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pgmDrawCircle(i32** %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8** %6) {
%8 = alloca i32
%9 = alloca i32**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8**
store i32** %0, i32*** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8** %6, i8*** %15
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
define i32 @pgmDrawCircle(i32** nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8** nocapture readnone %6) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sZ() {
  dash();
  dash();
  dot();
  dot();
  cBreak();
}


x86 assembly (clang, -O0):
<sZ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sZ>:
push   %rax
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sZ() {
%1 = call i32 (...) @dash()
%2 = call i32 (...) @dash()
%3 = call i32 (...) @dot()
%4 = call i32 (...) @dot()
%5 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sZ() {
%1 = tail call i32 (...) @dash()
%2 = tail call i32 (...) @dash()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @dot()
%5 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
void fill(unsigned char *addr, size_t amount) {
  unsigned long i;
  for (i = 0; i < amount / 2; i++) {
    *(addr + i) = 42;
  }
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
cmp    %rcx,%rax
jae    1146 <fill+0x46>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <fill+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
cmp    $0x2,%rsi
jb     112b <fill+0x1b>
push   %rax
mov    %rsi,%rdx
shr    %rdx
mov    $0x2a,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @fill(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp ult i64 %1, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = lshr i64 %1, 1
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
struct netif {
  int dummy;
};
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *);
int8_t(cli_info)(char *response, size_t respLen, int argc, char *argv[],
                 void *opts) {
  char ipbuf[16];
  extern struct netif xnetif;
  snprintf(response, respLen,
           "Firmware built at "
           "05:58:23"
           " "
           "Mar 19 2022");
  return 0;
}


x86 assembly (clang, -O0):
<cli_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"Firmware built at 05:58:23 Mar 19 2022\00"
define i32 @cli_info(i8* %0, i64 %1, i32 %2, i8** %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
%11 = alloca [16 x i8]
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i8** %3, i8*** %9
store i8* %4, i8** %10
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = call i32 @snprintf(i8* %12, i64 %13, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Firmware built at 05:58:23 Mar 19 2022\00"
define i32 @cli_info(i8* nocapture writeonly %0, i64 %1, i32 %2, i8** nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ baz();
double bar(void) { baz(); }


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

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

LLVM IR (-O0):
define double @bar() {
%1 = alloca double
%2 = call i32 (...) @baz()
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @bar() {
%1 = tail call i32 (...) @baz()
ret double undef
}
int helper(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<helper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @helper(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int hl_date_from_time(double time) { return (int)(time / 1000.); }


x86 assembly (clang, -O0):
<hl_date_from_time>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hl_date_from_time>:
divsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @hl_date_from_time(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+03
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @hl_date_from_time(double %0) {
%2 = fdiv double %0, 1.000000e+03
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_tabs(int cpos) {
  printf("\n");
  for (int i = 0; i < cpos; i++)
    printf("    ");
}


x86 assembly (clang, -O0):
<print_tabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <print_tabs+0x44>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <print_tabs+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tabs>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    114d <print_tabs+0x2d>
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <print_tabs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c" \00"
define void @print_tabs(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ readidel(int /*<<< orphan*/);
uint32_t ide_read_pri_l(uint16_t addr, void *priv) { return readidel(0); }


x86 assembly (clang, -O0):
<ide_read_pri_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <readidel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_read_pri_l>:
xor    %edi,%edi
jmp    1030 <readidel@plt>

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

LLVM IR (-O2):
define i32 @ide_read_pri_l(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @readidel(i32 0)
ret i32 %3
}
void enable_ext_interrupt(void) {
  (*(volatile unsigned long *)((0xE002C004))) = 0x1;
  (*(volatile unsigned long *)(((0xFFFFF000) + 0x010))) = 0x4000;
}


x86 assembly (clang, -O0):
<enable_ext_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe002c004,%eax
movq   $0x1,(%rax)
mov    $0xfffff010,%eax
movq   $0x4000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_ext_interrupt>:
mov    $0xe002c004,%eax
movq   $0x1,(%rax)
movq   $0x4000,0x1ffd300c(%rax)
ret

LLVM IR (-O0):
define void @enable_ext_interrupt() {
store volatile i64 1, i64* inttoptr (i64 3758276612 to i64*)
store volatile i64 16384, i64* inttoptr (i64 4294963216 to i64*)
ret void
}

LLVM IR (-O2):
define void @enable_ext_interrupt() {
store volatile i64 1, i64* inttoptr (i64 3758276612 to i64*)
store volatile i64 16384, i64* inttoptr (i64 4294963216 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ pthread_cancel(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int action_thread2(pthread_t lautre) {
  const char *message = "lire";
  while (1) {
    printf("Action du thread2: %s\n", message);
    sleep(2);
    printf("je te montre la sortie\n");
    pthread_cancel(lautre);
  }
}


x86 assembly (clang, -O0):
<action_thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <pthread_cancel@plt>
jmp    1146 <action_thread2+0x16>

x86 assembly (clang, -O2):
<action_thread2>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xeb4(%rip),%r14
lea    0xea8(%rip),%r15
lea    0xebd(%rip),%r12
nop
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <pthread_cancel@plt>
jmp    1160 <action_thread2+0x20>

LLVM IR (-O0):
@.str = [5 x i8] c"lire\00"
@.str.1 = [23 x i8] c"Action du thread2: %s\0A\00"
@.str.2 = [24 x i8] c"je te montre la sortie\0A\00"
define i32 @action_thread2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %1, %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @sleep(i32 2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 @pthread_cancel(i32 %9)
br label %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"lire\00"
@.str.1 = [23 x i8] c"Action du thread2: %s\0A\00"
@str = [23 x i8] c"je te montre la sortie\00"
define i32 @action_thread2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @pthread_cancel(i32 %0)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ displayRandomSeed(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void showRandomSeed() {
  fprintf(stdout, "\t");
  displayRandomSeed(stdout);
  fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<showRandomSeed>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <displayRandomSeed@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showRandomSeed>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1030 <displayRandomSeed@plt>
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @showRandomSeed() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @displayRandomSeed(i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @showRandomSeed() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @displayRandomSeed(i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct wlist_t {
  int dummy;
};

/* Variables and functions */
struct wlist_t *_wlist_destroy_dupes(struct wlist_t **wlist) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.wlist_t = type { i32 }
define %struct.wlist_t* @_wlist_destroy_dupes(%struct.wlist_t** %0) {
%2 = alloca %struct.wlist_t**
store %struct.wlist_t** %0, %struct.wlist_t*** %2
ret %struct.wlist_t* null
}

LLVM IR (-O2):
%struct.wlist_t = type { i32 }
define noalias %struct.wlist_t* @_wlist_destroy_dupes(%struct.wlist_t** nocapture readnone %0) {
ret %struct.wlist_t* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("LIBC Unit Test\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"LIBC Unit Test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBDMAChannelIntEnable(uint32_t ui32Base, uint32_t ui32Channel) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000204 + (0x10 * ui32Channel)))) |=
      0x00000008;
}


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

x86 assembly (clang, -O2):
<USBDMAChannelIntEnable>:
movslq %edi,%rax
movslq %esi,%rcx
shl    $0x4,%rcx
orl    $0x8,0x204(%rax,%rcx,1)
08
ret

LLVM IR (-O0):
define void @USBDMAChannelIntEnable(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 = add nsw i32 %5, 516
%7 = load i32, i32* %4
%8 = mul nsw i32 16, %7
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, 8
store volatile i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @USBDMAChannelIntEnable(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 516
%4 = shl nsw i32 %1, 4
%5 = add nsw i32 %3, %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 8
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
char *MCatStr(char *, char const *, int /*<<< orphan*/ *);
char *CatStr(char *Dest, const char *Src) { return (MCatStr(Dest, Src, NULL)); }


x86 assembly (clang, -O0):
<CatStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <MCatStr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CatStr>:
xor    %edx,%edx
jmp    1030 <MCatStr@plt>

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

LLVM IR (-O2):
define i8* @CatStr(i8* %0, i8* %1) {
%3 = tail call i8* @MCatStr(i8* %0, i8* %1, i32* null)
ret i8* %3
}
void glGetProgramInfoLog(void) { return; }


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

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

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

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