xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ is_delimiter(int /*<<< orphan*/);
int /*<<< orphan*/ peek(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void peek_expected_delimiter(FILE *in) {
  if (!is_delimiter(peek(in))) {
    fprintf(stderr, "character not followed by delimiter\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<peek_expected_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <peek@plt>
mov    %eax,%edi
call   1040 <is_delimiter@plt>
cmp    $0x0,%eax
jne    1184 <peek_expected_delimiter+0x44>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek_expected_delimiter>:
push   %rax
call   1030 <peek@plt>
mov    %eax,%edi
call   1040 <is_delimiter@plt>
test   %eax,%eax
je     1153 <peek_expected_delimiter+0x13>
pop    %rax
ret
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"character not followed by delimiter\0A\00"
define void @peek_expected_delimiter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @peek(i32* %3)
%5 = call i32 @is_delimiter(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"character not followed by delimiter\0A\00"
define void @peek_expected_delimiter(i32* %0) {
%2 = tail call i32 @peek(i32* %0)
%3 = tail call i32 @is_delimiter(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NetworkingLayer1Tests();
int /*<<< orphan*/ NetworkingLayer2Tests();
int /*<<< orphan*/ NetworkingLayer3Tests();
int /*<<< orphan*/ NetworkingLayer4Tests();
int /*<<< orphan*/ NetworkingLayer5Tests();
void NetworkingLayersTest() {
  NetworkingLayer1Tests();
  NetworkingLayer2Tests();
  NetworkingLayer3Tests();
  NetworkingLayer4Tests();
  NetworkingLayer5Tests();
}


x86 assembly (clang, -O0):
<NetworkingLayersTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <NetworkingLayer1Tests@plt>
mov    $0x0,%al
call   1060 <NetworkingLayer2Tests@plt>
mov    $0x0,%al
call   1050 <NetworkingLayer3Tests@plt>
mov    $0x0,%al
call   1030 <NetworkingLayer4Tests@plt>
mov    $0x0,%al
call   1070 <NetworkingLayer5Tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NetworkingLayersTest>:
push   %rax
xor    %eax,%eax
call   1040 <NetworkingLayer1Tests@plt>
xor    %eax,%eax
call   1060 <NetworkingLayer2Tests@plt>
xor    %eax,%eax
call   1050 <NetworkingLayer3Tests@plt>
xor    %eax,%eax
call   1030 <NetworkingLayer4Tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <NetworkingLayer5Tests@plt>

LLVM IR (-O0):
define void @NetworkingLayersTest() {
%1 = call i32 (...) @NetworkingLayer1Tests()
%2 = call i32 (...) @NetworkingLayer2Tests()
%3 = call i32 (...) @NetworkingLayer3Tests()
%4 = call i32 (...) @NetworkingLayer4Tests()
%5 = call i32 (...) @NetworkingLayer5Tests()
ret void
}

LLVM IR (-O2):
define void @NetworkingLayersTest() {
%1 = tail call i32 (...) @NetworkingLayer1Tests()
%2 = tail call i32 (...) @NetworkingLayer2Tests()
%3 = tail call i32 (...) @NetworkingLayer3Tests()
%4 = tail call i32 (...) @NetworkingLayer4Tests()
%5 = tail call i32 (...) @NetworkingLayer5Tests()
ret void
}
void SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter = [59 x i8] c"SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter\00"
define void @SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter = [59 x i8] c"SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter\00"
define void @SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @__func__.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
bool nrf52_errata_201(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_201() {
ret i32 0
}
void INTEGRITY_CHECK(int *r) { *r = 0; }


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

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

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

LLVM IR (-O2):
define void @INTEGRITY_CHECK(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int numa_run_on_node(int const);
int numanuma__set_thread_affinity(const int node) {
  if (node == ((int)-1)) {
    return numa_run_on_node(-1);
  }
  return numa_run_on_node(node);
}


x86 assembly (clang, -O0):
<numanuma__set_thread_affinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1137 <numanuma__set_thread_affinity+0x27>
mov    $0xffffffff,%edi
call   1030 <numa_run_on_node@plt>
mov    %eax,-0x4(%rbp)
jmp    1142 <numanuma__set_thread_affinity+0x32>
mov    -0x8(%rbp),%edi
call   1030 <numa_run_on_node@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numanuma__set_thread_affinity>:
jmp    1030 <numa_run_on_node@plt>

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

LLVM IR (-O2):
define i32 @numanuma__set_thread_affinity(i32 %0) {
%2 = tail call i32 @numa_run_on_node(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int dummy_xship(FILE *f, int filter, char *s, int len) {
  fwrite(s, 1, len, f);
  return len;
}


x86 assembly (clang, -O0):
<dummy_xship>:
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    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_xship>:
push   %rbx
mov    %ecx,%ebx
mov    %rdi,%rcx
mov    %rdx,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <fwrite@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dummy_xship(i32* nocapture %0, i32 %1, i8* nocapture %2, i32 returned %3) {
%5 = tail call i32 @fwrite(i8* %2, i32 1, i32 %3, i32* %0)
ret i32 %3
}
void foo256(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo256(i32 %0) {
ret void
}
/* Type definitions */
typedef unsigned char wint_t;

/* Variables and functions */
int isalpha(unsigned char);
int __iswalpha_ascii(wint_t c) {
  return (((unsigned char)c == c) ? isalpha(c) : 0);
}


x86 assembly (clang, -O0):
<__iswalpha_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <__iswalpha_ascii+0x2f>
movzbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
mov    %eax,-0x8(%rbp)
jmp    1149 <__iswalpha_ascii+0x39>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <__iswalpha_ascii+0x39>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswalpha_ascii>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @__iswalpha_ascii(i8 zeroext %0) {
%2 = tail call i32 @isalpha(i8 zeroext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ thread_relinquish();
void thread1(void) {
  static int i = 0;
  for (;;) {
    printf("thread1 %d\n", i++);
    thread_relinquish();
  }
}


x86 assembly (clang, -O0):
<thread1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    112d <thread1+0xd>
mov    0x2f01(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,0x2ef3(%rip)
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <thread_relinquish@plt>
jmp    112d <thread1+0xd>

x86 assembly (clang, -O2):
<thread1>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x2efe(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2ef5(%rip)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <thread_relinquish@plt>
jmp    1130 <thread1+0x10>

LLVM IR (-O0):
@thread1.i = internal global i32 0
@.str = [12 x i8] c"thread1 %d\0A\00"
define void @thread1() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @thread1.i
%3 = add nsw i32 %2, 1
store i32 %3, i32* @thread1.i
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = call i32 (...) @thread_relinquish()
br label %1
}

LLVM IR (-O2):
@thread1.i = internal unnamed_addr global i32 0
@.str = [12 x i8] c"thread1 %d\0A\00"
define void @thread1() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @thread1.i
%3 = add nsw i32 %2, 1
store i32 %3, i32* @thread1.i
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 (...) @thread_relinquish()
br label %1
}
void g_trash_stack_push() {}


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

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

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

LLVM IR (-O2):
define void @g_trash_stack_push() {
ret void
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long get_milliseconds() {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) != 0)
    return 0;
  return (unsigned long)((tv.tv_sec * 1000ul) + (tv.tv_usec / 1000ul));
}


x86 assembly (clang, -O0):
<get_milliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     113c <get_milliseconds+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1164 <get_milliseconds+0x54>
imul   $0x3e8,-0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_milliseconds>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
jne    114e <get_milliseconds+0x3e>
imul   $0x3e8,(%rsp),%rcx
mov    0x8(%rsp),%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
mov    %rdx,%rbx
shr    $0x4,%rbx
add    %rcx,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @get_milliseconds() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i64 0, i64* %1
br label %14
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul i64 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%11 = load i64, i64* %10
%12 = udiv i64 %11, 1000
%13 = add i64 %9, %12
store i64 %13, i64* %1
br label %14
14: ; preds = %6, %5
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @get_milliseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = udiv i64 %10, 1000
%12 = add i64 %11, %8
br label %13
13: ; preds = %0, %5
%14 = phi i64 [ %12, %5 ], [ 0, %0 ]
ret i64 %14
}
void gtk_dialog_set_alternative_button_order() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_weight_wxh(int /*<<< orphan*/ *, int,
                                        int /*<<< orphan*/ *, int, int, int,
                                        int);
void pixel_avg_weight_2x4(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                          int i_stride_pix2, int i_weight1) {
  pixel_avg_weight_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 2, 4,
                       i_weight1);
}


x86 assembly (clang, -O0):
<pixel_avg_weight_2x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x2,%r8d
mov    $0x4,%r9d
mov    %eax,(%rsp)
call   1030 <pixel_avg_weight_wxh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_weight_2x4>:
push   %rax
mov    %r8d,(%rsp)
mov    $0x2,%r8d
mov    $0x4,%r9d
call   1030 <pixel_avg_weight_wxh@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pixel_avg_weight_2x4(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @pixel_avg_weight_wxh(i32* %11, i32 %12, i32* %13, i32 %14, i32 2, i32 4, i32 %15)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_weight_2x4(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @pixel_avg_weight_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 2, i32 4, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xe9() {
  Assert_real((isspace(233) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1170, ("isspace should be 0 for 0xe9"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xe9\00"
define void @t_isspace_0xe9() {
%1 = call i64 @isspace(i32 233)
%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 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xe9\00"
define void @t_isspace_0xe9() {
%1 = tail call i64 @isspace(i32 233)
%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 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void ARpintf_Update(double char2print) {
  printf("char2print = %f\n", char2print);
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"char2print = %f\0A\00"
define void @ARpintf_Update(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBDevAddrSet(uint32_t ui32Base, uint32_t ui32Address) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000000))) = (uint8_t)ui32Address;
}


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

x86 assembly (clang, -O2):
<USBDevAddrSet>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @USBDevAddrSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 0
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @USBDevAddrSet(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_brightness(int /*<<< orphan*/);
void zero_brightness() { set_brightness(0); }


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

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

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

LLVM IR (-O2):
define void @zero_brightness() {
%1 = tail call i32 @set_brightness(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_accu();
int /*<<< orphan*/ e_lsr();
int /*<<< orphan*/ e_writeback();
void e_lsr_accu() {
  e_accu();
  e_lsr();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_lsr_accu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <e_accu@plt>
mov    $0x0,%al
call   1050 <e_lsr@plt>
mov    $0x0,%al
call   1040 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_lsr_accu>:
push   %rax
xor    %eax,%eax
call   1030 <e_accu@plt>
xor    %eax,%eax
call   1050 <e_lsr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_writeback@plt>

LLVM IR (-O0):
define void @e_lsr_accu() {
%1 = call i32 (...) @e_accu()
%2 = call i32 (...) @e_lsr()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_lsr_accu() {
%1 = tail call i32 (...) @e_accu()
%2 = tail call i32 (...) @e_lsr()
%3 = tail call i32 (...) @e_writeback()
ret void
}
void dummy_times() {}


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

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

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

LLVM IR (-O2):
define void @dummy_times() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_quaddobl_container_to_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(268, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_container_to_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x10c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_container_to_start_solutions>:
mov    $0x10c,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_container_to_start_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 268, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_container_to_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 268, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void foo_1_1_2_2_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_2_1_1_2() {
ret void
}
void lw6sys_signal_segv_handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @lw6sys_signal_segv_handler(i32 %0) {
ret void
}
float *vec2_one(float *result) {
  result[0] = 1.0f;
  result[1] = 1.0f;
  return result;
}


x86 assembly (clang, -O0):
<vec2_one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xedc(%rip),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_one>:
mov    %rdi,%rax
movabs $0x3f8000003f800000,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define float* @vec2_one(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 1.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 1.000000e+00, float* %6
%7 = load float*, float** %2
ret float* %7
}

LLVM IR (-O2):
define float* @vec2_one(float* returned writeonly %0) {
store float 1.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 1.000000e+00, float* %2
ret float* %0
}
/* Variables and functions */
scalar_t__ lowbit(int);
void update(int *c, int pos, int num) {
  while (pos <= c[0]) {
    c[pos] += num;
    pos += lowbit(pos);
  }
}


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jg     115c <update+0x4c>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%edi
call   1030 <lowbit@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
jmp    1122 <update+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,(%rdi)
jl     1134 <update+0x24>
mov    %edx,%r14d
mov    %esi,%eax
mov    %rdi,%rbx
movslq %eax,%rbp
add    %r14d,(%rbx,%rbp,4)
mov    %ebp,%edi
call   1030 <lowbit@plt>
add    %ebp,%eax
cmp    (%rbx),%eax
jle    1120 <update+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @update(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %13, %3
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = icmp sle i32 %8, %11
br i1 %12, label %13, label %27
13: ; preds = %7
%14 = load i32, i32* %6
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, %14
store i32 %20, i32* %18
%21 = load i32, i32* %5
%22 = call i64 @lowbit(i32 %21)
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = add nsw i64 %24, %22
%26 = trunc i64 %25 to i32
store i32 %26, i32* %5
br label %7
27: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @update(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, %1
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %14, %6 ], [ %1, %3 ]
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %2
store i32 %11, i32* %9
%12 = tail call i64 @lowbit(i32 %7)
%13 = trunc i64 %12 to i32
%14 = add i32 %7, %13
%15 = load i32, i32* %0
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %6
17: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned long jbg_ceil_half(unsigned long x, int n) {
  unsigned long mask;
  assert(n >= 0 && n < 32);
  mask = (1UL << n) - 1;
  return (x >> n) + ((mask & x) != 0);
}


x86 assembly (clang, -O0):
<jbg_ceil_half>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x19(%rbp)
jl     1138 <jbg_ceil_half+0x28>
cmpl   $0x20,-0xc(%rbp)
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    %cl,%rax
mov    -0x18(%rbp),%rcx
and    -0x8(%rbp),%rcx
cmp    $0x0,%rcx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jbg_ceil_half>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x20,%esi
setb   %dil
call   1030 <assert@plt>
mov    $0xffffffffffffffff,%rax
mov    %ebp,%ecx
shl    %cl,%rax
not    %rax
and    %rbx,%rax
shr    %cl,%rbx
cmp    $0x1,%rax
sbb    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @jbg_ceil_half(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 32
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ false, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = shl i64 1, %16
%18 = sub i64 %17, 1
store i64 %18, i64* %5
%19 = load i64, i64* %3
%20 = load i32, i32* %4
%21 = zext i32 %20 to i64
%22 = lshr i64 %19, %21
%23 = load i64, i64* %5
%24 = load i64, i64* %3
%25 = and i64 %23, %24
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i32
%28 = sext i32 %27 to i64
%29 = add i64 %22, %28
ret i64 %29
}

LLVM IR (-O2):
define i64 @jbg_ceil_half(i64 %0, i32 %1) {
%3 = icmp ult i32 %1, 32
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = zext i32 %1 to i64
%7 = shl nsw i64 -1, %6
%8 = xor i64 %7, -1
%9 = lshr i64 %0, %6
%10 = and i64 %8, %0
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = add i64 %9, %12
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_system_from_baserock_update_dependencies() {
  printf("test_system_from_baserock_update_dependencies...");
  printf("Ok\n");
}


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

x86 assembly (clang, -O2):
<test_system_from_baserock_update_dependencies>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"test_system_from_baserock_update_dependencies...\00"
@.str.1 = [4 x i8] c"Ok\0A\00"
define void @test_system_from_baserock_update_dependencies() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"test_system_from_baserock_update_dependencies...\00"
@str = [3 x i8] c"Ok\00"
define void @test_system_from_baserock_update_dependencies() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void sig_ok(int signo) {
  static unsigned long i = 0;
  printf("%ld\n", i++);
}


x86 assembly (clang, -O0):
<sig_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0e(%rip),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,0x2f00(%rip)
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_ok>:
mov    0x2f19(%rip),%rsi
lea    0x1(%rsi),%rax
mov    %rax,0x2f0e(%rip)
lea    0xed7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@sig_ok.i = internal global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define void @sig_ok(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64, i64* @sig_ok.i
%4 = add i64 %3, 1
store i64 %4, i64* @sig_ok.i
%5 = trunc i64 %3 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@sig_ok.i = internal unnamed_addr global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define void @sig_ok(i32 %0) {
%2 = load i64, i64* @sig_ok.i
%3 = add i64 %2, 1
store i64 %3, i64* @sig_ok.i
%4 = trunc i64 %2 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
double pow(double, double);
double pow_wrapper(double *arg_list) { return (pow(arg_list[0], arg_list[1])); }


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

x86 assembly (clang, -O2):
<pow_wrapper>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @pow_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = call double @pow(double %5, double %8)
ret double %9
}

LLVM IR (-O2):
define double @pow_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = tail call double @pow(double %2, double %4)
ret double %5
}
void pd_set_host_mode(int port, int enable) {}


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

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

LLVM IR (-O0):
define void @pd_set_host_mode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @pd_set_host_mode(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
char *memchr(char const *, char, int);
char *find_char_or_end(const char *string, char needle, const char *end) {
  char *s = memchr(string, needle, end - string);
  return s ? s : (char *)end;
}


x86 assembly (clang, -O0):
<find_char_or_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
mov    %ecx,%edx
movsbl %al,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115e <find_char_or_end+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1166 <find_char_or_end+0x56>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_char_or_end>:
push   %rbx
mov    %rdx,%rbx
sub    %edi,%edx
call   1030 <memchr@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @find_char_or_end(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
%16 = call i8* @memchr(i8* %8, i8 signext %9, i32 %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %3
%20 = load i8*, i8** %7
br label %23
21: ; preds = %3
%22 = load i8*, i8** %6
br label %23
23: ; preds = %21, %19
%24 = phi i8* [ %20, %19 ], [ %22, %21 ]
ret i8* %24
}

LLVM IR (-O2):
define i8* @find_char_or_end(i8* %0, i8 signext %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = tail call i8* @memchr(i8* %0, i8 signext %1, i32 %7)
%9 = icmp eq i8* %8, null
%10 = select i1 %9, i8* %2, i8* %8
ret i8* %10
}
/* Type definitions */
typedef int uint_fast32_t;
typedef int uint8_t;

/* Variables and functions */
void _a16be(uint8_t *d, uint_fast32_t val) {
  d[0] = val >> 8;
  d[1] = val;
}


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

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

LLVM IR (-O0):
define void @_a16be(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 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @_a16be(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void begin(void) {
  printf("###\n");
  printf("### Auto-generated with ld_preload-get-vars.so\n");
  printf("###\n\n");
}


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

x86 assembly (clang, -O2):
<begin>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"###\0A\00"
@.str.1 = [48 x i8] c"### Auto-generated with ld_preload-get-vars.so\0A\00"
@.str.2 = [6 x i8] c"###\0A\0A\00"
define void @begin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"###\00"
@str.3 = [47 x i8] c"### Auto-generated with ld_preload-get-vars.so\00"
@str.4 = [5 x i8] c"###\0A\00"
define void @begin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tokenizer_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tokenizer_state *);
void end_tokenizer(struct tokenizer_state *tstate) { free(tstate); }


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

x86 assembly (clang, -O2):
<end_tokenizer>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.tokenizer_state = type { i32 }
define void @end_tokenizer(%struct.tokenizer_state* nocapture %0) {
%2 = tail call i32 @free(%struct.tokenizer_state* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_touch {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t wl_touch_get_version(struct wl_touch *wl_touch) {
  return wl_proxy_get_version((struct wl_proxy *)wl_touch);
}


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

x86 assembly (clang, -O2):
<wl_touch_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_touch = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_touch_get_version(%struct.wl_touch* %0) {
%2 = alloca %struct.wl_touch*
store %struct.wl_touch* %0, %struct.wl_touch** %2
%3 = load %struct.wl_touch*, %struct.wl_touch** %2
%4 = bitcast %struct.wl_touch* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_touch = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_touch_get_version(%struct.wl_touch* %0) {
%2 = bitcast %struct.wl_touch* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
/* Variables and functions */
float computeVelocity(float, int);
int /*<<< orphan*/ displayResults(float);
float duration(int, float, double);
float getDuration();
int main(void) {
  float retrDuration = getDuration();
  float velocity = computeVelocity(retrDuration, 4791);
  float estimatedDuration = duration(4791, velocity, 89.6);
  displayResults(estimatedDuration);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getDuration@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x12b7,%edi
call   1030 <computeVelocity@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    $0x12b7,%edi
movsd  0xe7f(%rip),%xmm1
call   1050 <duration@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1060 <displayResults@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getDuration@plt>
mov    $0x12b7,%edi
call   1030 <computeVelocity@plt>
movsd  0xea6(%rip),%xmm1
mov    $0x12b7,%edi
call   1050 <duration@plt>
call   1060 <displayResults@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call float (...) @getDuration()
store float %5, float* %2
%6 = load float, float* %2
%7 = call float @computeVelocity(float %6, i32 4791)
store float %7, float* %3
%8 = load float, float* %3
%9 = call float @duration(i32 4791, float %8, double 8.960000e+01)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @displayResults(float %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @getDuration()
%2 = tail call float @computeVelocity(float %1, i32 4791)
%3 = tail call float @duration(i32 4791, float %2, double 8.960000e+01)
%4 = tail call i32 @displayResults(float %3)
ret i32 0
}
/* Type definitions */
struct wlist_t {
  int dummy;
};

/* Variables and functions */
struct wlist_t *wlist_load(char *filename) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.wlist_t = type { i32 }
define %struct.wlist_t* @wlist_load(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.wlist_t* null
}

LLVM IR (-O2):
%struct.wlist_t = type { i32 }
define noalias %struct.wlist_t* @wlist_load(i8* nocapture readnone %0) {
ret %struct.wlist_t* null
}
struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) {
  return desc;
}


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

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

LLVM IR (-O0):
%struct.irq_desc = type opaque
define %struct.irq_desc* @move_irq_desc(%struct.irq_desc* %0, i32 %1) {
%3 = alloca %struct.irq_desc*
%4 = alloca i32
store %struct.irq_desc* %0, %struct.irq_desc** %3
store i32 %1, i32* %4
%5 = load %struct.irq_desc*, %struct.irq_desc** %3
ret %struct.irq_desc* %5
}

LLVM IR (-O2):
%struct.irq_desc = type opaque
define %struct.irq_desc* @move_irq_desc(%struct.irq_desc* readnone returned %0, i32 %1) {
ret %struct.irq_desc* %0
}
double fmax(double a, double b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}