xunge/DecIR huggingface dataset:
unsigned long djb2(const unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <djb2+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <djb2+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void *createIntItem(int x) {
  int *item = (int *)malloc(sizeof(int));
  *item = x;
  return item;
}


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

x86 assembly (clang, -O2):
<createIntItem>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @createIntItem(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%3 = bitcast i8* %2 to i32*
store i32 %0, i32* %3
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t hex_encode(uint8_t digit) {
  return digit > 9 ? 'a' + digit - 10 : '0' + digit;
}


x86 assembly (clang, -O0):
<hex_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1122 <hex_encode+0x22>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <hex_encode+0x2b>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_encode>:
lea    0x30(%rdi),%ecx
lea    0x57(%rdi),%eax
cmp    $0xa,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hex_encode(i32 %0) {
%2 = icmp sgt i32 %0, 9
%3 = select i1 %2, i32 87, i32 48
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int posix_fallocate(int, int /*<<< orphan*/, long long);
int /*<<< orphan*/ stderr;
char *strerror(int);
int do_allocate(int fd, long long size) {
  int err;
  if ((err = posix_fallocate(fd, 0, size)) != 0) {
    fprintf(stderr, "%s\n", strerror(err));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <posix_fallocate@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     118b <do_allocate+0x5b>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rdx
lea    0xe86(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <do_allocate+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_allocate>:
push   %rbx
mov    %rsi,%rdx
xor    %ebx,%ebx
xor    %esi,%esi
call   1040 <posix_fallocate@plt>
test   %eax,%eax
je     1167 <do_allocate+0x37>
mov    0x2e98(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xea8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @do_allocate(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
%7 = load i32, i32* %4
%8 = load i64, i64* %5
%9 = call i32 @posix_fallocate(i32 %7, i32 0, i64 %8)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %6
%14 = call i8* @strerror(i32 %13)
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 -1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @do_allocate(i32 %0, i64 %1) {
%3 = tail call i32 @posix_fallocate(i32 %0, i32 0, i64 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i8* @strerror(i32 %3)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %10
}
void XSetFillStyle() {}


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

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

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

LLVM IR (-O2):
define void @XSetFillStyle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_move_cursor(unsigned short);
void fb_set_cursor_pos(unsigned short pos) { fb_move_cursor(pos); }


x86 assembly (clang, -O0):
<fb_set_cursor_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <fb_move_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_set_cursor_pos>:
jmp    1030 <fb_move_cursor@plt>

LLVM IR (-O0):
define void @fb_set_cursor_pos(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @fb_move_cursor(i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @fb_set_cursor_pos(i16 zeroext %0) {
%2 = tail call i32 @fb_move_cursor(i16 zeroext %0)
ret void
}
cbuf15(f, n) int f, n;
{ cbuf(f, n, 15); }


x86 assembly (clang, -O0):
<cbuf15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0xf,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf15>:
mov    $0xf,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf15(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 15)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf15(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 15)
ret i32 undef
}
/* Variables and functions */
int strverscmp(char const *, char const *);
int os_strverscmp(const char *s1, const char *s2) { return strverscmp(s1, s2); }


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

x86 assembly (clang, -O2):
<os_strverscmp>:
jmp    1030 <strverscmp@plt>

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

LLVM IR (-O2):
define i32 @os_strverscmp(i8* %0, i8* %1) {
%3 = tail call i32 @strverscmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ add_immediate_test();
int /*<<< orphan*/ add_immediate_with_carry_test();
int /*<<< orphan*/ add_memory_test();
int /*<<< orphan*/ add_memory_with_carry_test();
int /*<<< orphan*/ add_register_test();
int /*<<< orphan*/ add_register_with_carry_test();
int main(int argc, const char *argv[]) {
  add_register_test();
  add_memory_test();
  add_immediate_test();
  add_register_with_carry_test();
  add_memory_with_carry_test();
  add_immediate_with_carry_test();
  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)
mov    $0x0,%al
call   1070 <add_register_test@plt>
mov    $0x0,%al
call   1040 <add_memory_test@plt>
mov    $0x0,%al
call   1060 <add_immediate_test@plt>
mov    $0x0,%al
call   1080 <add_register_with_carry_test@plt>
mov    $0x0,%al
call   1050 <add_memory_with_carry_test@plt>
mov    $0x0,%al
call   1030 <add_immediate_with_carry_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <add_register_test@plt>
xor    %eax,%eax
call   1040 <add_memory_test@plt>
xor    %eax,%eax
call   1060 <add_immediate_test@plt>
xor    %eax,%eax
call   1080 <add_register_with_carry_test@plt>
xor    %eax,%eax
call   1050 <add_memory_with_carry_test@plt>
xor    %eax,%eax
call   1030 <add_immediate_with_carry_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 i32 (...) @add_register_test()
%7 = call i32 (...) @add_memory_test()
%8 = call i32 (...) @add_immediate_test()
%9 = call i32 (...) @add_register_with_carry_test()
%10 = call i32 (...) @add_memory_with_carry_test()
%11 = call i32 (...) @add_immediate_with_carry_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @add_register_test()
%4 = tail call i32 (...) @add_memory_test()
%5 = tail call i32 (...) @add_immediate_test()
%6 = tail call i32 (...) @add_register_with_carry_test()
%7 = tail call i32 (...) @add_memory_with_carry_test()
%8 = tail call i32 (...) @add_immediate_with_carry_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  is_prime(num);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <is_prime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @is_prime(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
ret i32 0
}
__attribute__((no)) void usechar(char c) {
  __asm__ __volatile__("" : : "r"(c) : "memory", "cc");
}


x86 assembly (clang, -O0):
<usechar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @usechar(i8 signext %0) {
tail call void asm sideeffect "", "r,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i8 %0)
ret void
}
int execute_epoll_create() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_epoll_create() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printusage(int argc, char *argv[]) {
  printf("Usage: %s -n BLOCKNUM -f FILE\n", argv[0]);
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: %s -n BLOCKNUM -f FILE\0A\00"
define void @printusage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: %s -n BLOCKNUM -f FILE\0A\00"
define void @printusage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Done(int /*<<< orphan*/);
void SigTermCaught() { Done(0); }


x86 assembly (clang, -O0):
<SigTermCaught>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <Done@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SigTermCaught() {
%1 = call i32 @Done(i32 0)
ret void
}

LLVM IR (-O2):
define void @SigTermCaught() {
%1 = tail call i32 @Done(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ suggest_runtime_suspend_path(char *);
void suggest_runtime_suspend(void) {
  suggest_runtime_suspend_path("/sys/bus/pci/devices");
  suggest_runtime_suspend_path("/sys/bus/spi/devices");
  suggest_runtime_suspend_path("/sys/bus/i2c/devices");
}


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

x86 assembly (clang, -O2):
<suggest_runtime_suspend>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <suggest_runtime_suspend_path@plt>
lea    0xef1(%rip),%rdi
call   1030 <suggest_runtime_suspend_path@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <suggest_runtime_suspend_path@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"/sys/bus/pci/devices\00"
@.str.1 = [21 x i8] c"/sys/bus/spi/devices\00"
@.str.2 = [21 x i8] c"/sys/bus/i2c/devices\00"
define void @suggest_runtime_suspend() {
%1 = call i32 @suggest_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @suggest_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @suggest_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"/sys/bus/pci/devices\00"
@.str.1 = [21 x i8] c"/sys/bus/spi/devices\00"
@.str.2 = [21 x i8] c"/sys/bus/i2c/devices\00"
define void @suggest_runtime_suspend() {
%1 = tail call i32 @suggest_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @suggest_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @suggest_runtime_suspend_path(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ rand();
uint32_t get32rand() {
  return (((uint32_t)rand() << 0) & 0x0000FFFFul) |
         (((uint32_t)rand() << 16) & 0xFFFF0000ul);
}


x86 assembly (clang, -O0):
<get32rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
shl    $0x0,%eax
cltq
and    $0xffff,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
shl    $0x10,%ecx
movslq %ecx,%rcx
movabs $0xffff0000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32rand>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movzwl %ax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x10,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get32rand() {
%1 = call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 0
%4 = sext i32 %3 to i64
%5 = and i64 %4, 65535
%6 = call i64 (...) @rand()
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = sext i32 %8 to i64
%10 = and i64 %9, 4294901760
%11 = or i64 %5, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @get32rand() {
%1 = tail call i64 (...) @rand()
%2 = and i64 %1, 65535
%3 = tail call i64 (...) @rand()
%4 = shl i64 %3, 16
%5 = or i64 %4, %2
%6 = trunc i64 %5 to i32
ret i32 %6
}
void ReadALConfig(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PBE2PARAM_it;
void PBE2PARAM_free(PBE2PARAM *a) {
  ASN1_item_free((ASN1_VALUE *)a, &PBE2PARAM_it);
}


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

x86 assembly (clang, -O2):
<PBE2PARAM_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@PBE2PARAM_it = global i32 0
define void @PBE2PARAM_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @PBE2PARAM_it)
ret void
}

LLVM IR (-O2):
@PBE2PARAM_it = global i32 0
define void @PBE2PARAM_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @PBE2PARAM_it)
ret void
}
/* Variables and functions */
int sort(int *, int, int);
void quick_sort(int s[], int start, int end) {
  if (start < end) {
    int point = sort(s, start, end);
    quick_sort(s, start, point - 1);
    quick_sort(s, point + 1, end);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <sort@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <sort@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @sort(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_normvideo(void) { conio_init(); }


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

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

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

LLVM IR (-O2):
define void @caca_conio_normvideo() {
%1 = tail call i32 (...) @conio_init()
ret void
}
int strcmp(const char *cs, const char *ct) {
  int d0, d1;
  register int __res;
  __asm__ __volatile__("1:\tlodsb\n\t"
                       "scasb\n\t"
                       "jne 2f\n\t"
                       "testb %%al,%%al\n\t"
                       "jne 1b\n\t"
                       "xorl %%eax,%%eax\n\t"
                       "jmp 3f\n"
                       "2:\tsbbl %%eax,%%eax\n\t"
                       "orb $1,%%al\n"
                       "3:"
                       : "=a"(__res), "=&S"(d0), "=&D"(d1)
                       : "1"(cs), "2"(ct)
                       : "memory");
  return __res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <strcmp+0x2b>
test   %al,%al
jne    1114 <strcmp+0x14>
xor    %eax,%eax
jmp    112f <strcmp+0x2f>
sbb    %eax,%eax
or     $0x1,%al
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <strcmp+0x15>
test   %al,%al
jne    1109 <strcmp+0x9>
xor    %eax,%eax
jmp    1119 <strcmp+0x19>
sbb    %eax,%eax
or     $0x1,%al
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i32, i8*, i8* } %10, 0
%12 = extractvalue { i32, i8*, i8* } %10, 1
%13 = extractvalue { i32, i8*, i8* } %10, 2
store i32 %11, i32* %7
%14 = ptrtoint i8* %12 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %13 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i32, i8*, i8* } %3, 0
ret i32 %4
}
void append_char(char *dst, int *dstlen, char c) {
  if (*dstlen >= 260)
    return;
  dst[(*dstlen)++] = c;
}


x86 assembly (clang, -O0):
<append_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x104,(%rax)
jl     1126 <append_char+0x26>
jmp    1140 <append_char+0x40>
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_char>:
movslq (%rsi),%rax
cmp    $0x103,%rax
jg     1113 <append_char+0x13>
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    %dl,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @append_char(i8* nocapture writeonly %0, i32* nocapture %1, i8 signext %2) {
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 259
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = add nsw i32 %4, 1
store i32 %7, i32* %1
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %2, i8* %9
br label %10
10: ; preds = %3, %6
ret void
}
void crossout(long k, long limit, unsigned char *primearr) {
  long i;
  for (i = 3; i * k <= limit; i += 2) {
    primearr[(i * k) >> 3] |= (1 << ((i * k) & (8 - 1)));
  }
}


x86 assembly (clang, -O0):
<crossout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x3,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     116c <crossout+0x6c>
mov    -0x20(%rbp),%rax
imul   -0x8(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x8(%rbp),%rcx
sar    $0x3,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <crossout+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crossout>:
lea    (%rdi,%rdi,2),%rax
cmp    %rsi,%rax
jg     112e <crossout+0x2e>
add    %rdi,%rdi
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0x7,%cl
mov    $0x1,%r8b
shl    %cl,%r8b
mov    %rax,%rcx
sar    $0x3,%rcx
or     %r8b,(%rdx,%rcx,1)
add    %rdi,%rax
cmp    %rsi,%rax
jle    1110 <crossout+0x10>
ret

LLVM IR (-O0):
define void @crossout(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
store i64 3, i64* %7
br label %8
8: ; preds = %31, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %4
%11 = mul nsw i64 %9, %10
%12 = load i64, i64* %5
%13 = icmp sle i64 %11, %12
br i1 %13, label %14, label %34
14: ; preds = %8
%15 = load i64, i64* %7
%16 = load i64, i64* %4
%17 = mul nsw i64 %15, %16
%18 = and i64 %17, 7
%19 = trunc i64 %18 to i32
%20 = shl i32 1, %19
%21 = load i8*, i8** %6
%22 = load i64, i64* %7
%23 = load i64, i64* %4
%24 = mul nsw i64 %22, %23
%25 = ashr i64 %24, 3
%26 = getelementptr inbounds i8, i8* %21, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = or i32 %28, %20
%30 = trunc i32 %29 to i8
store i8 %30, i8* %26
br label %31
31: ; preds = %14
%32 = load i64, i64* %7
%33 = add nsw i64 %32, 2
store i64 %33, i64* %7
br label %8
34: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @crossout(i64 %0, i64 %1, i8* nocapture %2) {
%4 = mul nsw i64 %0, 3
%5 = icmp sgt i64 %4, %1
br i1 %5, label %19, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %17, %6 ], [ %4, %3 ]
%8 = phi i64 [ %16, %6 ], [ 3, %3 ]
%9 = trunc i64 %7 to i8
%10 = and i8 %9, 7
%11 = shl nuw i8 1, %10
%12 = ashr i64 %7, 3
%13 = getelementptr inbounds i8, i8* %2, i64 %12
%14 = load i8, i8* %13
%15 = or i8 %14, %11
store i8 %15, i8* %13
%16 = add nuw nsw i64 %8, 2
%17 = mul nsw i64 %16, %0
%18 = icmp sgt i64 %17, %1
br i1 %18, label %19, label %6
19: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_char(char);
void write_newline() { write_char('\n'); }


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

x86 assembly (clang, -O2):
<write_newline>:
mov    $0xa,%edi
jmp    1030 <write_char@plt>

LLVM IR (-O0):
define void @write_newline() {
%1 = call i32 @write_char(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @write_newline() {
%1 = tail call i32 @write_char(i8 signext 10)
ret void
}
void test_standard() {
  char a;
  short b;
  int c;
  long d;
  long long e;
  short int f;
  long int g;
  long long int h;
  long int long i;
  float j;
  double k;
  long double l;
}


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

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

LLVM IR (-O0):
define void @test_standard() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i16
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca float
%11 = alloca double
%12 = alloca x86_fp80
ret void
}

LLVM IR (-O2):
define void @test_standard() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void visualizza(float min, float max) {
  for (int i = min + 1; i < max; i++) {
    printf("%d\n", i);
  }
}


x86 assembly (clang, -O0):
<visualizza>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1166 <visualizza+0x56>
mov    -0xc(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <visualizza+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visualizza>:
push   %r14
push   %rbx
push   %rax
addss  0xee4(%rip),%xmm0
cvttps2dq %xmm0,%xmm2
cvtdq2ps %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    115f <visualizza+0x4f>
cvttss2si %xmm0,%ebx
lea    0xed1(%rip),%r14
movss  %xmm1,0x4(%rsp)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
add    $0x1,%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
ucomiss %xmm0,%xmm1
ja     1140 <visualizza+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @visualizza(float %0, float %1) {
%3 = fadd float %0, 1.000000e+00
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
%6 = fcmp olt float %5, %1
br i1 %6, label %8, label %7
7: ; preds = %8, %2
ret void
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %4, %2 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nsw i32 %9, 1
%12 = sitofp i32 %11 to float
%13 = fcmp olt float %12, %1
br i1 %13, label %8, label %7
}
/* Variables and functions */
int syscall(int, int, char *, int);
int read(int fd, char *buf, int nbytes) { return syscall(34, fd, buf, nbytes); }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x22,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x22,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @read(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 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 34, i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 34, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, unsigned int, char *);
int test0(char *file, unsigned int line, int expr, char *descr) {
  printf("%s has %s the test (line %d): %s\n", file, expr ? "PASSED" : "FAILED",
         line, descr);
  return expr;
}


x86 assembly (clang, -O0):
<test0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%ecx
lea    0xef5(%rip),%rdx
lea    0xee7(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test0>:
push   %rbx
mov    %rcx,%r8
mov    %edx,%ebx
mov    %esi,%ecx
mov    %rdi,%rsi
test   %edx,%edx
lea    0xf05(%rip),%rax
lea    0xef7(%rip),%rdx
cmove  %rax,%rdx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"%s has %s the test (line %d): %s\0A\00"
@.str.1 = [7 x i8] c"PASSED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @test0(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%14 = load i32, i32* %6
%15 = load i8*, i8** %8
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %13, i32 %14, i8* %15)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [34 x i8] c"%s has %s the test (line %d): %s\0A\00"
@.str.1 = [7 x i8] c"PASSED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @test0(i8* %0, i32 %1, i32 returned %2, i8* %3) {
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6, i32 %1, i8* %3)
ret i32 %2
}
int countAFile(char *filename) {}


x86 assembly (clang, -O0):
<countAFile>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @countAFile(i8* nocapture readnone %0) {
ret i32 undef
}
void pathcon_nm2_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm2_incref() {
ret void
}
/* Variables and functions */
int chroot(char const *);
__attribute__((__weak__, __always___)) int
softboundmpx_chroot(const char *path) {
  return chroot(path);
}


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

x86 assembly (clang, -O2):
<softboundmpx_chroot>:
jmp    1030 <chroot@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_chroot(i8* %0) {
%2 = tail call i32 @chroot(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x8f() {
  Assert_real((isspace(143) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              720, ("isspace should be 0 for 0x8f"));
}


x86 assembly (clang, -O0):
<t_isspace_0x8f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8f,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2d0,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x8f>:
push   %rax
mov    $0x8f,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x8f\00"
define void @t_isspace_0x8f() {
%1 = call i64 @isspace(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x8f\00"
define void @t_isspace_0x8f() {
%1 = tail call i64 @isspace(i32 143)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 720, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void rop3_246_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_246_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_246_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_246_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
get_int(highbyte) int highbyte;
{
  int lowbyte;
  if (highbyte == 0)
    highbyte = get_data();
  lowbyte = get_data();
  return (highbyte & 040 ? -(((highbyte & 037) << 6) | (lowbyte & 077))
                         : (((highbyte & 037) << 6) | (lowbyte & 077)));
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <get_int+0x1f>
mov    $0x0,%al
call   1030 <get_data@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_data@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1165 <get_int+0x55>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
or     %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <get_int+0x69>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
shl    $0x6,%eax
mov    -0x8(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1120 <get_int+0x10>
xor    %eax,%eax
call   1030 <get_data@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <get_data@plt>
mov    %ebx,%ecx
and    $0x1f,%ecx
shl    $0x6,%ecx
and    $0x3f,%eax
or     %ecx,%eax
mov    %eax,%ecx
neg    %ecx
test   $0x20,%bl
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @get_data()
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %1
%9 = call i32 (...) @get_data()
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = and i32 %10, 32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = load i32, i32* %2
%15 = and i32 %14, 31
%16 = shl i32 %15, 6
%17 = load i32, i32* %3
%18 = and i32 %17, 63
%19 = or i32 %16, %18
%20 = sub nsw i32 0, %19
br label %28
21: ; preds = %8
%22 = load i32, i32* %2
%23 = and i32 %22, 31
%24 = shl i32 %23, 6
%25 = load i32, i32* %3
%26 = and i32 %25, 63
%27 = or i32 %24, %26
br label %28
28: ; preds = %21, %13
%29 = phi i32 [ %20, %13 ], [ %27, %21 ]
ret i32 %29
}

LLVM IR (-O2):
define i32 @get_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @get_data()
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ %4, %3 ], [ %0, %1 ]
%7 = tail call i32 (...) @get_data()
%8 = and i32 %6, 32
%9 = icmp eq i32 %8, 0
%10 = shl i32 %6, 6
%11 = and i32 %10, 1984
%12 = and i32 %7, 63
%13 = or i32 %11, %12
%14 = sub nsw i32 0, %13
%15 = select i1 %9, i32 %13, i32 %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0;
  printf("hello");
  int j = 1 / i;
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX1(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op9DM0X1(void) { STA16(AbsoluteIndexedXX1(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op9DM0X1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9DM0X1>:
push   %rax
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op9DM0X1() {
%1 = call i32 @AbsoluteIndexedXX1(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op9DM0X1() {
%1 = tail call i32 @AbsoluteIndexedXX1(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}