xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
long double testfunc_Ddd(double a, double b) {
  long double result = (long double)(a * b);
  printf("testfunc_Ddd(%p, %p)\n", &a, &b);
  printf("testfunc_Ddd(%g, %g)\n", a, b);
  return result;
}


x86 assembly (clang, -O0):
<testfunc_Ddd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
fldl   -0x28(%rbp)
fstpt  -0x20(%rbp)
lea    0xebe(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
fldt   -0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_Ddd>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
fldl   0x10(%rsp)
fstpt  0x1c(%rsp)
lea    0xec8(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
lea    0xebd(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
fldt   0x1c(%rsp)
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"testfunc_Ddd(%p, %p)\0A\00"
@.str.1 = [22 x i8] c"testfunc_Ddd(%g, %g)\0A\00"
define x86_fp80 @testfunc_Ddd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
%9 = fpext double %8 to x86_fp80
store x86_fp80 %9, x86_fp80* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double* %3, double* %4)
%11 = load double, double* %3
%12 = load double, double* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %11, double %12)
%14 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %14
}

LLVM IR (-O2):
@.str = [22 x i8] c"testfunc_Ddd(%p, %p)\0A\00"
@.str.1 = [22 x i8] c"testfunc_Ddd(%g, %g)\0A\00"
define x86_fp80 @testfunc_Ddd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = fmul double %0, %1
%6 = fpext double %5 to x86_fp80
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double* %3, double* %4)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %8, double %9)
ret x86_fp80 %6
}
void EC_POINT_bn2point(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_bn2point() {
ret void
}
/* Variables and functions */
char *convert(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", convert("ABC", 3));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"ABC\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i8* @convert(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

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

/* Variables and functions */
int io_in(struct io_file *, int, char *, int);
int io_in_i1(struct io_file *f, int pos, signed char *i) {
  return io_in(f, pos, i, sizeof *i);
}


x86 assembly (clang, -O0):
<io_in_i1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <io_in@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_in_i1>:
mov    $0x1,%ecx
jmp    1030 <io_in@plt>

LLVM IR (-O0):
%struct.io_file = type { i32 }
define i32 @io_in_i1(%struct.io_file* %0, i32 %1, i8* %2) {
%4 = alloca %struct.io_file*
%5 = alloca i32
%6 = alloca i8*
store %struct.io_file* %0, %struct.io_file** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.io_file*, %struct.io_file** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @io_in(%struct.io_file* %7, i32 %8, i8* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.io_file = type { i32 }
define i32 @io_in_i1(%struct.io_file* %0, i32 %1, i8* %2) {
%4 = tail call i32 @io_in(%struct.io_file* %0, i32 %1, i8* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void init_2(void) { write(STDOUT_FILENO, "DSO init array 2\n", 17); }


x86 assembly (clang, -O0):
<init_2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x11,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_2>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x11,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [18 x i8] c"DSO init array 2\0A\00"
define void @init_2() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [18 x i8] c"DSO init array 2\0A\00"
define void @init_2() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
ret void
}
/* Variables and functions */
short printNumber_L(long, int);
scalar_t__ println();
short printNumber_L_ln(long num, int base) {
  short n = 0;
  n = printNumber_L(num, base);
  n += println();
  return n;
}


x86 assembly (clang, -O0):
<printNumber_L_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movw   $0x0,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <printNumber_L@plt>
mov    %ax,-0xe(%rbp)
mov    $0x0,%al
call   1030 <println@plt>
mov    %rax,%rcx
movswq -0xe(%rbp),%rax
add    %rcx,%rax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNumber_L_ln>:
push   %rbx
call   1040 <printNumber_L@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <println@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @printNumber_L_ln(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i16
store i64 %0, i64* %3
store i32 %1, i32* %4
store i16 0, i16* %5
%6 = load i64, i64* %3
%7 = load i32, i32* %4
%8 = call signext i16 @printNumber_L(i64 %6, i32 %7)
store i16 %8, i16* %5
%9 = call i64 (...) @println()
%10 = load i16, i16* %5
%11 = sext i16 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i16
store i16 %13, i16* %5
%14 = load i16, i16* %5
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @printNumber_L_ln(i64 %0, i32 %1) {
%3 = tail call signext i16 @printNumber_L(i64 %0, i32 %1)
%4 = tail call i64 (...) @println()
%5 = trunc i64 %4 to i16
%6 = add i16 %3, %5
ret i16 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_be32(int /*<<< orphan*/ const *);
uint32_t get_unaligned_be32(const void *p) {
  return __get_unaligned_be32((const uint8_t *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_be32>:
jmp    1030 <__get_unaligned_be32@plt>

LLVM IR (-O0):
define i32 @get_unaligned_be32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__get_unaligned_be32(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_unaligned_be32(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_be32(i32* %2)
ret i32 %3
}
int test2(int a) { typeof(a) temp = 7; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test2(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void incArgIdx(int *argIdx, int argc) {
  if (++*argIdx >= argc) {
    puts("Error: Bad/missing arguments");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<incArgIdx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
cmp    -0xc(%rbp),%eax
jl     115d <incArgIdx+0x3d>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incArgIdx>:
push   %rax
mov    (%rdi),%eax
add    $0x1,%eax
mov    %eax,(%rdi)
cmp    %esi,%eax
jge    112e <incArgIdx+0xe>
pop    %rax
ret
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error: Bad/missing arguments\00"
@EXIT_FAILURE = global i32 0
define void @incArgIdx(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* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Error: Bad/missing arguments\00"
@EXIT_FAILURE = global i32 0
define void @incArgIdx(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 1
store i32 %4, i32* %0
%5 = icmp slt i32 %4, %1
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
size_t hp_left(size_t i) { return 2 * i + 1; }


x86 assembly (clang, -O0):
<hp_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hp_left>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @hp_left(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 2, %3
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @hp_left(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ RB_POWER_OFF;
int reboot(int /*<<< orphan*/);
int sys_poweroff(void) { return reboot(RB_POWER_OFF); }


x86 assembly (clang, -O0):
<sys_poweroff>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_poweroff>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <reboot@plt>

LLVM IR (-O0):
@RB_POWER_OFF = global i32 0
define i32 @sys_poweroff() {
%1 = load i32, i32* @RB_POWER_OFF
%2 = call i32 @reboot(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@RB_POWER_OFF = global i32 0
define i32 @sys_poweroff() {
%1 = load i32, i32* @RB_POWER_OFF
%2 = tail call i32 @reboot(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ guiclose_();
void GUICLOSE(void) { guiclose_(); }


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

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

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

LLVM IR (-O2):
define void @GUICLOSE() {
%1 = tail call i32 (...) @guiclose_()
ret void
}
void setZeroZero(int arr[]) { arr[0] = 0; }


x86 assembly (clang, -O0):
<setZeroZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setZeroZero>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @setZeroZero(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
void glUniformMatrix2x3fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniformMatrix2x3fv() {
ret void
}
/* Variables and functions */
unsigned int sleep(unsigned int);
unsigned int libc_sleep(unsigned int s) { return sleep(s); }


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

x86 assembly (clang, -O2):
<libc_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define i32 @libc_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned int, unsigned int);
void fputs(unsigned string[], unsigned handle) {
  unsigned i = 0;
  while (string[i]) {
    fputc(string[i], handle);
    i++;
  }
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
cmpl   $0x0,(%rax,%rcx,4)
je     1157 <fputs+0x47>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0xc(%rbp),%esi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fputs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1144 <fputs+0x34>
mov    %esi,%r14d
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%esi
call   1030 <fputc@plt>
mov    %ebp,%eax
mov    (%rbx,%rax,4),%edi
add    $0x1,%ebp
test   %edi,%edi
jne    1130 <fputs+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fputs(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 = %13, %2
%7 = load i32*, i32** %3
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %6
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %4
%20 = call i32 @fputc(i32 %18, i32 %19)
%21 = load i32, i32* %5
%22 = add i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fputs(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = tail call i32 @fputc(i32 %6, i32 %1)
%9 = add i32 %7, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
/* Type definitions */
struct pkt_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __xfree(struct pkt_buff *);
void pkt_free(struct pkt_buff *pkt) {
  do {
    __xfree(pkt);
    (pkt) = NULL;
  } while (0);
}


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

x86 assembly (clang, -O2):
<pkt_free>:
jmp    1030 <__xfree@plt>

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
define void @pkt_free(%struct.pkt_buff* %0) {
%2 = alloca %struct.pkt_buff*
store %struct.pkt_buff* %0, %struct.pkt_buff** %2
br label %3
3: ; preds = %1
%4 = load %struct.pkt_buff*, %struct.pkt_buff** %2
%5 = call i32 @__xfree(%struct.pkt_buff* %4)
store %struct.pkt_buff* null, %struct.pkt_buff** %2
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
define void @pkt_free(%struct.pkt_buff* %0) {
%2 = tail call i32 @__xfree(%struct.pkt_buff* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *, int);
int /*<<< orphan*/ send_to_client(int, char const *, int);
void send_start_to_client(int dst) {
  const char str[] = "\0\0\0\0\0";
  if (!send_to_client(dst, str, sizeof(str)))
    err(1, "sending start to %i", dst);
}


x86 assembly (clang, -O0):
<send_start_to_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x6,%edx
call   1040 <send_to_client@plt>
cmp    $0x0,%eax
jne    1179 <send_start_to_client+0x49>
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xe8c(%rip),%rsi
call   1050 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_start_to_client>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movw   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x6,%edx
call   1030 <send_to_client@plt>
test   %eax,%eax
jne    115c <send_start_to_client+0x3c>
lea    0xeb0(%rip),%rsi
mov    $0x1,%edi
mov    %ebx,%edx
call   1040 <err@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"sending start to %i\00"
define void @send_start_to_client(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = bitcast [6 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%7 = call i32 @send_to_client(i32 %5, i8* %6, i32 6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @err(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"sending start to %i\00"
define void @send_start_to_client(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = call i32 @send_to_client(i32 %0, i8* %3, i32 6)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @err(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %1
ret void
}
void ioinit_alsasoundcard(void) {}


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

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

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

LLVM IR (-O2):
define void @ioinit_alsasoundcard() {
ret void
}
int test_imm_F4uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xF4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F4uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xf4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_F4uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 244
%5 = icmp ne i64 %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_F4uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 244
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void d2v3(rra, rdec, r, pos) double rra;
double rdec;
double r;
double pos[3];
{
  s2v3(degrad(rra), degrad(rdec), r, pos);
  return;
}


x86 assembly (clang, -O0):
<d2v3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <degrad@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <degrad@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdx
mov    $0x1,%al
call   1040 <s2v3@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2v3>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
mov    $0x1,%al
call   1030 <degrad@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <degrad@plt>
mov    %ebp,%edi
mov    %eax,%esi
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdx
mov    $0x1,%al
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <s2v3@plt>

LLVM IR (-O0):
define void @d2v3(double %0, double %1, double %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = call i32 (double, ...) bitcast (i32 (...)* @degrad to i32 (double, ...)*)(double %9)
%11 = load double, double* %6
%12 = call i32 (double, ...) bitcast (i32 (...)* @degrad to i32 (double, ...)*)(double %11)
%13 = load double, double* %7
%14 = load double*, double** %8
%15 = call i32 (i32, i32, double, double*, ...) bitcast (i32 (...)* @s2v3 to i32 (i32, i32, double, double*, ...)*)(i32 %10, i32 %12, double %13, double* %14)
ret void
}

LLVM IR (-O2):
define void @d2v3(double %0, double %1, double %2, double* %3) {
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @degrad to i32 (double, ...)*)(double %0)
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @degrad to i32 (double, ...)*)(double %1)
%7 = tail call i32 (i32, i32, double, double*, ...) bitcast (i32 (...)* @s2v3 to i32 (i32, i32, double, double*, ...)*)(i32 %5, i32 %6, double %2, double* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void batadc_resetrelease() {
  mbus_remote_register_write(0x7, 0x3B,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) |
                              (0 << 12) | (1 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<batadc_resetrelease>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x3b,%esi
mov    $0xfefff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<batadc_resetrelease>:
push   %rax
mov    $0x7,%edi
mov    $0x3b,%esi
mov    $0xfefff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @batadc_resetrelease() {
%1 = call i32 @mbus_remote_register_write(i32 7, i32 59, i32 1044479)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @batadc_resetrelease() {
%1 = tail call i32 @mbus_remote_register_write(i32 7, i32 59, i32 1044479)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};

/* Variables and functions */
scalar_t__ inet_ntoa(TYPE_1__);
char *IPtoStr(unsigned long Address) {
  struct sockaddr_in sa;
  sa.sin_addr.s_addr = Address;
  return ((char *)inet_ntoa(sa.sin_addr));
}


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

x86 assembly (clang, -O2):
<IPtoStr>:
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
define i8* @IPtoStr(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.sockaddr_in
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i32 0, i32 0
store i64 %4, i64* %6
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = call i64 @inet_ntoa(i64 %9)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @IPtoStr(i64 %0) {
%2 = tail call i64 @inet_ntoa(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
const char *zlibZIPVersion() { return "1.2.1"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.1\00"
define i8* @zlibZIPVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 1; i < 256; i++) {
    printf("%d  -->  %c\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d --> %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void RTFileGetMaxSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileGetMaxSize() {
ret void
}
/* Variables and functions */
int multiply(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 13;
  int y = 66;
  int result = 0;
  result = multiply(x, y);
  printf("\n Our result is [%u]\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
movl   $0x42,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <multiply@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"\0A Our result is [%u]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %2
store i32 66, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @multiply(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0A Our result is [%u]\0A\00"
define i32 @main() {
%1 = tail call i32 @multiply(i32 13, i32 66)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  scalar_t__ sa_flags;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
int sig_permanent(int sig, void (*handler)(int)) {
  struct sigaction sa;
  memset(&sa, 0, sizeof sa);
  sa.sa_flags = 0;
  sa.sa_handler = handler;
  return sigaction(sig, &sa, NULL);
}


x86 assembly (clang, -O0):
<sig_permanent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_permanent>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movq   $0x0,0x8(%rsp)
mov    %rbx,(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)*, i64 }
define i32 @sig_permanent(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = call i32 @memset(%struct.sigaction* %5, i32 0, i32 16)
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
store i64 0, i64* %7
%8 = load void (i32)*, void (i32)** %4
%9 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %8, void (i32)** %9
%10 = load i32, i32* %3
%11 = call i32 @sigaction(i32 %10, %struct.sigaction* %5, i32* null)
ret i32 %11
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i64 }
define i32 @sig_permanent(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = call i32 @memset(%struct.sigaction* %3, i32 0, i32 16)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %7
%8 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32* null)
ret i32 %8
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *ret;
  ret = malloc(strlen(s) + 1);
  if (ret == NULL) {
    return NULL;
  }
  strcpy(ret, s);
  return ret;
}


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

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

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
void wait_more(long *wait) {
  if (*wait + 50000000L <= 999999999L)
    *wait += 50000000L;
}


x86 assembly (clang, -O0):
<wait_more>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x2faf080,%rax
cmp    $0x3b9ac9ff,%rax
jg     1132 <wait_more+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2faf080,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_more>:
mov    (%rdi),%rax
cmp    $0x389fd97f,%rax
jg     1114 <wait_more+0x14>
add    $0x2faf080,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @wait_more(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = add nsw i64 %4, 50000000
%6 = icmp sle i64 %5, 999999999
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
%10 = add nsw i64 %9, 50000000
store i64 %10, i64* %8
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @wait_more(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp slt i64 %2, 950000000
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i64 %2, 50000000
store i64 %5, i64* %0
br label %6
6: ; preds = %4, %1
ret void
}
void finalise() {}


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

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

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

LLVM IR (-O2):
define void @finalise() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *flash_get_WRPR() { return mem_get_reg32(0x40023C00 + 0x20); }


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

x86 assembly (clang, -O2):
<flash_get_WRPR>:
mov    $0x40023c20,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @flash_get_WRPR() {
%1 = call i32* @mem_get_reg32(i32 1073888288)
ret i32* %1
}

LLVM IR (-O2):
define i32* @flash_get_WRPR() {
%1 = tail call i32* @mem_get_reg32(i32 1073888288)
ret i32* %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XExtData;
struct TYPE_2__ {
  int /*<<< orphan*/ *ext_data;
};
typedef TYPE_1__ ScreenFormat;

/* Variables and functions */
void set_ScreenFormat_ext_data(void *_p, void *_v) {
  ((ScreenFormat *)_p)->ext_data = (XExtData *)_v;
}


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

x86 assembly (clang, -O2):
<set_ScreenFormat_ext_data>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_ScreenFormat_ext_data(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_ScreenFormat_ext_data(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long double, double volatile);
int main() {
  register long double ld = -2.83090232717332442064e-324L;
  volatile double d;
  d = ld;
  printf("ld = %.21LG, d = %.17g\n", ld, d);
  ld = d;
  printf("ld = %.21LG, d = %.17g\n", ld, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0xee2(%rip)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
fldt   -0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    %rsp,%rax
fstpt  (%rax)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
fldl   -0x18(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x8000000000000001,%rax
mov    %rax,0x18(%rsp)
movsd  0x18(%rsp),%xmm0
fldt   0xed0(%rip)
fstpt  (%rsp)
lea    0xed6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
fldl   0x18(%rsp)
movsd  0x18(%rsp),%xmm0
fstpt  (%rsp)
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"ld = %.21LG, d = %.17g\0A\00"
define i32 @main() {
%1 = alloca x86_fp80
%2 = alloca double
store x86_fp80 0xKBBCC92AEE22ACDF2D000, x86_fp80* %1
%3 = load x86_fp80, x86_fp80* %1
%4 = fptrunc x86_fp80 %3 to double
store volatile double %4, double* %2
%5 = load x86_fp80, x86_fp80* %1
%6 = load volatile double, double* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), x86_fp80 %5, double %6)
%8 = load volatile double, double* %2
%9 = fpext double %8 to x86_fp80
store x86_fp80 %9, x86_fp80* %1
%10 = load x86_fp80, x86_fp80* %1
%11 = load volatile double, double* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), x86_fp80 %10, double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"ld = %.21LG, d = %.17g\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double -4.940660e-324, double* %1
%3 = load volatile double, double* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), x86_fp80 0xKBBCC92AEE22ACDF2D000, double %3)
%5 = load volatile double, double* %1
%6 = fpext double %5 to x86_fp80
%7 = load volatile double, double* %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), x86_fp80 %6, double %7)
ret i32 0
}
void inttoa(int i, char *s, int n) {
  if (i / 10) {
    inttoa(i / 10, s, n - 1);
  }
  s[n] = (char)(((int)'0') + i % 10);
}


x86 assembly (clang, -O0):
<inttoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1152 <inttoa+0x42>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <inttoa@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inttoa>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%r15
lea    0x9(%rdi),%eax
movslq %edi,%rbx
cmp    $0x13,%eax
jb     1146 <inttoa+0x36>
imul   $0x66666667,%rbx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
lea    -0x1(%r14),%edx
mov    %r15,%rsi
call   1030 <inttoa@plt>
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
add    $0x30,%bl
movslq %r14d,%rax
mov    %bl,(%r15,%rax,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @inttoa(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 10
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 10
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
br label %16
16: ; preds = %10, %3
%17 = load i32, i32* %4
%18 = srem i32 %17, 10
%19 = add nsw i32 48, %18
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
ret void
}

LLVM IR (-O2):
define void @inttoa(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = add i32 %0, 9
%5 = icmp ult i32 %4, 19
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = sdiv i32 %0, 10
%8 = add nsw i32 %2, -1
tail call void @inttoa(i32 %7, i8* %1, i32 %8)
br label %9
9: ; preds = %6, %3
%10 = srem i32 %0, 10
%11 = trunc i32 %10 to i8
%12 = add nsw i8 %11, 48
%13 = sext i32 %2 to i64
%14 = getelementptr inbounds i8, i8* %1, i64 %13
store i8 %12, i8* %14
ret void
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ number;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int write(int, double *, int);
unsigned write_double(int socket, double number) {
  ssize_t rvalue = write(socket, &number, sizeof(number));
  if (rvalue == -1) {
    perror("write_double - Failed to send double");
    exit(EXIT_FAILURE);
  }
  return rvalue;
}


x86 assembly (clang, -O0):
<write_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1178 <write_double+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_double>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     114a <write_double+0x1a>
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"write_double - Failed to send double\00"
@EXIT_FAILURE = global i32 0
define i32 @write_double(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, double* %4, i32 8)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [37 x i8] c"write_double - Failed to send double\00"
@EXIT_FAILURE = global i32 0
define i32 @write_double(i32 %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i32 @write(i32 %0, double* %3, i32 8)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i32 %4
}