xunge/DecIR huggingface dataset:
unsigned int urem(unsigned int X, unsigned int Y) { return X % Y; }


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

x86 assembly (clang, -O2):
<urem>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @urem(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
ret i32 %3
}
int mstring_get_length(char *str) {
  int num;
  for (num = 0; str[num]; num++)
    ;
  return num;
}


x86 assembly (clang, -O0):
<mstring_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <mstring_get_length+0x34>
jmp    1126 <mstring_get_length+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mstring_get_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstring_get_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <mstring_get_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @mstring_get_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
copy_ack_header_to_buffer(int block_num, char *buffer) {
  buffer[0] = '\0';
  buffer[1] = '\4';
  buffer[2] = (char)(block_num / 256);
  buffer[3] = (char)(block_num % 256);
}


x86 assembly (clang, -O0):
<copy_ack_header_to_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x4,0x1(%rax)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_ack_header_to_buffer>:
movw   $0x400,(%rsi)
lea    0xff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %ah,0x2(%rsi)
mov    %dil,0x3(%rsi)
ret

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

LLVM IR (-O2):
define i32 @copy_ack_header_to_buffer(i32 %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 4, i8* %3
%4 = sdiv i32 %0, 256
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %5, i8* %6
%7 = trunc i32 %0 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %7, i8* %8
ret i32 undef
}
/* Variables and functions */
int getch();
int inputch() { return (getch() & 0177); }


x86 assembly (clang, -O0):
<inputch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getch@plt>
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputch>:
push   %rax
xor    %eax,%eax
call   1030 <getch@plt>
and    $0x7f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @inputch() {
%1 = call i32 (...) @getch()
%2 = and i32 %1, 127
ret i32 %2
}

LLVM IR (-O2):
define i32 @inputch() {
%1 = tail call i32 (...) @getch()
%2 = and i32 %1, 127
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int cpuid_PERFEVTSEL_num() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 10;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  return (((uint64_t)(rax) &
           ((((uint64_t)1 << (((15)) - ((8)) + 1)) - 1) << ((8)))) >>
          (8));
}


x86 assembly (clang, -O0):
<cpuid_PERFEVTSEL_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_PERFEVTSEL_num>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0xa,%edi
call   1030 <cpuid@plt>
movzbl 0x9(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_PERFEVTSEL_num() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @cpuid(i32 %6, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %1
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
ret i32 %10
}

LLVM IR (-O2):
define i32 @cpuid_PERFEVTSEL_num() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 10, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
ret i32 %12
}
unsigned s2e_codext_createFork(unsigned value) {
  unsigned retval;
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0xFA, 0x04, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       : "=a"(retval)
                       : "a"(0), "b"(value));
  return retval;
}


x86 assembly (clang, -O0):
<s2e_codext_createFork>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
xor    %eax,%eax
(bad)
add    %bh,%dl
add    $0x0,%al
add    %al,(%rax)
add    %al,(%rax)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_codext_createFork>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
(bad)
add    %bh,%dl
add    $0x0,%al
add    %al,(%rax)
add    %al,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @s2e_codext_createFork(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0xFA, 0x04, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @s2e_codext_createFork(i32 %0) {
%2 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0xFA, 0x04, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %0)
ret i32 %2
}
const char *next(const char *string) {
  char **next = (char **)string - 1;
  return *next;
}


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

x86 assembly (clang, -O2):
<next>:
mov    -0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @next(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ quit(int);
int /*<<< orphan*/ report(char *);
void fatal(char *label) {
  report(label);
  quit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <report@plt>
mov    $0xffffffff,%edi
call   1030 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1040 <report@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1030 <quit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @report(i8* %3)
%5 = call i32 @quit(i32 -1)
ret void
}

LLVM IR (-O2):
define void @fatal(i8* %0) {
%2 = tail call i32 @report(i8* %0)
%3 = tail call i32 @quit(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fir_entry();
int print_int(int /*<<< orphan*/);
int main() { return print_int(fir_entry()); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fir_entry()
%2 = tail call i32 @print_int(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigwait(const sigset_t *set, int *sig) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__sigwait(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
char **XListExtensions() {}


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

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

LLVM IR (-O0):
define i8** @XListExtensions() {
%1 = alloca i8**
%2 = load i8**, i8*** %1
ret i8** %2
}

LLVM IR (-O2):
define noalias i8** @XListExtensions() {
ret i8** undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ get_uint64(int /*<<< orphan*/ *, int /*<<< orphan*/);
uint32_t format_address_long_lba(uint8_t *data) { return get_uint64(data, 0); }


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

x86 assembly (clang, -O2):
<format_address_long_lba>:
xor    %esi,%esi
jmp    1030 <get_uint64@plt>

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

LLVM IR (-O2):
define i32 @format_address_long_lba(i32* %0) {
%2 = tail call i32 @get_uint64(i32* %0, i32 0)
ret i32 %2
}
void av_fifo_generic_write() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_generic_write() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./test_divide <number1> <number2>\nPrints out number1 divided "
         "by number2\n");
}


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

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

LLVM IR (-O0):
@.str = [80 x i8] c"Usage: ./test_divide <number1> <number2>\0APrints out number1 divided by number2\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [79 x i8] c"Usage: ./test_divide <number1> <number2>\0APrints out number1 divided by number2\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
ret void
}
void sunxi_serial_putc(char c) {}


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

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

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

LLVM IR (-O2):
define void @sunxi_serial_putc(i8 signext %0) {
ret void
}
void gtk_tool_item_get_is_important() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_get_is_important() {
ret void
}
/* Variables and functions */
char *strtok(int /*<<< orphan*/ *, char *);
char *_helper_get_next_param() { return strtok(NULL, " "); }


x86 assembly (clang, -O0):
<_helper_get_next_param>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
lea    0xee1(%rip),%rsi
call   1030 <strtok@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_helper_get_next_param>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <strtok@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i8* @_helper_get_next_param() {
%1 = call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i8* @_helper_get_next_param() {
%1 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int exynos_drm_iommu_unregister(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @exynos_drm_iommu_unregister() {
ret i32 0
}
void foo_1_2_1_2_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_2_2_2_1() {
ret void
}
long double igraph_fabsl(long double a) {
  if (a < 0) {
    return -a;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<igraph_fabsl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    112b <igraph_fabsl+0x2b>
jmp    111e <igraph_fabsl+0x1e>
fldt   -0x20(%rbp)
fchs
fstpt  -0x10(%rbp)
jmp    1131 <igraph_fabsl+0x31>
fldt   -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<igraph_fabsl>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @igraph_fabsl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fcmp olt x86_fp80 %4, 0xK00000000000000000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load x86_fp80, x86_fp80* %3
%8 = fneg x86_fp80 %7
store x86_fp80 %8, x86_fp80* %2
br label %11
9: ; preds = %1
%10 = load x86_fp80, x86_fp80* %3
store x86_fp80 %10, x86_fp80* %2
br label %11
11: ; preds = %9, %6
%12 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @igraph_fabsl(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %3, x86_fp80 %0
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ vecNd_add_new(double *, double const *, double const *, int);
void vec3d_add_new(double result[3], const double a[3], const double b[3]) {
  vecNd_add_new(result, a, b, 3);
}


x86 assembly (clang, -O0):
<vec3d_add_new>:
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    $0x3,%ecx
call   1030 <vecNd_add_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3d_add_new>:
mov    $0x3,%ecx
jmp    1030 <vecNd_add_new@plt>

LLVM IR (-O0):
define void @vec3d_add_new(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @vecNd_add_new(double* %7, double* %8, double* %9, i32 3)
ret void
}

LLVM IR (-O2):
define void @vec3d_add_new(double* %0, double* %1, double* %2) {
%4 = tail call i32 @vecNd_add_new(double* %0, double* %1, double* %2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int(int /*<<< orphan*/, int /*<<< orphan*/,
                              char const *);
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
void assert_mem(const void *expected, const void *reality, size_t n,
                const char *msg) {
  assert_int(0, memcmp(expected, reality, n), msg);
}


x86 assembly (clang, -O0):
<assert_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
xor    %edi,%edi
call   1040 <assert_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_mem>:
push   %rbx
mov    %rcx,%rbx
call   1030 <memcmp@plt>
xor    %edi,%edi
mov    %eax,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <assert_int@plt>

LLVM IR (-O0):
define void @assert_mem(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @memcmp(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %8
%14 = call i32 @assert_int(i32 0, i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @assert_mem(i8* nocapture %0, i8* nocapture %1, i64 %2, i8* %3) {
%5 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
%6 = tail call i32 @assert_int(i32 0, i32 %5, i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum_utf8(int _ch) {
  unsigned int ch = (unsigned int)_ch;
  return isdigit(_ch) || isalpha(_ch) || (ch > 0x7F);
}


x86 assembly (clang, -O0):
<isalnum_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    116f <isalnum_utf8+0x4f>
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    116f <isalnum_utf8+0x4f>
cmpl   $0x7f,-0x8(%rbp)
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum_utf8>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <isdigit@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1148 <isalnum_utf8+0x28>
mov    %ebp,%edi
call   1040 <isalpha@plt>
test   %rax,%rax
jne    1148 <isalnum_utf8+0x28>
xor    %ebx,%ebx
cmp    $0x7f,%ebp
seta   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isalnum_utf8(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @isalpha(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp ugt i32 %0, 127
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %4, %1
%11 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ gl_err(char *);
void *realloc(void *, int);
void *gl_realloc(void *ptr, int size) {
  void *ptr2;
  ptr2 = realloc(ptr, size);
  if (ptr2 == 0 && size)
    gl_err("No more memory");
  return ptr2;
}


x86 assembly (clang, -O0):
<gl_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <gl_realloc+0x40>
cmpl   $0x0,-0xc(%rbp)
je     1160 <gl_realloc+0x40>
lea    0xea5(%rip),%rdi
call   1040 <gl_err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_realloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
je     1142 <gl_realloc+0x22>
test   %rbx,%rbx
jne    1142 <gl_realloc+0x22>
lea    0xec3(%rip),%rdi
call   1040 <gl_err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"No more memory\00"
define i8* @gl_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @gl_err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"No more memory\00"
define i8* @gl_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i32 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @gl_err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Type definitions */
struct _stor_fclose_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_fclose_req *);
void stor_fclose_req_free(struct _stor_fclose_req *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fclose_req_free>:
jmp    1030 <osapi_free@plt>

LLVM IR (-O0):
%struct._stor_fclose_req = type { i32 }
define void @stor_fclose_req_free(%struct._stor_fclose_req* %0) {
%2 = alloca %struct._stor_fclose_req*
store %struct._stor_fclose_req* %0, %struct._stor_fclose_req** %2
%3 = load %struct._stor_fclose_req*, %struct._stor_fclose_req** %2
%4 = call i32 @osapi_free(%struct._stor_fclose_req* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_fclose_req = type { i32 }
define void @stor_fclose_req_free(%struct._stor_fclose_req* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_fclose_req* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PORTA_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void PORTA_IRQHandler(void) {
  PORTA_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PORTA_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @PORTA_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PORTA_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @PORTA_DriverIRQHandler()
ret void
}
int HASH(char *str) {
  int idx = 0;
  while (*str) {
    idx = idx << 1;
    idx += *str;
    str++;
  }
  return (idx & (256 - 1));
}


x86 assembly (clang, -O0):
<HASH>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1143 <HASH+0x43>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <HASH+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HASH>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <HASH+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <HASH+0x10>
movzbl %al,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @HASH(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %10, 255
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
int /*<<< orphan*/ picenable(int /*<<< orphan*/);
void timerinit(void) {
  outb((0x040 + 3), 0x00 | 0x04 | 0x30);
  outb(0x040, ((1193182 + (100) / 2) / (100)) % 256);
  outb(0x040, ((1193182 + (100) / 2) / (100)) / 256);
  picenable(0);
}


x86 assembly (clang, -O0):
<timerinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x9c,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x2e,%esi
call   1030 <outb@plt>
xor    %edi,%edi
call   1040 <picenable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerinit>:
push   %rax
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x9c,%esi
call   1030 <outb@plt>
mov    $0x40,%edi
mov    $0x2e,%esi
call   1030 <outb@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <picenable@plt>

LLVM IR (-O0):
define void @timerinit() {
%1 = call i32 @outb(i32 67, i32 52)
%2 = call i32 @outb(i32 64, i32 156)
%3 = call i32 @outb(i32 64, i32 46)
%4 = call i32 @picenable(i32 0)
ret void
}

LLVM IR (-O2):
define void @timerinit() {
%1 = tail call i32 @outb(i32 67, i32 52)
%2 = tail call i32 @outb(i32 64, i32 156)
%3 = tail call i32 @outb(i32 64, i32 46)
%4 = tail call i32 @picenable(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int DoYouWantToContinueShopping() {
  int choice;
  puts("Do you want to continue shopping?");
  puts("1 - no ; 2 - yes");
  scanf("%d", &choice);
  return choice == 1 ? 1 : 0;
}


x86 assembly (clang, -O0):
<DoYouWantToContinueShopping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoYouWantToContinueShopping>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,0x4(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Do you want to continue shopping?\00"
@.str.1 = [17 x i8] c"1 - no ; 2 - yes\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @DoYouWantToContinueShopping() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
@.str = [34 x i8] c"Do you want to continue shopping?\00"
@.str.1 = [17 x i8] c"1 - no ; 2 - yes\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @DoYouWantToContinueShopping() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
reg0imm1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (r0 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0x21,%eax
jg     1138 <reg0imm1+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <reg0imm1+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0imm1>:
xor    %eax,%eax
cmp    $0x22,%di
setl   %al
ret

LLVM IR (-O0):
define i32 @reg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %8
%17 = sext i16 %16 to i32
%18 = icmp sle i32 %17, 33
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @reg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = trunc i32 %0 to i16
%8 = icmp slt i16 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
void alrm(int s) {}


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

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

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

LLVM IR (-O2):
define void @alrm(i32 %0) {
ret void
}
printf1(s) char *s;
{
  register int i = 0;
  register char *s1 = s;
  while (*s1++)
    i++;
  if (i)
    write(1, s, i);
}


x86 assembly (clang, -O0):
<printf1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,(%rax)
je     1151 <printf1+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <printf1+0x1b>
cmpl   $0x0,-0x14(%rbp)
je     116e <printf1+0x5e>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf1>:
push   %rax
cmpb   $0x0,(%rdi)
je     1137 <printf1+0x27>
mov    %rdi,%rsi
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <printf1+0x10>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @printf1(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %0, i32 %8)
br label %13
13: ; preds = %1, %11
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ CA_CTX_clear_free(void *);
void wrap_ca_ctx_clear_free(void *ctx) { CA_CTX_clear_free(ctx); }


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

x86 assembly (clang, -O2):
<wrap_ca_ctx_clear_free>:
jmp    1030 <CA_CTX_clear_free@plt>

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

LLVM IR (-O2):
define void @wrap_ca_ctx_clear_free(i8* %0) {
%2 = tail call i32 @CA_CTX_clear_free(i8* %0)
ret void
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long currentTimeMillis() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((tv.tv_sec * 1000LL) + (tv.tv_usec / 1000LL));
}


x86 assembly (clang, -O0):
<currentTimeMillis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentTimeMillis>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x10(%rsp)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @currentTimeMillis() {
%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 i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sdiv i64 %7, 1000
%9 = add nsw i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @currentTimeMillis() {
%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 i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sdiv i64 %8, 1000
%10 = add nsw i64 %9, %6
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vs5();
int /*<<< orphan*/ take_struct_vs5(int /*<<< orphan*/);
void test_struct_vs5() { take_struct_vs5(return_struct_vs5()); }


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

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

LLVM IR (-O0):
define void @test_struct_vs5() {
%1 = call i32 (...) @return_struct_vs5()
%2 = call i32 @take_struct_vs5(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vs5() {
%1 = tail call i32 (...) @return_struct_vs5()
%2 = tail call i32 @take_struct_vs5(i32 %1)
ret void
}
/* Variables and functions */
char getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ ungetch(char);
int main() {
  char c;
  c = getch();
  printf("\n%c", c);
  ungetch(c);
  c = getch();
  printf("\n%c", c);
  printf("\ndone\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1040 <ungetch@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <getch@plt>
movsbl %al,%ebx
lea    0xeab(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <ungetch@plt>
xor    %eax,%eax
call   1060 <getch@plt>
movsbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%c\00"
@.str.1 = [8 x i8] c"\0Adone\0A\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call signext i8 (...) @getch()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8, i8* %1
%7 = call i32 @ungetch(i8 signext %6)
%8 = call signext i8 (...) @getch()
store i8 %8, i8* %1
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%c\00"
@str = [7 x i8] c"\0Adone\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getch()
%2 = sext i8 %1 to i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @ungetch(i8 signext %1)
%5 = tail call signext i8 (...) @getch()
%6 = sext i8 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int odroid_open_file(char *filename) {
  int fd = open(filename, O_RDONLY);
  if (fd < 0) {
    perror("odroid_open_file");
    fprintf(stderr, "Trying to open %s\n", filename);
  }
  return fd;
}


x86 assembly (clang, -O0):
<odroid_open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1180 <odroid_open_file+0x50>
lea    0xe9e(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_open_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1153 <odroid_open_file+0x23>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xea6(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
jmp    114a <odroid_open_file+0x1a>

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
@.str = [17 x i8] c"odroid_open_file\00"
@stderr = global i32 0
@.str.1 = [19 x i8] c"Trying to open %s\0A\00"
define i32 @odroid_open_file(i8* %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PowerManagerP__0__ResourceDefaultOwner__granted();
void ArbiterP__1__ResourceDefaultOwner__granted(void) {
  PowerManagerP__0__ResourceDefaultOwner__granted();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__1__ResourceDefaultOwner__granted() {
%1 = tail call i32 (...) @PowerManagerP__0__ResourceDefaultOwner__granted()
ret void
}
/* Type definitions */
struct device {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
struct device **readDevs(int /*<<< orphan*/ *);
struct device **readDevices(char *fn) {
  FILE *f;
  f = fopen(fn, "r");
  return readDevs(f);
}


x86 assembly (clang, -O0):
<readDevices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <readDevs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDevices>:
push   %rax
lea    0xed8(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <readDevs@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
@.str = [2 x i8] c"r\00"
define %struct.device** @readDevices(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call %struct.device** @readDevs(i32* %6)
ret %struct.device** %7
}

LLVM IR (-O2):
%struct.device = type { i32 }
@.str = [2 x i8] c"r\00"
define %struct.device** @readDevices(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call %struct.device** @readDevs(i32* %2)
ret %struct.device** %3
}
void eac_mode_out(struct TAG_compcxt *ccx) { return; }


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

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

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

LLVM IR (-O2):
%struct.TAG_compcxt = type opaque
define void @eac_mode_out(%struct.TAG_compcxt* nocapture %0) {
ret void
}