xunge/DecIR huggingface dataset:
int daysbfmonth(int symmonth) {
  return 30 * symmonth + (int)(symmonth / 3) - 30;
}


x86 assembly (clang, -O0):
<daysbfmonth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x1e,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
sub    $0x1e,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<daysbfmonth>:
mov    %edi,%eax
shl    $0x5,%eax
sub    %edi,%eax
sub    %edi,%eax
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%eax
add    $0xffffffe2,%eax
ret

LLVM IR (-O0):
define i32 @daysbfmonth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 30, %3
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 3
%7 = add nsw i32 %4, %6
%8 = sub nsw i32 %7, 30
ret i32 %8
}

LLVM IR (-O2):
define i32 @daysbfmonth(i32 %0) {
%2 = mul nsw i32 %0, 30
%3 = sdiv i32 %0, 3
%4 = add nsw i32 %3, -30
%5 = add i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void debugLn(char *s) { printf("%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @debugLn(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int aa_pro_ctr_a15(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a15>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a15 = [15 x i8] c"aa_pro_ctr_a15\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a15(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 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a15, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a15 = [15 x i8] c"aa_pro_ctr_a15\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a15(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a15, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
void bug(int *array) { array[4] = 0; }


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

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

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

LLVM IR (-O2):
define void @bug(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void rtld_fdputstr(int fd, const char *str) { write(fd, str, strlen(str)); }


x86 assembly (clang, -O0):
<rtld_fdputstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtld_fdputstr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @rtld_fdputstr(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
void note_request(const char *key, size_t bytes) {
  (void)key;
  (void)bytes;
}


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

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

LLVM IR (-O0):
define void @note_request(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @note_request(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void cpu_to_be16wu(uint16_t *p, uint16_t v) {
  uint8_t *p1 = (uint8_t *)p;
  p1[0] = v >> 8;
  p1[1] = v & 0xff;
}


x86 assembly (clang, -O0):
<cpu_to_be16wu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_be16wu>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,(%rdi)
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @cpu_to_be16wu(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpu_to_be16wu(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = and i32 %1, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int getmaxy(int /*<<< orphan*/ *);
int getmax_y(WINDOW *w) { return getmaxy(w); }


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

x86 assembly (clang, -O2):
<getmax_y>:
jmp    1030 <getmaxy@plt>

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

LLVM IR (-O2):
define i32 @getmax_y(i32* %0) {
%2 = tail call i32 @getmaxy(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mbrot(int *, double, double, double, int);
int test() {
  int matrix[75 * 75];
  mbrot(matrix, -1.0, -0.5, 0.005, 75);
  return matrix[0];
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x57f0,%rsp
lea    -0x57f0(%rbp),%rdi
movsd  0xed6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
movsd  0xed6(%rip),%xmm2
mov    $0x4b,%esi
call   1030 <mbrot@plt>
mov    -0x57f0(%rbp),%eax
add    $0x57f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x57e8,%rsp
mov    %rsp,%rdi
movsd  0xede(%rip),%xmm0
movsd  0xede(%rip),%xmm1
movsd  0xede(%rip),%xmm2
mov    $0x4b,%esi
call   1030 <mbrot@plt>
mov    (%rsp),%eax
add    $0x57e8,%rsp
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca [5625 x i32]
%2 = getelementptr inbounds [5625 x i32], [5625 x i32]* %1, i64 0, i64 0
%3 = call i32 @mbrot(i32* %2, double -1.000000e+00, double -5.000000e-01, double 5.000000e-03, i32 75)
%4 = getelementptr inbounds [5625 x i32], [5625 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test() {
%1 = alloca [5625 x i32]
%2 = bitcast [5625 x i32]* %1 to i8*
%3 = getelementptr inbounds [5625 x i32], [5625 x i32]* %1, i64 0, i64 0
%4 = call i32 @mbrot(i32* %3, double -1.000000e+00, double -5.000000e-01, double 5.000000e-03, i32 75)
%5 = load i32, i32* %3
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ parrotdelay(int);
void BSP_Delay1ms(uint32_t n) {
  while (n) {
    parrotdelay(23746);
    n--;
  }
}


x86 assembly (clang, -O0):
<BSP_Delay1ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1142 <BSP_Delay1ms+0x32>
mov    $0x5cc2,%edi
call   1030 <parrotdelay@plt>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <BSP_Delay1ms+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_Delay1ms>:
push   %rbx
test   %rdi,%rdi
je     1130 <BSP_Delay1ms+0x20>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x5cc2,%edi
call   1030 <parrotdelay@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <BSP_Delay1ms+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @BSP_Delay1ms(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %6, %1
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 @parrotdelay(i32 23746)
%8 = load i64, i64* %2
%9 = add nsw i64 %8, -1
store i64 %9, i64* %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @BSP_Delay1ms(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @parrotdelay(i32 23746)
%6 = add nsw i64 %4, -1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void cst_regex_init() {}


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

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

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

LLVM IR (-O2):
define void @cst_regex_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void eui64_check_byte(unsigned int value) {
  if (value > 0xff)
    errx(EXIT_FAILURE, "cannot parse eui64");
}


x86 assembly (clang, -O0):
<eui64_check_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jbe    113d <eui64_check_byte+0x2d>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eui64_check_byte>:
cmp    $0x100,%edi
jb     112d <eui64_check_byte+0x1d>
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
jmp    1030 <errx@plt>
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [19 x i8] c"cannot parse eui64\00"
define void @eui64_check_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 255
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @errx(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [19 x i8] c"cannot parse eui64\00"
define void @eui64_check_byte(i32 %0) {
%2 = icmp ugt i32 %0, 255
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @errx(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ get_type_from_mode(int /*<<< orphan*/);
char const *get_type_str(int /*<<< orphan*/);
const char *get_mode_str(mode_t mode) {
  return get_type_str(get_type_from_mode(mode));
}


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

x86 assembly (clang, -O2):
<get_mode_str>:
push   %rax
call   1030 <get_type_from_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <get_type_str@plt>

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

LLVM IR (-O2):
define i8* @get_mode_str(i32 %0) {
%2 = tail call i32 @get_type_from_mode(i32 %0)
%3 = tail call i8* @get_type_str(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ gca_sample(void *, size_t, size_t, size_t);
void gca_shuffle(void *base, size_t n, size_t es) {
  gca_sample(base, n, es, n);
}


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

x86 assembly (clang, -O2):
<gca_shuffle>:
mov    %rsi,%rcx
jmp    1030 <gca_sample@plt>

LLVM IR (-O0):
define void @gca_shuffle(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = call i32 @gca_sample(i8* %7, i64 %8, i64 %9, i64 %10)
ret void
}

LLVM IR (-O2):
define void @gca_shuffle(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @gca_sample(i8* %0, i64 %1, i64 %2, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_fail();
void test_assert_fail_fail(void) { assert_fail(); }


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

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

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

LLVM IR (-O2):
define void @test_assert_fail_fail() {
%1 = tail call i32 (...) @assert_fail()
ret void
}
void i32_encode(unsigned char *buf, unsigned int i) {
  buf[0] = i >> 24;
  buf[1] = i >> 16;
  buf[2] = i >> 8;
  buf[3] = i;
}


x86 assembly (clang, -O0):
<i32_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i32_encode>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @i32_encode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = lshr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @i32_encode(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, int);
void system_setup(int data) { to_gps(0x7e, data); }


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

x86 assembly (clang, -O2):
<system_setup>:
mov    %edi,%esi
mov    $0x7e,%edi
jmp    1030 <to_gps@plt>

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

LLVM IR (-O2):
define void @system_setup(i32 %0) {
%2 = tail call i32 @to_gps(i32 126, i32 %0)
ret void
}
int ade7753_configure_ring(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ade7753_configure_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long ftell(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) long softboundcets_ftell(FILE *stream) {
  return ftell(stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_ftell>:
jmp    1030 <ftell@plt>

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

LLVM IR (-O2):
define weak i64 @softboundcets_ftell(i32* %0) {
%2 = tail call i64 @ftell(i32* %0)
ret i64 %2
}
int abs(int v) { return v < 0 ? -v : v; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ ngen(char *, char *, int);
void cgunscaleby(int v) {
  ngen("%s\tcx,%d", "mov", v);
  gen("xor\tdx,dx");
  gen("div\tcx");
}


x86 assembly (clang, -O0):
<cgunscaleby>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <ngen@plt>
lea    0xec5(%rip),%rdi
call   1040 <gen@plt>
lea    0xec3(%rip),%rdi
call   1040 <gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgunscaleby>:
push   %rax
mov    %edi,%edx
lea    0xed6(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <ngen@plt>
lea    0xed0(%rip),%rdi
call   1040 <gen@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <gen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s\09cx,%d\00"
@.str.1 = [4 x i8] c"mov\00"
@.str.2 = [10 x i8] c"xor\09dx,dx\00"
@.str.3 = [7 x i8] c"div\09cx\00"
define void @cgunscaleby(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s\09cx,%d\00"
@.str.1 = [4 x i8] c"mov\00"
@.str.2 = [10 x i8] c"xor\09dx,dx\00"
@.str.3 = [7 x i8] c"div\09cx\00"
define void @cgunscaleby(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%3 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void CAN_TIMER_Enable(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_new_from_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
void parse_error(char *string, char c) {
  fprintf(stderr, "parse error on '%s' at '%c'\n", string, c);
  usage();
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeba(%rip),%rsi
movsbl -0x9(%rbp),%ecx
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <usage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_error>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <usage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"parse error on '%s' at '%c'\0A\00"
define void @parse_error(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %6, i8 signext %7)
%9 = call i32 (...) @usage()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"parse error on '%s' at '%c'\0A\00"
define void @parse_error(i8* %0, i8 signext %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8 signext %1)
%5 = tail call i32 (...) @usage()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_table_print(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_table_to_string(uint8_t table) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_table_print(stream, table);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_table_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <ofl_table_print@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_table_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ofl_table_print@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_table_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_table_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_table_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_table_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}
int cmd_nand_read(char *arg_list[], int n) {
  sw_printf("\nstart run %s...\n\n\r", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<cmd_nand_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <sw_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_nand_read = [14 x i8] c"cmd_nand_read\00"
define i32 @cmd_nand_read(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.cmd_nand_read, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0Astart run %s...\0A\0A\0D\00"
@__func__.cmd_nand_read = [14 x i8] c"cmd_nand_read\00"
define i32 @cmd_nand_read(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sw_printf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.cmd_nand_read, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, ...);
void print_hint_int_values(const char *name, const int val) {
  if (val == -1) {
    printf("\t%s:\tFINEST\n", name);
    return;
  }
  printf("\t%s:\t%d\n", name, val);
}


x86 assembly (clang, -O0):
<print_hint_int_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1140 <print_hint_int_values+0x30>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1155 <print_hint_int_values+0x45>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hint_int_values>:
mov    %esi,%edx
mov    %rdi,%rsi
cmp    $0xffffffff,%edx
je     1128 <print_hint_int_values+0x18>
lea    0xeec(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"\09%s:\09FINEST\0A\00"
@.str.1 = [9 x i8] c"\09%s:\09%d\0A\00"
define void @print_hint_int_values(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
unsigned char readc(char *);
int bpa_up(void) { return readc("/tmp/bpa_info") == 'u'; }


x86 assembly (clang, -O0):
<bpa_up>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <readc@plt>
movzbl %al,%eax
cmp    $0x75,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpa_up>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <readc@plt>
xor    %ecx,%ecx
cmp    $0x75,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/tmp/bpa_info\00"
define i32 @bpa_up() {
%1 = call zeroext i8 @readc(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = zext i8 %1 to i32
%3 = icmp eq i32 %2, 117
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"/tmp/bpa_info\00"
define i32 @bpa_up() {
%1 = tail call zeroext i8 @readc(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8 %1, 117
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ benchmark_heapsort(int, long *);
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char *argv[]) {
  int N = 10;
  long ary[] = {100, 200, 82, 10, 9, 72, 49, 17, 24, 12, 34};
  int i;
  benchmark_heapsort(N, ary);
  printf("%ld\n", ary[N]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xea5(%rip),%rsi
mov    $0x58,%edx
call   1050 <memcpy@plt>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1030 <benchmark_heapsort@plt>
movslq -0x14(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rsi
lea    0xed7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xf25(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <benchmark_heapsort@plt>
mov    0x50(%rsp),%rsi
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.ary = [11 x i64] [i64 100, i64 200, i64 82, i64 10, i64 9, i64 72, i64 49, i64 17, i64 24, i64 12, i64 34]
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [11 x i64]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%9 = bitcast [11 x i64]* %7 to i8*
%10 = load i32, i32* %6
%11 = getelementptr inbounds [11 x i64], [11 x i64]* %7, i64 0, i64 0
%12 = call i32 @benchmark_heapsort(i32 %10, i64* %11)
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [11 x i64], [11 x i64]* %7, i64 0, i64 %14
%16 = load i64, i64* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ary = [11 x i64] [i64 100, i64 200, i64 82, i64 10, i64 9, i64 72, i64 49, i64 17, i64 24, i64 12, i64 34]
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [11 x i64]
%4 = bitcast [11 x i64]* %3 to i8*
%5 = getelementptr inbounds [11 x i64], [11 x i64]* %3, i64 0, i64 0
%6 = call i32 @benchmark_heapsort(i32 10, i64* %5)
%7 = getelementptr inbounds [11 x i64], [11 x i64]* %3, i64 0, i64 10
%8 = load i64, i64* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}
unsigned short stringCopy(unsigned char *dest, unsigned char *source) {
  short length = -1;
  do {
    *dest++ = *source++;
    length++;
  } while (*(source - 1) != 0);
  return (unsigned short)length;
}


x86 assembly (clang, -O0):
<stringCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0xffff,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x1(%rax),%eax
cmp    $0x0,%eax
jne    1112 <stringCopy+0x12>
movzwl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringCopy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringCopy+0x10>
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define zeroext i16 @stringCopy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
store i8* %0, i8** %3
store i8* %1, i8** %4
store i16 -1, i16* %5
br label %6
6: ; preds = %14, %2
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
%9 = load i8, i8* %7
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 %9, i8* %10
%12 = load i16, i16* %5
%13 = add i16 %12, 1
store i16 %13, i16* %5
br label %14
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 -1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %6, label %20
20: ; preds = %14
%21 = load i16, i16* %5
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @stringCopy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ %1, %2 ], [ %7, %3 ]
%6 = phi i16 [ -1, %2 ], [ %10, %3 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %8, i8* %4
%10 = add i16 %6, 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %3
13: ; preds = %3
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *p;
  p = strdup(s);
  if (!p)
    die("strdup");
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xstrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
unsigned long addbase(unsigned long base, int offset) {
  base += offset * 32;
  return base;
}


x86 assembly (clang, -O0):
<addbase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
cltq
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addbase>:
shl    $0x5,%esi
movslq %esi,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @addbase(i64 %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = sext i32 %3 to i64
%5 = add i64 %4, %0
ret i64 %5
}
int is_slash(char c) { return (c == '/' || c == '\\'); }


x86 assembly (clang, -O0):
<is_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_slash+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_slash>:
cmp    $0x2f,%dil
sete   %al
cmp    $0x5c,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_slash(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 47
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 92
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_slash(i8 signext %0) {
%2 = icmp eq i8 %0, 47
%3 = icmp eq i8 %0, 92
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int /*<<< orphan*/ __CRAB_assume(int);
int foo(int /*<<< orphan*/, int);
int int_nd();
int main() {
  int n1 = int_nd();
  __CRAB_assume(n1 > 0);
  int y1 = foo(0, n1);
  __CRAB_assert(y1 <= n1);
  __CRAB_assert(y1 >= n1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <int_nd@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__CRAB_assume@plt>
mov    -0x8(%rbp),%esi
xor    %edi,%edi
call   1040 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <int_nd@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1050 <__CRAB_assume@plt>
xor    %edi,%edi
mov    %ebx,%esi
call   1040 <foo@plt>
xor    %edi,%edi
xor    %ebp,%ebp
cmp    %ebx,%eax
setle  %dil
setge  %bpl
call   1030 <__CRAB_assert@plt>
mov    %ebp,%edi
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @int_nd()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__CRAB_assume(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @foo(i32 0, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @__CRAB_assert(i32 %14)
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp sge i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @__CRAB_assert(i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @int_nd()
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__CRAB_assume(i32 %3)
%5 = tail call i32 @foo(i32 0, i32 %1)
%6 = icmp sle i32 %5, %1
%7 = zext i1 %6 to i32
%8 = tail call i32 @__CRAB_assert(i32 %7)
%9 = icmp sge i32 %5, %1
%10 = zext i1 %9 to i32
%11 = tail call i32 @__CRAB_assert(i32 %10)
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double now(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + 1e-6 * tv.tv_usec;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %7, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Type definitions */
struct node_avl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ libera_node_avl(struct node_avl *);
void avl_destroy(struct node_avl *raiz) {
  if (raiz != NULL) {
    libera_node_avl(raiz);
  }
}


x86 assembly (clang, -O0):
<avl_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <avl_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <libera_node_avl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avl_destroy>:
test   %rdi,%rdi
je     111a <avl_destroy+0xa>
jmp    1030 <libera_node_avl@plt>
ret

LLVM IR (-O0):
%struct.node_avl = type { i32 }
define void @avl_destroy(%struct.node_avl* %0) {
%2 = alloca %struct.node_avl*
store %struct.node_avl* %0, %struct.node_avl** %2
%3 = load %struct.node_avl*, %struct.node_avl** %2
%4 = icmp ne %struct.node_avl* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.node_avl*, %struct.node_avl** %2
%7 = call i32 @libera_node_avl(%struct.node_avl* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.node_avl = type { i32 }
define void @avl_destroy(%struct.node_avl* %0) {
%2 = icmp eq %struct.node_avl* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @libera_node_avl(%struct.node_avl* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int cheker(char *, char);
int checkNubmer(char c) { return cheker("0123456789", c); }


x86 assembly (clang, -O0):
<checkNubmer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <cheker@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkNubmer>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <cheker@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define i32 @checkNubmer(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @cheker(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @checkNubmer(i8 signext %0) {
%2 = tail call i32 @cheker(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ AttitudeActualHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AttitudeActualRequestUpdate() {
  UAVObjRequestUpdate(AttitudeActualHandle());
}


x86 assembly (clang, -O0):
<AttitudeActualRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AttitudeActualHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AttitudeActualRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <AttitudeActualHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AttitudeActualRequestUpdate() {
%1 = call i32 (...) @AttitudeActualHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AttitudeActualRequestUpdate() {
%1 = tail call i32 (...) @AttitudeActualHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}