xunge/DecIR huggingface dataset:
int is_digit_invariant(const char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<is_digit_invariant>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit_invariant+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit_invariant>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit_invariant(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit_invariant(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  int len;
  len = 0;
  if (!s)
    return;
  while (s[len])
    len++;
  write(fd, s, len);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1136 <ft_putstr_fd+0x26>
jmp    116a <ft_putstr_fd+0x5a>
jmp    113b <ft_putstr_fd+0x2b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115b <ft_putstr_fd+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113b <ft_putstr_fd+0x2b>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
test   %rdi,%rdi
je     1137 <ft_putstr_fd+0x27>
mov    %rdi,%rax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rax,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr_fd+0x10>
add    $0xffffffff,%edx
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = tail call i32 @write(i32 %1, i8* %0, i32 %11)
br label %13
13: ; preds = %2, %10
ret void
}
void tcpclient() {}


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

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

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

LLVM IR (-O2):
define void @tcpclient() {
ret void
}
/* Variables and functions */
int fc8180_deinit(void *);
signed int bbm_com_deinit(void *handle) {
  signed int res;
  res = fc8180_deinit(handle);
  return res;
}


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

x86 assembly (clang, -O2):
<bbm_com_deinit>:
jmp    1030 <fc8180_deinit@plt>

LLVM IR (-O0):
define i32 @bbm_com_deinit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @fc8180_deinit(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

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

/* Variables and functions */
int /*<<< orphan*/ __loguid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
scalar_t__ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void __setuid(uid_t uid) {
  if (setuid(uid)) {
    __loguid(uid, strerror(errno));
  }
}


x86 assembly (clang, -O0):
<__setuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <setuid@plt>
cmp    $0x0,%rax
je     116b <__setuid+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <__loguid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setuid>:
push   %rbx
mov    %edi,%ebx
call   1040 <setuid@plt>
test   %rax,%rax
je     1155 <__setuid+0x25>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <__loguid@plt>
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define void @__setuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @setuid(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @__loguid(i32 %7, i32 %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @__setuid(i32 %0) {
%2 = tail call i64 @setuid(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @__loguid(i32 %0, i32 %6)
br label %8
8: ; preds = %4, %1
ret void
}
int f2(int x, int y) { return (x + y); }


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

x86 assembly (clang, -O2):
<f2>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system_graphics_shutdown();
int /*<<< orphan*/ system_input_shutdown();
int /*<<< orphan*/ system_sound_shutdown();
int /*<<< orphan*/ system_unload_rom();
void ngp_uninit() {
  system_unload_rom();
  system_sound_shutdown();
  system_input_shutdown();
  system_graphics_shutdown();
  return;
}


x86 assembly (clang, -O0):
<ngp_uninit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <system_unload_rom@plt>
mov    $0x0,%al
call   1060 <system_sound_shutdown@plt>
mov    $0x0,%al
call   1030 <system_input_shutdown@plt>
mov    $0x0,%al
call   1040 <system_graphics_shutdown@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ngp_uninit>:
push   %rax
xor    %eax,%eax
call   1050 <system_unload_rom@plt>
xor    %eax,%eax
call   1060 <system_sound_shutdown@plt>
xor    %eax,%eax
call   1030 <system_input_shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <system_graphics_shutdown@plt>

LLVM IR (-O0):
define void @ngp_uninit() {
%1 = call i32 (...) @system_unload_rom()
%2 = call i32 (...) @system_sound_shutdown()
%3 = call i32 (...) @system_input_shutdown()
%4 = call i32 (...) @system_graphics_shutdown()
ret void
}

LLVM IR (-O2):
define void @ngp_uninit() {
%1 = tail call i32 (...) @system_unload_rom()
%2 = tail call i32 (...) @system_sound_shutdown()
%3 = tail call i32 (...) @system_input_shutdown()
%4 = tail call i32 (...) @system_graphics_shutdown()
ret void
}
int vsync_disable_timer(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vsync_disable_timer() {
ret i32 0
}
/* Variables and functions */
bool isLeft(char c) { return c == '(' || c == '[' || c == '{'; }


x86 assembly (clang, -O0):
<isLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x28,%ecx
mov    %al,-0x2(%rbp)
je     113b <isLeft+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5b,%ecx
mov    %al,-0x2(%rbp)
je     113b <isLeft+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x7b,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeft>:
mov    $0x1,%eax
cmp    $0x28,%dil
je     1111 <isLeft+0x11>
cmp    $0x5b,%dil
jne    1112 <isLeft+0x12>
ret
xor    %eax,%eax
cmp    $0x7b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isLeft(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 40
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 91
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 123
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isLeft(i8 signext %0) {
switch i8 %0, label %2 [
i8 91, label %5
i8 40, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 123
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteChar(int);
void SerialDataBegin() { SerialWriteChar((0XEE)); }


x86 assembly (clang, -O0):
<SerialDataBegin>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%edi
call   1030 <SerialWriteChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialDataBegin>:
mov    $0xee,%edi
jmp    1030 <SerialWriteChar@plt>

LLVM IR (-O0):
define void @SerialDataBegin() {
%1 = call i32 @SerialWriteChar(i32 238)
ret void
}

LLVM IR (-O2):
define void @SerialDataBegin() {
%1 = tail call i32 @SerialWriteChar(i32 238)
ret void
}
/* Variables and functions */
unsigned long cris_swapnwbrlz(unsigned long);
extern unsigned long ffz(unsigned long w) { return cris_swapnwbrlz(w); }


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

x86 assembly (clang, -O2):
<ffz>:
jmp    1030 <cris_swapnwbrlz@plt>

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

LLVM IR (-O2):
define i64 @ffz(i64 %0) {
%2 = tail call i64 @cris_swapnwbrlz(i64 %0)
ret i64 %2
}
/* Variables and functions */
int w4_str(int, char *);
int /*<<< orphan*/ write_n(int, char *, int);
int ms_client(int fd) {
  write_n(fd, "CLIENT", 6);
  return w4_str(fd, "CLIENTSERVER");
}


x86 assembly (clang, -O0):
<ms_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x6,%edx
call   1040 <write_n@plt>
mov    -0x4(%rbp),%edi
lea    0xebe(%rip),%rsi
call   1030 <w4_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_client>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
mov    $0x6,%edx
call   1040 <write_n@plt>
lea    0xecc(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <w4_str@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"CLIENT\00"
@.str.1 = [13 x i8] c"CLIENTSERVER\00"
define i32 @ms_client(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write_n(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%5 = load i32, i32* %2
%6 = call i32 @w4_str(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"CLIENT\00"
@.str.1 = [13 x i8] c"CLIENTSERVER\00"
define i32 @ms_client(i32 %0) {
%2 = tail call i32 @write_n(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = tail call i32 @w4_str(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __machdep_stack_free(void *stack) { free(stack); }


x86 assembly (clang, -O0):
<__machdep_stack_free>:
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):
<__machdep_stack_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__machdep_stack_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long __ccaprice_syscall_args_4(long A0, long A1, long A2, long A3, long A4) {
  unsigned long R;
  __asm__ __volatile__("int $0x80"
                       : "=a"(R)
                       : "a"(A0), "b"(A1), "c"(A2), "d"(A3), "S"(A4)
                       : "memory");
  return R;
}


x86 assembly (clang, -O0):
<__ccaprice_syscall_args_4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rsi
int    $0x80
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccaprice_syscall_args_4>:
push   %rbx
mov    %rcx,%r9
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %r8,%rsi
mov    %r9,%rdx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__ccaprice_syscall_args_4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = call i64 asm sideeffect "int $$0x80", "={ax},{ax},{bx},{cx},{dx},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %12, i64 %13, i64 %14, i64 %15, i64 %16)
store i64 %17, i64* %11
%18 = load i64, i64* %11
ret i64 %18
}

LLVM IR (-O2):
define i64 @__ccaprice_syscall_args_4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "int $$0x80", "={ax},{ax},{bx},{cx},{dx},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
/* Variables and functions */
char *str_chr(char const *);
short is_blank_(const char *s) {
  char *p;
  if (!s || !*s) {
    return 1;
  }
  p = str_chr(s);
  if (p == NULL) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_blank_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <is_blank_+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113f <is_blank_+0x2f>
movw   $0x1,-0x2(%rbp)
jmp    1168 <is_blank_+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <str_chr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <is_blank_+0x52>
movw   $0x1,-0x2(%rbp)
jmp    1168 <is_blank_+0x58>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_>:
push   %rax
mov    $0x1,%ax
test   %rdi,%rdi
je     112f <is_blank_+0x1f>
cmpb   $0x0,(%rdi)
je     112f <is_blank_+0x1f>
call   1030 <str_chr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i16 @is_blank_(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i8* @str_chr(i8* %0)
%8 = icmp eq i8* %7, null
%9 = zext i1 %8 to i16
br label %10
10: ; preds = %6, %1, %3
%11 = phi i16 [ 1, %3 ], [ 1, %1 ], [ %9, %6 ]
ret i16 %11
}
/* Variables and functions */
int /*<<< orphan*/ noinline();
void use74() { noinline(); }


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

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

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

LLVM IR (-O2):
define void @use74() {
%1 = tail call i32 (...) @noinline()
ret void
}
/* Variables and functions */
short xor_h(short *, short *);
short intr_wrap_538(short p1, short p2) { return xor_h(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_538>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <xor_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_538>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <xor_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_538(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @xor_h(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_538(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @xor_h(i16* %3, i16* %4)
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ inet_lnaof(struct in_addr);
uint32_t gen_spi(struct in_addr src) { return htonl(inet_lnaof(src)); }


x86 assembly (clang, -O0):
<gen_spi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <inet_lnaof@plt>
mov    %eax,%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_spi>:
push   %rax
call   1040 <inet_lnaof@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <htonl@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @gen_spi(i32 %0) {
%2 = alloca %struct.in_addr
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @inet_lnaof(i32 %5)
%7 = call i32 @htonl(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @gen_spi(i32 %0) {
%2 = tail call i32 @inet_lnaof(i32 %0)
%3 = tail call i32 @htonl(i32 %2)
ret i32 %3
}
/* Variables and functions */
char *strpbrk(char *, char *);
char *last_slash(char *s) {
  char *p;
  for (;;) {
    p = strpbrk(s + 1, "/\\");
    if (!p)
      return s;
    s = p;
  }
}


x86 assembly (clang, -O0):
<last_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
lea    0xed5(%rip),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <last_slash+0x39>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    111c <last_slash+0xc>

x86 assembly (clang, -O2):
<last_slash>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    %rax,%rbx
lea    0x1(%rax),%rdi
mov    %r14,%rsi
call   1030 <strpbrk@plt>
test   %rax,%rax
jne    1120 <last_slash+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"/\\\00"
define i8* @last_slash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i8* @strpbrk(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = load i8*, i8** %2
ret i8* %11
12: ; preds = %4
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"/\\\00"
define i8* @last_slash(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %5, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = tail call i8* @strpbrk(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
double hubble_scaling(double);
double inv_hubble_scaling(double a, void *extra_data) {
  return (1.0 / (a * hubble_scaling(1.0 / a - 1.0)));
}


x86 assembly (clang, -O0):
<inv_hubble_scaling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecd(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <hubble_scaling@plt>
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xea6(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_hubble_scaling>:
push   %rax
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xede(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xeda(%rip),%xmm0
call   1030 <hubble_scaling@plt>
mulsd  (%rsp),%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @inv_hubble_scaling(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fdiv double 1.000000e+00, %6
%8 = fsub double %7, 1.000000e+00
%9 = call double @hubble_scaling(double %8)
%10 = fmul double %5, %9
%11 = fdiv double 1.000000e+00, %10
ret double %11
}

LLVM IR (-O2):
define double @inv_hubble_scaling(double %0, i8* nocapture readnone %1) {
%3 = fdiv double 1.000000e+00, %0
%4 = fadd double %3, -1.000000e+00
%5 = tail call double @hubble_scaling(double %4)
%6 = fmul double %5, %0
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
void core_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @core_deinit() {
ret void
}
int i810_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
                unsigned long arg) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @i810_modctx(%struct.inode* %0, %struct.file* %1, i32 %2, i64 %3) {
%5 = alloca %struct.inode*
%6 = alloca %struct.file*
%7 = alloca i32
%8 = alloca i64
store %struct.inode* %0, %struct.inode** %5
store %struct.file* %1, %struct.file** %6
store i32 %2, i32* %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @i810_modctx(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1, i32 %2, i64 %3) {
ret i32 0
}
unsigned xrop3_188_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_188_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_188_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %edi
and    %edi,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_188_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = and i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_188_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %3, -1
%8 = and i32 %6, %7
%9 = xor i32 %8, %4
ret i32 %9
}
/* Type definitions */
struct rq_object_pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_object_pool_free(struct rq_object_pool *);
void _rq_object_mgr_free_object_pool(void *p) {
  rq_object_pool_free((struct rq_object_pool *)p);
}


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

x86 assembly (clang, -O2):
<_rq_object_mgr_free_object_pool>:
jmp    1030 <rq_object_pool_free@plt>

LLVM IR (-O0):
%struct.rq_object_pool = type { i32 }
define void @_rq_object_mgr_free_object_pool(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_object_pool*
%5 = call i32 @rq_object_pool_free(%struct.rq_object_pool* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_object_pool = type { i32 }
define void @_rq_object_mgr_free_object_pool(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_object_pool*
%3 = tail call i32 @rq_object_pool_free(%struct.rq_object_pool* %2)
ret void
}
int strcmp(const char *s1, const char *s2) {
  int res;
  while (1) {
    if ((res = *s1 - *s2) != 0 || *s1 == '\0')
      break;
    s1++, s2++;
  }
  return res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    1138 <strcmp+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <strcmp+0x3d>
jmp    115a <strcmp+0x5a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
movsbl (%rdi),%ecx
movsbl (%rsi),%edx
mov    %ecx,%eax
sub    %edx,%eax
jne    1138 <strcmp+0x38>
test   %cl,%cl
je     1138 <strcmp+0x38>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rdi,%rcx,1),%edx
movsbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    1138 <strcmp+0x38>
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <strcmp+0x20>
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
%8 = icmp ne i32 %7, 0
%9 = icmp eq i8 %3, 0
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %24, label %11
11: ; preds = %2, %11
%12 = phi i8* [ %14, %11 ], [ %0, %2 ]
%13 = phi i8* [ %15, %11 ], [ %1, %2 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = load i8, i8* %15
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %17, %19
%21 = icmp ne i32 %20, 0
%22 = icmp eq i8 %16, 0
%23 = select i1 %21, i1 true, i1 %22
br i1 %23, label %24, label %11
24: ; preds = %11, %2
%25 = phi i32 [ %7, %2 ], [ %20, %11 ]
ret i32 %25
}
__attribute__((__weak__)) void console_txChar(int ch) { (void)ch; }


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

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

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

LLVM IR (-O2):
define weak void @console_txChar(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ char32_t;

/* Variables and functions */
size_t _PDCLIB_c32slen(const char32_t *str) {
  size_t n = 0;
  while (*(str++))
    n++;
  return n;
}


x86 assembly (clang, -O0):
<_PDCLIB_c32slen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
je     1139 <_PDCLIB_c32slen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_PDCLIB_c32slen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_PDCLIB_c32slen>:
cmpl   $0x0,(%rdi)
je     111f <_PDCLIB_c32slen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpl   $0x0,0x4(%rdi,%rcx,4)
mov    %rax,%rcx
jne    1110 <_PDCLIB_c32slen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @_PDCLIB_c32slen(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = add i64 %5, 1
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ digitToHex(unsigned char);
int /*<<< orphan*/ pchar(int /*<<< orphan*/);
void printHexByte(unsigned char byte) {
  pchar(digitToHex((byte & 0xF0) >> 4));
  pchar(digitToHex(byte & 0xF));
}


x86 assembly (clang, -O0):
<printHexByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <pchar@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <pchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHexByte>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <pchar@plt>
and    $0xf,%ebx
mov    %ebx,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <pchar@plt>

LLVM IR (-O0):
define void @printHexByte(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, 240
%6 = ashr i32 %5, 4
%7 = trunc i32 %6 to i8
%8 = call i32 @digitToHex(i8 zeroext %7)
%9 = call i32 @pchar(i32 %8)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 15
%13 = trunc i32 %12 to i8
%14 = call i32 @digitToHex(i8 zeroext %13)
%15 = call i32 @pchar(i32 %14)
ret void
}

LLVM IR (-O2):
define void @printHexByte(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @digitToHex(i8 zeroext %2)
%4 = tail call i32 @pchar(i32 %3)
%5 = and i8 %0, 15
%6 = tail call i32 @digitToHex(i8 zeroext %5)
%7 = tail call i32 @pchar(i32 %6)
ret void
}
/* Variables and functions */
int io_accept_connection_addr(int, int /*<<< orphan*/ *);
int io_accept_connection(int fd) { return io_accept_connection_addr(fd, NULL); }


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

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

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

LLVM IR (-O2):
define i32 @io_accept_connection(i32 %0) {
%2 = tail call i32 @io_accept_connection_addr(i32 %0, i32* null)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ utf8_charlen(scalar_t__ const);
size_t utf8_strlen(const uint8_t *utf8) {
  size_t length = 0;
  for (; *utf8; length++, utf8 += utf8_charlen(*utf8))
    ;
  return length;
}


x86 assembly (clang, -O0):
<utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1168 <utf8_strlen+0x58>
jmp    1137 <utf8_strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <utf8_charlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <utf8_strlen+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_strlen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
xor    %ebx,%ebx
test   %rdi,%rdi
je     1148 <utf8_strlen+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
call   1030 <utf8_charlen@plt>
cltq
mov    (%r14,%rax,8),%rdi
lea    (%r14,%rax,8),%r14
test   %rdi,%rdi
jne    1130 <utf8_strlen+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @utf8_strlen(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %8, %4 ], [ 0, %1 ]
%7 = phi i64* [ %11, %4 ], [ %0, %1 ]
%8 = add i64 %6, 1
%9 = tail call i32 @utf8_charlen(i64 %5)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %7, i64 %10
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
int getegid();
int test(void) {
  gid_t gid;
  gid = getegid();
  return gid;
}


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

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = call i32 (...) @getegid()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @getegid()
ret i32 %1
}
void openlog(const char *ident, int option, int facility) {
  (void)ident;
  (void)option;
  (void)facility;
}


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

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

LLVM IR (-O0):
define void @openlog(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @openlog(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ls__7ostreamPCc();
int /*<<< orphan*/ __ls__7ostreamPCv();
int /*<<< orphan*/ endl__FR7ostream();
int /*<<< orphan*/ hex__FR3ios();
void __thunk_36_foo__1D() {
  __ls__7ostreamPCc();
  hex__FR3ios();
  __ls__7ostreamPCv();
  __ls__7ostreamPCc();
  endl__FR7ostream();
  return;
}


x86 assembly (clang, -O0):
<__thunk_36_foo__1D>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__ls__7ostreamPCc@plt>
mov    $0x0,%al
call   1060 <hex__FR3ios@plt>
mov    $0x0,%al
call   1050 <__ls__7ostreamPCv@plt>
mov    $0x0,%al
call   1030 <__ls__7ostreamPCc@plt>
mov    $0x0,%al
call   1040 <endl__FR7ostream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__thunk_36_foo__1D>:
push   %rax
xor    %eax,%eax
call   1030 <__ls__7ostreamPCc@plt>
xor    %eax,%eax
call   1060 <hex__FR3ios@plt>
xor    %eax,%eax
call   1050 <__ls__7ostreamPCv@plt>
xor    %eax,%eax
call   1030 <__ls__7ostreamPCc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endl__FR7ostream@plt>

LLVM IR (-O0):
define void @__thunk_36_foo__1D() {
%1 = call i32 (...) @__ls__7ostreamPCc()
%2 = call i32 (...) @hex__FR3ios()
%3 = call i32 (...) @__ls__7ostreamPCv()
%4 = call i32 (...) @__ls__7ostreamPCc()
%5 = call i32 (...) @endl__FR7ostream()
ret void
}

LLVM IR (-O2):
define void @__thunk_36_foo__1D() {
%1 = tail call i32 (...) @__ls__7ostreamPCc()
%2 = tail call i32 (...) @hex__FR3ios()
%3 = tail call i32 (...) @__ls__7ostreamPCv()
%4 = tail call i32 (...) @__ls__7ostreamPCc()
%5 = tail call i32 (...) @endl__FR7ostream()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int pthread_cond_destroy(int /*<<< orphan*/ *);
int my_pthread_cond_destroy(pthread_cond_t *cond) {
  int ret;
  pthread_cond_t *realcond = (pthread_cond_t *)*(int *)cond;
  ret = pthread_cond_destroy(realcond);
  free(realcond);
  return ret;
}


x86 assembly (clang, -O0):
<my_pthread_cond_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_cond_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_cond_destroy>:
push   %rbp
push   %rbx
push   %rax
movslq (%rdi),%rbx
mov    %rbx,%rdi
call   1040 <pthread_cond_destroy@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_pthread_cond_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_cond_destroy(i32* %9)
store i32 %10, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @free(i32* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_pthread_cond_destroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @pthread_cond_destroy(i32* %4)
%6 = tail call i32 @free(i32* %4)
ret i32 %5
}
/* Variables and functions */
int read(int, unsigned char *, int);
int get_i2c_data(int dev, unsigned char *value) {
  int r;
  if ((r = read(dev, value, 1)) < 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_i2c_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1148 <get_i2c_data+0x38>
movl   $0x0,-0x4(%rbp)
jmp    114f <get_i2c_data+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_i2c_data>:
push   %rax
mov    $0x1,%edx
call   1030 <read@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_i2c_data(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i8* %1, i32 1)
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
scalar_t__ is_prime(int);
long sum_primes_under(int n) {
  long s = 2;
  int i = 3;
  for (i = 3; i <= n; i += 2) {
    if (is_prime(i)) {
      s += i;
    }
  }
  return s;
}


x86 assembly (clang, -O0):
<sum_primes_under>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     116e <sum_primes_under+0x5e>
mov    -0x14(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     115b <sum_primes_under+0x4b>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1160 <sum_primes_under+0x50>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <sum_primes_under+0x21>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_primes_under>:
push   %rbp
push   %r14
push   %rbx
mov    $0x2,%ebx
cmp    $0x3,%edi
jl     114a <sum_primes_under+0x3a>
mov    %edi,%r14d
mov    $0x2,%ebx
mov    $0x3,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <is_prime@plt>
test   %rax,%rax
cmovne %rbp,%rax
add    %rax,%rbx
add    $0x2,%rbp
cmp    %r14d,%ebp
jle    1130 <sum_primes_under+0x20>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @sum_primes_under(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 3, %1 ]
%5 = phi i64 [ %10, %3 ], [ 2, %1 ]
%6 = trunc i64 %4 to i32
%7 = tail call i64 @is_prime(i32 %6)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i64 0, i64 %4
%10 = add nuw nsw i64 %9, %5
%11 = add nuw i64 %4, 2
%12 = trunc i64 %11 to i32
%13 = icmp sgt i32 %12, %0
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i64 [ 2, %1 ], [ %10, %3 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_short_p(short *addr, short value, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_short_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_short_p(i16* %0, i16 signext %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i16
%6 = alloca i32
store i16* %0, i16** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_short_p(i16* nocapture readnone %0, i16 signext %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void networkingInitArch(void) {}


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

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

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

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