xunge/DecIR huggingface dataset:
void gtk_hscale_new_with_range() {}


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

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

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

LLVM IR (-O2):
define void @gtk_hscale_new_with_range() {
ret void
}
/* Variables and functions */
int which_bit(unsigned int const);
unsigned edge_index(const unsigned x) { return which_bit(x) - 1; }


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

x86 assembly (clang, -O2):
<edge_index>:
push   %rax
call   1030 <which_bit@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @edge_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @which_bit(i32 %3)
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @edge_index(i32 %0) {
%2 = tail call i32 @which_bit(i32 %0)
%3 = add nsw i32 %2, -1
ret i32 %3
}
char *strchr(const char *s, int c) {
  for (;;) {
    if (*s == c)
      return (char *)s;
    if (*s == 0)
      return 0;
    s++;
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1145 <strchr+0x45>
movq   $0x0,-0x8(%rbp)
jmp    1156 <strchr+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl (%rdi),%ecx
cmp    %esi,%ecx
je     1120 <strchr+0x20>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, %1
br i1 %5, label %15, label %6
6: ; preds = %2, %10
%7 = phi i8 [ %12, %10 ], [ %3, %2 ]
%8 = phi i8* [ %11, %10 ], [ %0, %2 ]
%9 = icmp eq i8 %7, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %6
15: ; preds = %10, %6, %2
%16 = phi i8* [ %0, %2 ], [ null, %6 ], [ %11, %10 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  (void)fprintf(stderr, "%s [-o name] file\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"%s [-o name] file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"%s [-o name] file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int config_bitstream_sync_header1_read(void) { return 2123999870; }


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

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

LLVM IR (-O0):
define i32 @config_bitstream_sync_header1_read() {
ret i32 2123999870
}

LLVM IR (-O2):
define i32 @config_bitstream_sync_header1_read() {
ret i32 2123999870
}
/* Variables and functions */
char *myString();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", myString());
  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   1040 <myString@plt>
mov    %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\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 i8* (...) @myString()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @myString()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_sink_port_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_sink_port_by_index"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"NOT IMPLEMENTED:pa_context_set_sink_port_by_index\0A\00"
define i32 @pa_context_set_sink_port_by_index() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [50 x i8] c"NOT IMPLEMENTED:pa_context_set_sink_port_by_index\00"
define i32 @pa_context_set_sink_port_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ tolower(int);
char Characters__tolower(char c) { return (char)tolower((int)c); }


x86 assembly (clang, -O0):
<Characters__tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Characters__tolower>:
push   %rax
call   1030 <tolower@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @Characters__tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i64 @tolower(i32 %4)
%6 = trunc i64 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @Characters__tolower(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i64 @tolower(i32 %2)
%4 = trunc i64 %3 to i8
ret i8 %4
}
long long test_llround(double x) { return __builtin_llround(x); }


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

x86 assembly (clang, -O2):
<test_llround>:
jmp    1030 <llround@plt>

LLVM IR (-O0):
define i64 @test_llround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @llround(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_llround(double %0) {
%2 = tail call i64 @llround(double %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
void processInput(fd_set *rdSet) {}


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

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

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

LLVM IR (-O2):
define void @processInput(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
int inet6_opt_set_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy((u_int8_t *)databuf + offset, val, vallen);
  return (offset + vallen);
}


x86 assembly (clang, -O0):
<inet6_opt_set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_set_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i32* %13, i8* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i32* %7, i8* %2, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct xdg_surface {
  int dummy;
};
struct wl_seat {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, struct wl_seat *,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
void xdg_surface_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat,
                        uint32_t serial, uint32_t edges) {
  wl_proxy_marshal((struct wl_proxy *)xdg_surface, 6, seat, serial, edges);
}


x86 assembly (clang, -O0):
<xdg_surface_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x6,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_surface_resize>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x6,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.xdg_surface = type { i32 }
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_resize(%struct.xdg_surface* %0, %struct.wl_seat* %1, i32 %2, i32 %3) {
%5 = alloca %struct.xdg_surface*
%6 = alloca %struct.wl_seat*
%7 = alloca i32
%8 = alloca i32
store %struct.xdg_surface* %0, %struct.xdg_surface** %5
store %struct.wl_seat* %1, %struct.wl_seat** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.xdg_surface*, %struct.xdg_surface** %5
%10 = bitcast %struct.xdg_surface* %9 to %struct.wl_proxy*
%11 = load %struct.wl_seat*, %struct.wl_seat** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %10, i32 6, %struct.wl_seat* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.xdg_surface = type { i32 }
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_resize(%struct.xdg_surface* %0, %struct.wl_seat* %1, i32 %2, i32 %3) {
%5 = bitcast %struct.xdg_surface* %0 to %struct.wl_proxy*
%6 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %5, i32 6, %struct.wl_seat* %1, i32 %2, i32 %3)
ret void
}
int reverseInteger(int val) {
  return (((val >> 24) & 0xff) | ((val >> 8) & 0xff00) |
          ((val << 8) & 0xff0000) | ((val << 24) & 0xff000000));
}


x86 assembly (clang, -O0):
<reverseInteger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseInteger>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @reverseInteger(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 65280
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 8
%12 = and i32 %11, 16711680
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = shl i32 %14, 24
%16 = and i32 %15, -16777216
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @reverseInteger(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void rd_close_file(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<rd_close_file>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @rd_close_file(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ one_racer(void *, int, int volatile *, int volatile *);
void proc_racer(void *p, int cpu, volatile int *mytrigger,
                volatile int *othertrigger) {
  exit(one_racer(p, cpu, mytrigger, othertrigger));
}


x86 assembly (clang, -O0):
<proc_racer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <one_racer@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<proc_racer>:
push   %rax
call   1030 <one_racer@plt>
mov    %eax,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @proc_racer(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @one_racer(i8* %0, i32 %1, i32* %2, i32* %3)
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int get1B(char *mem) { return (int)*mem; }


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

x86 assembly (clang, -O2):
<get1B>:
movsbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get1B(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x79() {
  Assert_real((isdigit(121) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              610, ("isdigit should be 0 for y"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for y\00"
define void @t_isdigit_0x79() {
%1 = call i64 @isdigit(i32 121)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for y\00"
define void @t_isdigit_0x79() {
%1 = tail call i64 @isdigit(i32 121)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int vpage_of_vaddr(int current_process, unsigned int vaddr) {
  return (vaddr >> 12) & 0xFFF;
}


x86 assembly (clang, -O0):
<vpage_of_vaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
and    $0xfff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpage_of_vaddr>:
mov    %esi,%eax
shr    $0xc,%eax
and    $0xfff,%eax
ret

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

LLVM IR (-O2):
define i32 @vpage_of_vaddr(i32 %0, i32 %1) {
%3 = lshr i32 %1, 12
%4 = and i32 %3, 4095
ret i32 %4
}
int *getNextContext(int *context) { return (int *)*context; }


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

x86 assembly (clang, -O2):
<getNextContext>:
movslq (%rdi),%rax
ret

LLVM IR (-O0):
define i32* @getNextContext(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}

LLVM IR (-O2):
define i32* @getNextContext(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
void CloseDevice(int devHandle) {}


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

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

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

LLVM IR (-O2):
define void @CloseDevice(i32 %0) {
ret void
}
void gtk_handle_box_get_snap_edge() {}


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

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

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

LLVM IR (-O2):
define void @gtk_handle_box_get_snap_edge() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *strsave(const char *str) { return strcpy(alloc(strlen(str) + 1), str); }


x86 assembly (clang, -O0):
<strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <alloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsave>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <alloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strsave(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @alloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @strsave(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @alloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
int log_verbose_opt(int /*<<< orphan*/ *, void *);
int log_set_verbose(int n) {
  if (n) {
    return log_verbose_opt(NULL, (void *)1);
  }
  return log_verbose_opt(NULL, (void *)0);
}


x86 assembly (clang, -O0):
<log_set_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113b <log_set_verbose+0x2b>
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <log_verbose_opt@plt>
mov    %eax,-0x4(%rbp)
jmp    114a <log_set_verbose+0x3a>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <log_verbose_opt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_set_verbose>:
test   %edi,%edi
je     1120 <log_set_verbose+0x10>
mov    $0x1,%esi
xor    %edi,%edi
jmp    1030 <log_verbose_opt@plt>
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <log_verbose_opt@plt>

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

LLVM IR (-O2):
define i32 @log_set_verbose(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @log_verbose_opt(i32* null, i8* inttoptr (i64 1 to i8*))
br label %7
5: ; preds = %1
%6 = tail call i32 @log_verbose_opt(i32* null, i8* null)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ printf(char *, int);
int main(void) {
  volatile struct stat s;
  int ret = 42;
  while (1)
    ret += printf("hello world: %d\n", ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2a,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    %ebp,%eax
mov    %eax,%ebp
jmp    1120 <main+0x10>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [17 x i8] c"hello world: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %3
br label %4
4: ; preds = %0, %4
%5 = load i32, i32* %3
%6 = call i64 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, %6
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
br label %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"hello world: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 42, %0 ], [ %5, %1 ]
%3 = tail call i64 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = trunc i64 %3 to i32
%5 = add i32 %2, %4
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isspace(int /*<<< orphan*/);
int iswspace(wint_t c) { return isspace(c); }


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

x86 assembly (clang, -O2):
<iswspace>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @iswspace(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
ret i32 %2
}
/* Type definitions */
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ext2fs_rb_set_parent(struct rb_node *, struct rb_node *);
void ext2fs_rb_clear_node(struct rb_node *node) {
  ext2fs_rb_set_parent(node, node);
}


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

x86 assembly (clang, -O2):
<ext2fs_rb_clear_node>:
mov    %rdi,%rsi
jmp    1030 <ext2fs_rb_set_parent@plt>

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

LLVM IR (-O2):
%struct.rb_node = type { i32 }
define void @ext2fs_rb_clear_node(%struct.rb_node* %0) {
%2 = tail call i32 @ext2fs_rb_set_parent(%struct.rb_node* %0, %struct.rb_node* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  system("./prog.py");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"./prog.py\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"./prog.py\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
main() {
  int i;
  2;
  int j;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pic16_program_verify();
int /*<<< orphan*/ pic16_write_panel_init();
void pic16_program_begin(void) {
  pic16_program_verify();
  pic16_write_panel_init();
}


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

x86 assembly (clang, -O2):
<pic16_program_begin>:
push   %rax
xor    %eax,%eax
call   1030 <pic16_program_verify@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pic16_write_panel_init@plt>

LLVM IR (-O0):
define void @pic16_program_begin() {
%1 = call i32 (...) @pic16_program_verify()
%2 = call i32 (...) @pic16_write_panel_init()
ret void
}

LLVM IR (-O2):
define void @pic16_program_begin() {
%1 = tail call i32 (...) @pic16_program_verify()
%2 = tail call i32 (...) @pic16_write_panel_init()
ret void
}
unsigned long mem_blk_get_uint32_null(const void *ext, unsigned long addr) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i64 @mem_blk_get_uint32_null(i8* nocapture readnone %0, i64 %1) {
ret i64 0
}
unsigned int ep93xx_chip_revision(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ep93xx_chip_revision() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void onKeyPressed(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
  default:
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<onKeyPressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114b <onKeyPressed+0x2b>
jmp    1144 <onKeyPressed+0x24>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    1150 <onKeyPressed+0x30>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onKeyPressed>:
cmp    $0x1b,%dil
je     112d <onKeyPressed+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @onKeyPressed(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @onKeyPressed(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LED_enc(unsigned char *, unsigned char const *, int);
void LED80_enc(unsigned char *input, const unsigned char *userkey) {
  LED_enc(input, userkey, 80);
}


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

x86 assembly (clang, -O2):
<LED80_enc>:
mov    $0x50,%edx
jmp    1030 <LED_enc@plt>

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

LLVM IR (-O2):
define void @LED80_enc(i8* %0, i8* %1) {
%3 = tail call i32 @LED_enc(i8* %0, i8* %1, i32 80)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __off_t;

/* Variables and functions */
void *mmap(void *__addr, size_t __len, int __prot, int __flags, int __fd,
           __off_t __offset) {
  return ((void *)-1);
}


x86 assembly (clang, -O0):
<mmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @mmap(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i8* inttoptr (i64 -1 to i8*)
}
/* Variables and functions */
unsigned long strtoul(char const *, char **, int);
int parse_unsigned(const char *start, const char *end, int *out) {
  char *endptr;
  unsigned long val = strtoul(start, &endptr, 10);
  if (endptr != end)
    return 0;
  *out = val;
  return 1;
}


x86 assembly (clang, -O0):
<parse_unsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1154 <parse_unsigned+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1167 <parse_unsigned+0x57>
mov    -0x30(%rbp),%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_unsigned>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
xor    %ecx,%ecx
cmp    %rbx,(%rsp)
jne    1137 <parse_unsigned+0x27>
mov    %eax,(%r14)
mov    $0x1,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @parse_unsigned(i8* %0, i8* readnone %1, i32* nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i64 @strtoul(i8* %0, i8** %4, i32 10)
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, %1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = trunc i64 %6 to i32
store i32 %10, i32* %2
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
double drand48();
double bench_drand(void) { return drand48() - 0.5; }


x86 assembly (clang, -O0):
<bench_drand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <drand48@plt>
movsd  0xedd(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_drand>:
push   %rax
xor    %eax,%eax
call   1030 <drand48@plt>
addsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bench_drand() {
%1 = call double (...) @drand48()
%2 = fsub double %1, 5.000000e-01
ret double %2
}

LLVM IR (-O2):
define double @bench_drand() {
%1 = tail call double (...) @drand48()
%2 = fadd double %1, -5.000000e-01
ret double %2
}
int main(void) {
  int ten = 10, twenty = 20;
  return (ten < twenty) + (ten < twenty) + (twenty < ten);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
%11 = zext i1 %10 to i32
%12 = add nsw i32 %7, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int close(int);
int close_output_file(int fd) {
  if (fd == 0)
    return 0;
  return close(fd);
}


x86 assembly (clang, -O0):
<close_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <close_output_file+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113c <close_output_file+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_output_file>:
test   %edi,%edi
je     1119 <close_output_file+0x9>
jmp    1030 <close@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @close_output_file(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
struct timeval gettm() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return now;
}


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

x86 assembly (clang, -O2):
<gettm>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @gettm() {
%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 i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @gettm() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}
int volesfera(int r) {
  int vol;
  vol = 4 / 3 * 3.141592654 * (r * r * r);
  return vol;
}


x86 assembly (clang, -O0):
<volesfera>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<volesfera>:
mov    %edi,%eax
imul   %edi,%eax
imul   %edi,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xeec(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @volesfera(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fmul double 0x400921FB54524550, %9
%11 = fptosi double %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @volesfera(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x400921FB54524550
%6 = fptosi double %5 to i32
ret i32 %6
}
int test_imm_FAuint8_mem(unsigned char *val) {
  return ((*val) & (0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FAuint8_mem>:
testb  $0xfa,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FAuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -6
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void f_omp_target_data(void) {
#pragma omp target data
  {
#pragma omp parallel
    ;
#pragma omp target
    ;
#pragma omp target data
    ;
#pragma omp target update to(i)
#pragma omp target data
    {
#pragma omp parallel
      ;
#pragma omp target
      ;
#pragma omp target data
      ;
#pragma omp target update to(i)
    }
  }
}


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

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

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

LLVM IR (-O2):
define void @f_omp_target_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printids(char *);
void *thr_fn(void *arg) {
  printids("new thread:");
  return (void *)0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"new thread:\00"
define i8* @thr_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printids(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [12 x i8] c"new thread:\00"
define noalias i8* @thr_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @printids(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
void chip_gpio_init(void) {}


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

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

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

LLVM IR (-O2):
define void @chip_gpio_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void display(int *ptr, int num) {
  int i;
  for (i = 0; i < num; i++)
    printf("%d\n", *(ptr + i));
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <display+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <display+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <display+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void batadv_bla_free(struct batadv_priv *bat_priv) {}


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

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

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

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