xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ crAlloc(int);
int /*<<< orphan*/ crMemcpy(char *, char const *, int);
int crStrlen(char const *);
char *crStrdup(const char *str) {
  int len;
  char *ret;
  if (str == NULL)
    return NULL;
  len = crStrlen(str);
  ret = (char *)crAlloc(len + 1);
  crMemcpy(ret, str, len);
  ret[len] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<crStrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <crStrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1193 <crStrdup+0x63>
mov    -0x10(%rbp),%rdi
call   1050 <crStrlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1030 <crAlloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <crMemcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crStrdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1168 <crStrdup+0x38>
mov    %rdi,%r14
call   1050 <crStrlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1030 <crAlloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <crMemcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
jmp    116a <crStrdup+0x3a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @crStrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @crStrlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @crAlloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @crMemcpy(i8* %7, i8* %0, i32 %4)
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %1, %3
%12 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ mu_init(char *);
int /*<<< orphan*/ test_power_of_2_prime();
int /*<<< orphan*/ test_power_of_2_uint16();
int /*<<< orphan*/ test_power_of_2_uint8();
int main(void) {
  mu_init("common");
  test_power_of_2_uint8();
  test_power_of_2_uint16();
  test_power_of_2_prime();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <mu_init@plt>
mov    $0x0,%al
call   1050 <test_power_of_2_uint8@plt>
mov    $0x0,%al
call   1030 <test_power_of_2_uint16@plt>
mov    $0x0,%al
call   1060 <test_power_of_2_prime@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <mu_init@plt>
xor    %eax,%eax
call   1050 <test_power_of_2_uint8@plt>
xor    %eax,%eax
call   1030 <test_power_of_2_uint16@plt>
xor    %eax,%eax
call   1060 <test_power_of_2_prime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"common\00"
define i32 @main() {
%1 = call i32 @mu_init(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_power_of_2_uint8()
%3 = call i32 (...) @test_power_of_2_uint16()
%4 = call i32 (...) @test_power_of_2_prime()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"common\00"
define i32 @main() {
%1 = tail call i32 @mu_init(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test_power_of_2_uint8()
%3 = tail call i32 (...) @test_power_of_2_uint16()
%4 = tail call i32 (...) @test_power_of_2_prime()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help_info(void) {
  printf("%s\n",
         "Usage: "
         "gxtmaker"
         " [options] file\n\nOptions:\n    --help      show this help menu and "
         "exit\n    --version   display program version information and exit");
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [147 x i8] c"Usage: gxtmaker [options] file\0A\0AOptions:\0A --help show this help menu and exit\0A --version display program version information and exit\00"
define void @show_help_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [147 x i8] c"Usage: gxtmaker [options] file\0A\0AOptions:\0A --help show this help menu and exit\0A --version display program version information and exit\00"
define void @show_help_info() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int fibo(unsigned int n) {
  if (n < 2) {
    return (n);
  } else {
    return fibo(n - 1) + fibo(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jae    1130 <fibo+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibo+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fibo+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fibo+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ install_pmcl_exception_handlers();
int /*<<< orphan*/ x86_early_exception_init();
void exception_init() {
  x86_early_exception_init();
  install_pmcl_exception_handlers();
}


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

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

LLVM IR (-O0):
define void @exception_init() {
%1 = call i32 (...) @x86_early_exception_init()
%2 = call i32 (...) @install_pmcl_exception_handlers()
ret void
}

LLVM IR (-O2):
define void @exception_init() {
%1 = tail call i32 (...) @x86_early_exception_init()
%2 = tail call i32 (...) @install_pmcl_exception_handlers()
ret void
}
/* Type definitions */
struct lk_hlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LK_HLIST_NODE(struct lk_hlist_node *);
int /*<<< orphan*/ __lk_hlist_del(struct lk_hlist_node *);
int /*<<< orphan*/ lk_hlist_unhashed(struct lk_hlist_node *);
void lk_hlist_del_init(struct lk_hlist_node *n) {
  if (!lk_hlist_unhashed(n)) {
    __lk_hlist_del(n);
    INIT_LK_HLIST_NODE(n);
  }
}


x86 assembly (clang, -O0):
<lk_hlist_del_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lk_hlist_unhashed@plt>
cmp    $0x0,%eax
jne    1160 <lk_hlist_del_init+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <__lk_hlist_del@plt>
mov    -0x8(%rbp),%rdi
call   1050 <INIT_LK_HLIST_NODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lk_hlist_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <lk_hlist_unhashed@plt>
test   %eax,%eax
je     113f <lk_hlist_del_init+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <__lk_hlist_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <INIT_LK_HLIST_NODE@plt>

LLVM IR (-O0):
%struct.lk_hlist_node = type { i32 }
define void @lk_hlist_del_init(%struct.lk_hlist_node* %0) {
%2 = alloca %struct.lk_hlist_node*
store %struct.lk_hlist_node* %0, %struct.lk_hlist_node** %2
%3 = load %struct.lk_hlist_node*, %struct.lk_hlist_node** %2
%4 = call i32 @lk_hlist_unhashed(%struct.lk_hlist_node* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load %struct.lk_hlist_node*, %struct.lk_hlist_node** %2
%8 = call i32 @__lk_hlist_del(%struct.lk_hlist_node* %7)
%9 = load %struct.lk_hlist_node*, %struct.lk_hlist_node** %2
%10 = call i32 @INIT_LK_HLIST_NODE(%struct.lk_hlist_node* %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.lk_hlist_node = type { i32 }
define void @lk_hlist_del_init(%struct.lk_hlist_node* %0) {
%2 = tail call i32 @lk_hlist_unhashed(%struct.lk_hlist_node* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @__lk_hlist_del(%struct.lk_hlist_node* %0)
%6 = tail call i32 @INIT_LK_HLIST_NODE(%struct.lk_hlist_node* %0)
br label %7
7: ; preds = %4, %1
ret void
}
main() {
  sys$testcode();
  sys$testcode2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sys$testcode@plt>
mov    $0x0,%al
call   1040 <sys$testcode2@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sys$testcode@plt>
xor    %eax,%eax
call   1040 <sys$testcode2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @"sys$testcode"()
%2 = call i32 (...) @"sys$testcode2"()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @"sys$testcode"()
%2 = tail call i32 (...) @"sys$testcode2"()
ret i32 0
}
int test_imm_85uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x85 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_85uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x85,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_85uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 133
%7 = icmp ne i64 %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_85uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8716288
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct pollfd {
  int dummy;
};
struct _session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msglog(int, char *, int);
int stop_session(int, struct pollfd *, struct pollfd *, struct _session *);
int outer_connect_failed(int sesno, struct pollfd *in_fd, struct pollfd *out_fd,
                         struct _session *sess) {
  msglog(1, "[%i.?] <connect failed>\n", sesno);
  return stop_session(sesno, in_fd, out_fd, sess);
}


x86 assembly (clang, -O0):
<outer_connect_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xeba(%rip),%rsi
call   1030 <msglog@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <stop_session@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outer_connect_failed>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec7(%rip),%rsi
mov    $0x1,%edi
mov    %ebp,%edx
call   1030 <msglog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <stop_session@plt>

LLVM IR (-O0):
%struct.pollfd = type { i32 }
%struct._session = type { i32 }
@.str = [25 x i8] c"[%i.?] <connect failed>\0A\00"
define i32 @outer_connect_failed(i32 %0, %struct.pollfd* %1, %struct.pollfd* %2, %struct._session* %3) {
%5 = alloca i32
%6 = alloca %struct.pollfd*
%7 = alloca %struct.pollfd*
%8 = alloca %struct._session*
store i32 %0, i32* %5
store %struct.pollfd* %1, %struct.pollfd** %6
store %struct.pollfd* %2, %struct.pollfd** %7
store %struct._session* %3, %struct._session** %8
%9 = load i32, i32* %5
%10 = call i32 @msglog(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %5
%12 = load %struct.pollfd*, %struct.pollfd** %6
%13 = load %struct.pollfd*, %struct.pollfd** %7
%14 = load %struct._session*, %struct._session** %8
%15 = call i32 @stop_session(i32 %11, %struct.pollfd* %12, %struct.pollfd* %13, %struct._session* %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
%struct._session = type { i32 }
@.str = [25 x i8] c"[%i.?] <connect failed>\0A\00"
define i32 @outer_connect_failed(i32 %0, %struct.pollfd* %1, %struct.pollfd* %2, %struct._session* %3) {
%5 = tail call i32 @msglog(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @stop_session(i32 %0, %struct.pollfd* %1, %struct.pollfd* %2, %struct._session* %3)
ret i32 %6
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fstat(int _fd, struct stat *_sbuf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
void rewind(FILE *stream) {
  clearerr(stream);
  fseek(stream, 0L, SEEK_SET);
}


x86 assembly (clang, -O0):
<rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <clearerr@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind>:
push   %rbx
mov    %rdi,%rbx
call   1030 <clearerr@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @clearerr(i32* %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* @SEEK_SET
%7 = call i32 @fseek(i32* %5, i64 0, i32 %6)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @rewind(i32* nocapture %0) {
%2 = tail call i32 @clearerr(i32* %0)
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ k_run_test_array();
int /*<<< orphan*/ k_run_test_kick();
int /*<<< orphan*/ k_run_test_len();
int /*<<< orphan*/ k_run_test_v();
int /*<<< orphan*/ k_run_test_variable();
void k_run_test() {
  k_run_test_len();
  k_run_test_kick();
  k_run_test_variable();
  k_run_test_array();
  k_run_test_v();
}


x86 assembly (clang, -O0):
<k_run_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <k_run_test_len@plt>
mov    $0x0,%al
call   1060 <k_run_test_kick@plt>
mov    $0x0,%al
call   1070 <k_run_test_variable@plt>
mov    $0x0,%al
call   1030 <k_run_test_array@plt>
mov    $0x0,%al
call   1050 <k_run_test_v@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_run_test>:
push   %rax
xor    %eax,%eax
call   1040 <k_run_test_len@plt>
xor    %eax,%eax
call   1060 <k_run_test_kick@plt>
xor    %eax,%eax
call   1070 <k_run_test_variable@plt>
xor    %eax,%eax
call   1030 <k_run_test_array@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <k_run_test_v@plt>

LLVM IR (-O0):
define void @k_run_test() {
%1 = call i32 (...) @k_run_test_len()
%2 = call i32 (...) @k_run_test_kick()
%3 = call i32 (...) @k_run_test_variable()
%4 = call i32 (...) @k_run_test_array()
%5 = call i32 (...) @k_run_test_v()
ret void
}

LLVM IR (-O2):
define void @k_run_test() {
%1 = tail call i32 (...) @k_run_test_len()
%2 = tail call i32 (...) @k_run_test_kick()
%3 = tail call i32 (...) @k_run_test_variable()
%4 = tail call i32 (...) @k_run_test_array()
%5 = tail call i32 (...) @k_run_test_v()
ret void
}
void XkbFreeGeomOverlayKeys() {}


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

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

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

LLVM IR (-O2):
define void @XkbFreeGeomOverlayKeys() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puti(long);
void putsiu(unsigned short int x) { puti((long int)x); }


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

x86 assembly (clang, -O2):
<putsiu>:
mov    %edi,%edi
jmp    1030 <puti@plt>

LLVM IR (-O0):
define void @putsiu(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i64
%5 = call i32 @puti(i64 %4)
ret void
}

LLVM IR (-O2):
define void @putsiu(i16 zeroext %0) {
%2 = zext i16 %0 to i64
%3 = tail call i32 @puti(i64 %2)
ret void
}
/* Variables and functions */
void *memCalloc(int, size_t);
void *memAlloc(size_t size) { return (memCalloc(1, size)); }


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

x86 assembly (clang, -O2):
<memAlloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <memCalloc@plt>

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

LLVM IR (-O2):
define i8* @memAlloc(i64 %0) {
%2 = tail call i8* @memCalloc(i32 1, i64 %0)
ret i8* %2
}
int ft_abs(int n) {
  if (n < 0)
    n *= -1;
  return (n);
}


x86 assembly (clang, -O0):
<ft_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <ft_abs+0x18>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, -1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @ft_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void game_of_life(int **board, int N, int M, int steps, int **final_board) {}


x86 assembly (clang, -O0):
<game_of_life>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @game_of_life(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
ret void
}

LLVM IR (-O2):
define void @game_of_life(i32** nocapture %0, i32 %1, i32 %2, i32 %3, i32** nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sha1_key_internal(void *, unsigned char *, int);
void sha1_key(void *handle, unsigned char *key) {
  sha1_key_internal(handle, key, 20);
}


x86 assembly (clang, -O0):
<sha1_key>:
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    $0x14,%edx
call   1030 <sha1_key_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha1_key>:
mov    $0x14,%edx
jmp    1030 <sha1_key_internal@plt>

LLVM IR (-O0):
define void @sha1_key(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 @sha1_key_internal(i8* %5, i8* %6, i32 20)
ret void
}

LLVM IR (-O2):
define void @sha1_key(i8* %0, i8* %1) {
%3 = tail call i32 @sha1_key_internal(i8* %0, i8* %1, i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void show_usage(const char *exe) {
  printf("Usage: %s <thread-limit> <directory>\n", exe);
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: %s <thread-limit> <directory>\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Usage: %s <thread-limit> <directory>\0A\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *sbrk(int);
int test_sbrk_sigsegv(void) {
  void *unaligned = sbrk(0);
  sbrk(((intptr_t)unaligned + 0xfff) & -0x1000);
  void *ptr = sbrk(0x2000);
  sbrk(-0x2000);
  int data = *((volatile int *)(ptr + 0x1000));
  (void)data;
  return 1;
}


x86 assembly (clang, -O0):
<test_sbrk_sigsegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1030 <sbrk@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfff,%rax
and    $0xfffffffffffff000,%rax
mov    %eax,%edi
call   1030 <sbrk@plt>
mov    $0x2000,%edi
call   1030 <sbrk@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffe000,%edi
call   1030 <sbrk@plt>
mov    -0x10(%rbp),%rax
mov    0x1000(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sbrk_sigsegv>:
push   %rbx
xor    %edi,%edi
call   1030 <sbrk@plt>
lea    0xfff(%rax),%edi
and    $0xfffff000,%edi
call   1030 <sbrk@plt>
mov    $0x2000,%edi
call   1030 <sbrk@plt>
mov    %rax,%rbx
mov    $0xffffe000,%edi
call   1030 <sbrk@plt>
mov    0x1000(%rbx),%eax
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_sbrk_sigsegv() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = call i8* @sbrk(i32 0)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = ptrtoint i8* %5 to i64
%7 = add nsw i64 %6, 4095
%8 = and i64 %7, -4096
%9 = trunc i64 %8 to i32
%10 = call i8* @sbrk(i32 %9)
%11 = call i8* @sbrk(i32 8192)
store i8* %11, i8** %2
%12 = call i8* @sbrk(i32 -8192)
%13 = load i8*, i8** %2
%14 = getelementptr i8, i8* %13, i64 4096
%15 = bitcast i8* %14 to i32*
%16 = load volatile i32, i32* %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 1
}

LLVM IR (-O2):
define i32 @test_sbrk_sigsegv() {
%1 = tail call i8* @sbrk(i32 0)
%2 = ptrtoint i8* %1 to i64
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 4095
%5 = and i32 %4, -4096
%6 = tail call i8* @sbrk(i32 %5)
%7 = tail call i8* @sbrk(i32 8192)
%8 = tail call i8* @sbrk(i32 -8192)
%9 = getelementptr i8, i8* %7, i64 4096
%10 = bitcast i8* %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 1
}
int bcd2bin(int bcd) {
  unsigned int f;
  int bin = 0;
  for (f = 1; f < 100000; f = f * 10) {
    bin += (bcd & 15) * f;
    bcd >>= 4;
  }
  return bin;
}


x86 assembly (clang, -O0):
<bcd2bin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jae    1147 <bcd2bin+0x47>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <bcd2bin+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2bin>:
mov    %edi,%eax
and    $0xf,%eax
mov    %edi,%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf,%ecx
imul   $0x64,%ecx,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0xc,%eax
and    $0xf,%eax
imul   $0x3e8,%eax,%edx
add    %ecx,%edx
shr    $0x10,%edi
and    $0xf,%edi
imul   $0x2710,%edi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @bcd2bin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = icmp ult i32 %6, 100000
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 15
%11 = load i32, i32* %3
%12 = mul i32 %10, %11
%13 = load i32, i32* %4
%14 = add i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
store i32 %16, i32* %2
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = mul i32 %18, 10
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @bcd2bin(i32 %0) {
%2 = and i32 %0, 15
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = mul nuw nsw i32 %4, 10
%6 = add nuw nsw i32 %2, %5
%7 = lshr i32 %0, 8
%8 = and i32 %7, 15
%9 = mul nuw nsw i32 %8, 100
%10 = add nuw nsw i32 %6, %9
%11 = lshr i32 %0, 12
%12 = and i32 %11, 15
%13 = mul nuw nsw i32 %12, 1000
%14 = add nuw nsw i32 %10, %13
%15 = lshr i32 %0, 16
%16 = and i32 %15, 15
%17 = mul nuw nsw i32 %16, 10000
%18 = add nuw nsw i32 %14, %17
ret i32 %18
}
void ERR_set_implementation(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_set_implementation() {
ret void
}
INI_btl_proof_seq_ctx() {}


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

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

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

LLVM IR (-O2):
define i32 @INI_btl_proof_seq_ctx() {
ret i32 undef
}
reg0adrreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
ja     1137 <reg0adrreg1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <reg0adrreg1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adrreg1>:
xor    %eax,%eax
cmp    %edi,0x10f444(%r9)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @reg0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
%9 = icmp uge i32 %8, %0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int __C_isprint(int);
int isprint(int c) { return __C_isprint(c); }


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

x86 assembly (clang, -O2):
<isprint>:
jmp    1030 <__C_isprint@plt>

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

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

/* Variables and functions */
ssize_t _read(int a, void *b, size_t c) { return 0; }


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int pigpio_command(int, int, int, int /*<<< orphan*/, int);
int wave_get_high_cbs(int pi) { return pigpio_command(pi, 36, 1, 0, 1); }


x86 assembly (clang, -O0):
<wave_get_high_cbs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x24,%esi
mov    $0x1,%r8d
xor    %ecx,%ecx
mov    %r8d,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_get_high_cbs>:
mov    $0x24,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @wave_get_high_cbs(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 36, i32 1, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
void *compare_tvalr_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_tvalr_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_tvalr_context() {
ret i8* null
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint8_t USBULPIRegRead(uint32_t ui32Base, uint8_t ui8Reg) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000075))) = ui8Reg;
  (*((volatile uint8_t *)(ui32Base + 0x00000076))) = 0x00000004 | 0x00000001;
  while (((*((volatile uint8_t *)(ui32Base + 0x00000076))) & 0x00000002) == 0) {
  }
  (*((volatile uint8_t *)(ui32Base + 0x00000076))) = 0;
  return ((*((volatile uint8_t *)(ui32Base + 0x00000074))));
}


x86 assembly (clang, -O0):
<USBULPIRegRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x75(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,0x76(%rax)
mov    -0x8(%rbp),%rax
mov    0x76(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1138 <USBULPIRegRead+0x38>
jmp    1120 <USBULPIRegRead+0x20>
mov    -0x8(%rbp),%rax
movl   $0x0,0x76(%rax)
mov    -0x8(%rbp),%rax
mov    0x74(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBULPIRegRead>:
mov    %esi,0x75(%rdi)
movl   $0x5,0x76(%rdi)
nopw   0x0(%rax,%rax,1)
testl  $0x2,0x76(%rdi)
je     1110 <USBULPIRegRead+0x10>
movl   $0x0,0x76(%rdi)
mov    0x74(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @USBULPIRegRead(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 117
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
%9 = load i64, i64* %3
%10 = add nsw i64 %9, 118
%11 = inttoptr i64 %10 to i32*
store volatile i32 5, i32* %11
br label %12
12: ; preds = %19, %2
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 118
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, 2
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %12
br label %12
20: ; preds = %12
%21 = load i64, i64* %3
%22 = add nsw i64 %21, 118
%23 = inttoptr i64 %22 to i32*
store volatile i32 0, i32* %23
%24 = load i64, i64* %3
%25 = add nsw i64 %24, 116
%26 = inttoptr i64 %25 to i32*
%27 = load volatile i32, i32* %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @USBULPIRegRead(i64 %0, i32 %1) {
%3 = add nsw i64 %0, 117
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
%5 = add nsw i64 %0, 118
%6 = inttoptr i64 %5 to i32*
store volatile i32 5, i32* %6
br label %7
7: ; preds = %7, %2
%8 = load volatile i32, i32* %6
%9 = and i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
store volatile i32 0, i32* %6
%12 = add nsw i64 %0, 116
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ emptyBuffer();
int scanf(char *, char *);
int getUserOkay() {
  int ok = 0;
  char c = 0;
  do {
    ok = scanf("%c", &c);
    emptyBuffer();
  } while (!ok);
  if (c == 'y') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<getUserOkay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <emptyBuffer@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1133 <getUserOkay+0x13>
movsbl -0x9(%rbp),%eax
cmp    $0x79,%eax
jne    1177 <getUserOkay+0x57>
movl   $0x1,-0x4(%rbp)
jmp    117e <getUserOkay+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUserOkay>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xecc(%rip),%r14
lea    0xf(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <emptyBuffer@plt>
test   %ebp,%ebp
je     1140 <getUserOkay+0x20>
xor    %eax,%eax
cmpb   $0x79,0xf(%rsp)
sete   %al
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @getUserOkay() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %2
store i8 0, i8* %3
br label %4
4: ; preds = %7, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
store i32 %5, i32* %2
%6 = call i32 (...) @emptyBuffer()
br label %7
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 121
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %1
br label %17
16: ; preds = %11
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @getUserOkay() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = call i32 (...) @emptyBuffer()
%5 = icmp eq i32 %3, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 121
%9 = zext i1 %8 to i32
ret i32 %9
}
int free2dArray_d(double **x2d) {
  free(&x2d[0][0]);
  free(&x2d[0]);
  return 0;
}


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

x86 assembly (clang, -O2):
<free2dArray_d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @free2dArray_d(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 = getelementptr inbounds double, double* %5, i64 0
%7 = bitcast double* %6 to i8*
%8 = load double**, double*** %2
%9 = getelementptr inbounds double*, double** %8, i64 0
%10 = bitcast double** %9 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @free2dArray_d(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret i32 0
}
double INtoKM(double IN) { return IN / 39370.0787; }


x86 assembly (clang, -O0):
<INtoKM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<INtoKM>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @INtoKM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x40E3394284B5DCC6
ret double %4
}

LLVM IR (-O2):
define double @INtoKM(double %0) {
%2 = fdiv double %0, 0x40E3394284B5DCC6
ret double %2
}
int test_imm_E8uint8_reg(unsigned char val) {
  return ((val) & (0xE8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E8uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -24
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exit_handler(int sig) { exit(1); }


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exit_handler(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int f1(int *);
int f2(int (*)(int *), int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int var1 = 5;
  int rez = 0;
  printf("\n\nin main before f1 \naddress of var1 = %p;\n", &var1);
  rez = f1(&var1);
  printf("int main after f1 rez = %d;\n\n\n", rez);
  rez = f2(f1, var1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1050 <f1@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
mov    0x2e72(%rip),%rdi
call   1030 <f2@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <f1@plt>
mov    0x2e96(%rip),%rbx
lea    0xed3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <f2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0A\0Ain main before f1 \0Aaddress of var1 = %p;\0A\00"
@.str.1 = [31 x i8] c"int main after f1 rez = %d;\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 @f1(i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @f2(i32 (i32*)* @f1, i32 %8)
store i32 %9, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"\0A\0Ain main before f1 \0Aaddress of var1 = %p;\0A\00"
@.str.1 = [31 x i8] c"int main after f1 rez = %d;\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @f1(i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @f2(i32 (i32*)* @f1, i32 %6)
ret i32 0
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int _getpid_r(struct _reent *r) { assert(!"NYI"); }


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

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

LLVM IR (-O0):
%struct._reent = type { i32 }
@.str = [4 x i8] c"NYI\00"
define i32 @_getpid_r(%struct._reent* %0) {
%2 = alloca i32
%3 = alloca %struct._reent*
store %struct._reent* %0, %struct._reent** %3
%4 = call i32 @assert(i32 0)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_getpid_r(%struct._reent* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ core_util_critical_section_enter();
void wsf_mbed_os_critical_section_enter(void) {
  core_util_critical_section_enter();
}


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

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

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

LLVM IR (-O2):
define void @wsf_mbed_os_critical_section_enter() {
%1 = tail call i32 (...) @core_util_critical_section_enter()
ret void
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  size_t i;
  char *s;
  i = 0;
  s = (char *)b;
  while (i < len) {
    *(s + i) = (unsigned char)c;
    i++;
  }
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114e <ft_memset+0x4e>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111f <ft_memset+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}