xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ any_ip6_dhcp();
scalar_t__ any_ip_dhcp();
int any_dhcp(void) { return any_ip_dhcp() || any_ip6_dhcp(); }


x86 assembly (clang, -O0):
<any_dhcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <any_ip_dhcp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1152 <any_dhcp+0x32>
mov    $0x0,%al
call   1030 <any_ip6_dhcp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_dhcp>:
push   %rax
xor    %eax,%eax
call   1040 <any_ip_dhcp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <any_dhcp+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <any_ip6_dhcp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @any_dhcp() {
%1 = call i64 (...) @any_ip_dhcp()
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @any_ip6_dhcp()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @any_dhcp() {
%1 = tail call i64 (...) @any_ip_dhcp()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @any_ip6_dhcp()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
long double __strtold_nan(char const *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
long double __nanl(const char *tagp) { return __strtold_nan(tagp, NULL, 0); }


x86 assembly (clang, -O0):
<__nanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <__strtold_nan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nanl>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__strtold_nan@plt>

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

LLVM IR (-O2):
define x86_fp80 @__nanl(i8* %0) {
%2 = tail call x86_fp80 @__strtold_nan(i8* %0, i32* null, i32 0)
ret x86_fp80 %2
}
/* Variables and functions */
int epoll_create1(int /*<<< orphan*/);
int stx_queue_create() { return epoll_create1(0); }


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

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

LLVM IR (-O0):
define i32 @stx_queue_create() {
%1 = call i32 @epoll_create1(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @stx_queue_create() {
%1 = tail call i32 @epoll_create1(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ringbuf_put(void *, char);
void ringbuf_putchar(void *rb, char c) {
  while (!ringbuf_put(rb, c))
    ;
}


x86 assembly (clang, -O0):
<ringbuf_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <ringbuf_put@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <ringbuf_putchar+0x34>
jmp    1149 <ringbuf_putchar+0x39>
jmp    1122 <ringbuf_putchar+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ringbuf_putchar>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl %sil,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <ringbuf_put@plt>
test   %eax,%eax
je     1120 <ringbuf_putchar+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ringbuf_putchar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %11, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i32 @ringbuf_put(i8* %6, i8 signext %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ringbuf_putchar(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @ringbuf_put(i8* %0, i8 signext %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int event_open_with_options(struct event *, int /*<<< orphan*/, int, int);
int event_open(struct event *e) {
  return event_open_with_options(e, 0, -1, -1);
}


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

x86 assembly (clang, -O2):
<event_open>:
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
jmp    1030 <event_open_with_options@plt>

LLVM IR (-O0):
%struct.event = type { i32 }
define i32 @event_open(%struct.event* %0) {
%2 = alloca %struct.event*
store %struct.event* %0, %struct.event** %2
%3 = load %struct.event*, %struct.event** %2
%4 = call i32 @event_open_with_options(%struct.event* %3, i32 0, i32 -1, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
%struct.event = type { i32 }
define i32 @event_open(%struct.event* %0) {
%2 = tail call i32 @event_open_with_options(%struct.event* %0, i32 0, i32 -1, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ fail(int /*<<< orphan*/);
void *my_malloc_f(size_t);
void *my_malloc(size_t size) {
  void *block;
  if ((block = my_malloc_f(size)) == NULL)
    fail(ENOMEM);
  return block;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_malloc_f@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1151 <my_malloc+0x31>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
call   1030 <my_malloc_f@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <my_malloc+0x1c>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @my_malloc_f(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @ENOMEM
%9 = call i32 @fail(i32 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i8* @my_malloc(i64 %0) {
%2 = tail call i8* @my_malloc_f(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @ENOMEM
%6 = tail call i32 @fail(i32 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct dcadec_exss_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ta_free(struct dcadec_exss_info *);
void dcadec_context_free_exss_info(struct dcadec_exss_info *info) {
  ta_free(info);
}


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

x86 assembly (clang, -O2):
<dcadec_context_free_exss_info>:
jmp    1030 <ta_free@plt>

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

LLVM IR (-O2):
%struct.dcadec_exss_info = type { i32 }
define void @dcadec_context_free_exss_info(%struct.dcadec_exss_info* %0) {
%2 = tail call i32 @ta_free(%struct.dcadec_exss_info* %0)
ret void
}
int msm_chg_usb_i_is_not_available(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_chg_usb_i_is_not_available() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x45() {
  Assert_real((isascii(69)),
              "/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_isascii.c",
              350, ("isascii should be 1 for E"));
}


x86 assembly (clang, -O0):
<t_isascii_0x45>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x15e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x45>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x15e,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for E\00"
define void @t_isascii_0x45() {
%1 = call i32 @isascii(i32 69)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for E\00"
define void @t_isascii_0x45() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void swap(int *nums, int i, int j) {
  int tmp = nums[i];
  nums[i] = nums[j];
  nums[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int execv(char *, char **);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  setuid(0);
  return execv("/usr/lib/vdr/vdr-shutdown", argv);
}


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)
xor    %edi,%edi
call   1030 <setuid@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <execv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %edi,%edi
call   1030 <setuid@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <execv@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"/usr/lib/vdr/vdr-shutdown\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @setuid(i32 0)
%7 = load i8**, i8*** %5
%8 = call i32 @execv(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [26 x i8] c"/usr/lib/vdr/vdr-shutdown\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setuid(i32 0)
%4 = tail call i32 @execv(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 %4
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int buffer_size(struct buffer *);
void *buffer_start(struct buffer *);
bool buffer_in_region(struct buffer *self, void *p) {
  return p < buffer_start(self) + buffer_size(self);
}


x86 assembly (clang, -O0):
<buffer_in_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <buffer_start@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <buffer_size@plt>
mov    -0x20(%rbp),%rcx
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq %edx,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_in_region>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <buffer_start@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1040 <buffer_size@plt>
movslq %eax,%rcx
add    %r15,%rcx
xor    %eax,%eax
cmp    %r14,%rcx
seta   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @buffer_in_region(%struct.buffer* %0, i8* %1) {
%3 = alloca %struct.buffer*
%4 = alloca i8*
store %struct.buffer* %0, %struct.buffer** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.buffer*, %struct.buffer** %3
%7 = call i8* @buffer_start(%struct.buffer* %6)
%8 = load %struct.buffer*, %struct.buffer** %3
%9 = call i32 @buffer_size(%struct.buffer* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr i8, i8* %7, i64 %10
%12 = icmp ult i8* %5, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buffer_in_region(%struct.buffer* %0, i8* readnone %1) {
%3 = tail call i8* @buffer_start(%struct.buffer* %0)
%4 = tail call i32 @buffer_size(%struct.buffer* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr i8, i8* %3, i64 %5
%7 = icmp ugt i8* %6, %1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ fill_int(int *, char *);
int read_cell(char *buf, long offset) {
  int tmp;
  fill_int(&tmp, &buf[offset]);
  return abs(tmp);
}


x86 assembly (clang, -O0):
<read_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1040 <fill_int@plt>
mov    -0x14(%rbp),%edi
call   1030 <abs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cell>:
push   %rax
add    %rdi,%rsi
lea    0x4(%rsp),%rdi
call   1030 <fill_int@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_cell(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = call i32 @fill_int(i32* %5, i8* %8)
%10 = load i32, i32* %5
%11 = call i32 @abs(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @read_cell(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i8, i8* %0, i64 %1
%6 = call i32 @fill_int(i32* %3, i8* %5)
%7 = load i32, i32* %3
%8 = call i32 @llvm.abs.i32(i32 %7, i1 true)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ function1();
int /*<<< orphan*/ function2();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from program.c\n");
  function1();
  function2();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Hello from program.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @function1()
%5 = tail call i32 (...) @function2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_learner();
int main(int argc, char **args) {
  test_learner();
  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   1030 <test_learner@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_learner@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 (...) @test_learner()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_learner()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
int /*<<< orphan*/ unlink(char *);
void cleanup() {
  unlink("mknod-file");
  unlink("mknod-device");
  rmdir("folder");
  rmdir("folder-readonly");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed4(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed5(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xed0(%rip),%rdi
call   1040 <rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed7(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed8(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1040 <rmdir@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"mknod-file\00"
@.str.1 = [13 x i8] c"mknod-device\00"
@.str.2 = [7 x i8] c"folder\00"
@.str.3 = [16 x i8] c"folder-readonly\00"
define void @cleanup() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @rmdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"mknod-file\00"
@.str.1 = [13 x i8] c"mknod-device\00"
@.str.2 = [7 x i8] c"folder\00"
@.str.3 = [16 x i8] c"folder-readonly\00"
define void @cleanup() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @rmdir(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int fgeti(FILE *file) {
  int res = fgetc(file) & 0xff;
  res |= (fgetc(file) << 8);
  res |= (fgetc(file) << 16);
  res |= (fgetc(file) << 24);
  return res;
}


x86 assembly (clang, -O0):
<fgeti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgeti>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <fgetc@plt>
movzbl %al,%ebx
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %ebx,%ebp
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r14,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fgeti(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @fgetc(i32* %7)
%9 = shl i32 %8, 8
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = call i32 @fgetc(i32* %12)
%14 = shl i32 %13, 16
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32*, i32** %2
%18 = call i32 @fgetc(i32* %17)
%19 = shl i32 %18, 24
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @fgeti(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = and i32 %2, 255
%4 = tail call i32 @fgetc(i32* %0)
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
%7 = tail call i32 @fgetc(i32* %0)
%8 = shl i32 %7, 16
%9 = or i32 %6, %8
%10 = tail call i32 @fgetc(i32* %0)
%11 = shl i32 %10, 24
%12 = or i32 %9, %11
ret i32 %12
}
/* Variables and functions */
size_t atomic_postsub_size_t(size_t *, int);
size_t atomic_postdec_size_t(size_t *var) {
  return atomic_postsub_size_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postdec_size_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postsub_size_t@plt>

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

LLVM IR (-O2):
define i64 @atomic_postdec_size_t(i64* %0) {
%2 = tail call i64 @atomic_postsub_size_t(i64* %0, i32 1)
ret i64 %2
}
/* Variables and functions */
int EOF;
int getchar();
int main(void) {
  int c;
  while ((c = getchar()) != EOF)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%eax
je     113d <main+0x2d>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%rbx),%eax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %1
5: ; preds = %1
ret i32 0
}
int test_imm_70int8_reg(signed char val) {
  return ((val) & (0x70 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_70int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x70,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_70int8_reg(i8 signext %0) {
%2 = and i8 %0, 112
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *task_function(void *arg) {
  printf("Thread [%d] done\n", (*(int *)arg));
  return NULL;
}


x86 assembly (clang, -O0):
<task_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"Thread [%d] done\0A\00"
define i8* @task_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* null
}

LLVM IR (-O2):
@.str = [18 x i8] c"Thread [%d] done\0A\00"
define noalias i8* @task_function(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
int binomialCoeff(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int n = 5, k = 2;
  printf("Value of C(%d, %d) is %d \n", n, k, binomialCoeff(n, k));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <binomialCoeff@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"Value of C(%d, %d) is %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @binomialCoeff(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Value of C(%d, %d) is %d \0A\00"
define i32 @main() {
%1 = tail call i32 @binomialCoeff(i32 5, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 5, i32 2, i32 %1)
ret i32 0
}
int fun1229() { return 1229; }


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

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

LLVM IR (-O0):
define i32 @fun1229() {
ret i32 1229
}

LLVM IR (-O2):
define i32 @fun1229() {
ret i32 1229
}
void RTVfsSymlinkQueryInfo(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsSymlinkQueryInfo() {
ret void
}
/* Variables and functions */
char *allocate_protected_space(int);
int /*<<< orphan*/ deallocate_protected_space(char *, int);
int /*<<< orphan*/ helisp_entry(char *);
int /*<<< orphan*/ print_ptr(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int stack_size = (16 * 4096);
  char *stack_top = allocate_protected_space(stack_size);
  char *stack_base = stack_top + stack_size;
  print_ptr(helisp_entry(stack_base));
  deallocate_protected_space(stack_top, stack_size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x10000,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <allocate_protected_space@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <helisp_entry@plt>
mov    %eax,%edi
call   1060 <print_ptr@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <deallocate_protected_space@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10000,%edi
call   1050 <allocate_protected_space@plt>
mov    %rax,%rbx
lea    0x10000(%rax),%rdi
call   1040 <helisp_entry@plt>
mov    %eax,%edi
call   1060 <print_ptr@plt>
mov    %rbx,%rdi
mov    $0x10000,%esi
call   1030 <deallocate_protected_space@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 65536, i32* %6
%9 = load i32, i32* %6
%10 = call i8* @allocate_protected_space(i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = call i32 @helisp_entry(i8* %15)
%17 = call i32 @print_ptr(i32 %16)
%18 = load i8*, i8** %7
%19 = load i32, i32* %6
%20 = call i32 @deallocate_protected_space(i8* %18, i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @allocate_protected_space(i32 65536)
%4 = getelementptr inbounds i8, i8* %3, i64 65536
%5 = tail call i32 @helisp_entry(i8* %4)
%6 = tail call i32 @print_ptr(i32 %5)
%7 = tail call i32 @deallocate_protected_space(i8* %3, i32 65536)
ret i32 0
}
/* Variables and functions */
scalar_t__ powf(float, int);
float sqrtf(scalar_t__);
float circular_out(float step, float max_steps, float max_val) {
  float ratio = (step - max_steps) / (max_steps - 1);
  return max_val * sqrtf(1 - powf(ratio, 2));
}


x86 assembly (clang, -O0):
<circular_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeb2(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_out>:
push   %rax
movss  %xmm2,0x4(%rsp)
subss  %xmm1,%xmm0
addss  0xecd(%rip),%xmm1
divss  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrtf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @circular_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fsub float %8, %9
%11 = load float, float* %5
%12 = fsub float %11, 1.000000e+00
%13 = fdiv float %10, %12
store float %13, float* %7
%14 = load float, float* %6
%15 = load float, float* %7
%16 = call i64 @powf(float %15, i32 2)
%17 = sub nsw i64 1, %16
%18 = call float @sqrtf(i64 %17)
%19 = fmul float %14, %18
ret float %19
}

LLVM IR (-O2):
define float @circular_out(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = fadd float %1, -1.000000e+00
%6 = fdiv float %4, %5
%7 = tail call i64 @powf(float %6, i32 2)
%8 = sub nsw i64 1, %7
%9 = tail call float @sqrtf(i64 %8)
%10 = fmul float %9, %2
ret float %10
}
int generate_hash(const char *name) {
  unsigned int hash = 5381;
  while (*name)
    hash = hash * 33 + (unsigned int)(*name++);
  return hash % 199;
}


x86 assembly (clang, -O0):
<generate_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <generate_hash+0x3c>
imul   $0x21,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <generate_hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0xc7,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <generate_hash+0x3d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <generate_hash+0x10>
mov    %eax,%ecx
imul   $0x5254e78f,%rcx,%rcx
shr    $0x26,%rcx
imul   $0xc7,%ecx,%ecx
sub    %ecx,%eax
ret
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @generate_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 5381, 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 %16
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul i32 %9, 33
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = add i32 %10, %14
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = urem i32 %17, 199
ret i32 %18
}

LLVM IR (-O2):
define i32 @generate_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 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %11, 199
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 8, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_seti(int);
void foo(int x) { __builtin_arc_seti(x); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <__builtin_arc_seti@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = tail call i32 @__builtin_arc_seti(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plintf(char *, int);
list_possibility(int il) { plintf("Choice %d \n", il); }


x86 assembly (clang, -O0):
<list_possibility>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <plintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Choice %d \0A\00"
define i32 @list_possibility(i32 %0) {
%2 = tail call i32 @plintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int munmap(void *adr, size_t size) {
  if (adr)
    free(adr);
  return 0;
}


x86 assembly (clang, -O0):
<munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <munmap+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munmap>:
test   %rdi,%rdi
je     111f <munmap+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @munmap(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int abs(int);
int isNear(int a, int b, int range) {
  if (abs(a - b) <= range)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isNear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
cmp    -0x10(%rbp),%eax
jg     1141 <isNear+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isNear+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNear>:
sub    %esi,%edi
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
cmp    %edx,%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @isNear(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = icmp sle i32 %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char const);
bool is_pos_num(const char *s) {
  for (const char *ptr = s; *ptr; ptr++) {
    if (!isdigit(*ptr)) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<is_pos_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <is_pos_num+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1152 <is_pos_num+0x42>
movl   $0x0,-0x4(%rbp)
jmp    116f <is_pos_num+0x5f>
jmp    1157 <is_pos_num+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <is_pos_num+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pos_num>:
push   %rbx
mov    (%rdi),%cl
test   %cl,%cl
je     1140 <is_pos_num+0x30>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %cl,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1137 <is_pos_num+0x27>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1120 <is_pos_num+0x10>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
jmp    1145 <is_pos_num+0x35>
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_pos_num(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4
%14 = xor i1 %11, true
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %17
}
int other() { return 2; }


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

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

LLVM IR (-O0):
define i32 @other() {
ret i32 2
}

LLVM IR (-O2):
define i32 @other() {
ret i32 2
}
__typeof__(strcpy(1, (void *)1)) test_strcpy_152(void) {
  return strcpy(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strcpy_152>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <strcpy@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test_strcpy_152() {
%1 = call i8* @strcpy(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_strcpy_152() {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
size_t ft_tab_size(const char **tab) {
  size_t ret;
  ret = 0;
  while (*(tab++))
    ++ret;
  return (ret);
}


x86 assembly (clang, -O0):
<ft_tab_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     113a <ft_tab_size+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_tab_size+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tab_size>:
cmpq   $0x0,(%rdi)
je     1120 <ft_tab_size+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <ft_tab_size+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @ft_tab_size(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = add i64 %5, 1
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
void print_method(struct vm_method *vmm) {}


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

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

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

LLVM IR (-O2):
%struct.vm_method = type opaque
define void @print_method(%struct.vm_method* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ abs(scalar_t__);
double difftime(time_t timer2, time_t timer1) {
  return (double)abs(timer2 - timer1);
}


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

x86 assembly (clang, -O2):
<difftime>:
sub    %rsi,%rdi
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @difftime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = call i64 @abs(i64 %7)
%9 = sitofp i64 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = tail call i64 @llvm.abs.i64(i64 %3, i1 true)
%5 = sitofp i64 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ done();
void handle_signal(int signal) { done(); }


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

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

LLVM IR (-O0):
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @done()
ret void
}

LLVM IR (-O2):
define void @handle_signal(i32 %0) {
%2 = tail call i32 (...) @done()
ret void
}