xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *rev_string(char *);
char *strdup(char *);
int main(void) {
  char *s;
  s = strdup("Holberton");
  printf("%s\n", s);
  s = rev_string(s);
  printf("%s\n", s);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rev_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <rev_string@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Holberton\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i8* @rev_string(i8* %6)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Holberton\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i8* @rev_string(i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Fibonacci!!!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Fibonacci!!!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Fibonacci!!!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct l2tp_conn_mngr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ l2tp_tunnel_close(struct l2tp_conn_mngr *);
void close_l2tp_callmngr(struct l2tp_conn_mngr *conn) {
  l2tp_tunnel_close(conn);
}


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

x86 assembly (clang, -O2):
<close_l2tp_callmngr>:
jmp    1030 <l2tp_tunnel_close@plt>

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

LLVM IR (-O2):
%struct.l2tp_conn_mngr = type { i32 }
define void @close_l2tp_callmngr(%struct.l2tp_conn_mngr* %0) {
%2 = tail call i32 @l2tp_tunnel_close(%struct.l2tp_conn_mngr* %0)
ret void
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ socket_option;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
scalar_t__ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, void *,
                      int *);
int get_socket_error(int handle_socket) {
  int socket_option;
  socklen_t socket_option_length = sizeof(socket_option);
  if (getsockopt(handle_socket, SOL_SOCKET, SO_ERROR, (void *)&socket_option,
                 &socket_option_length) != 0) {
    return -1;
  }
  return socket_option;
}


x86 assembly (clang, -O0):
<get_socket_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0x0,%rax
je     115a <get_socket_error+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <get_socket_error+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socket_error>:
push   %rax
movl   $0x4,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <getsockopt@plt>
neg    %rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @get_socket_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_ERROR
%9 = bitcast i32* %4 to i8*
%10 = call i64 @getsockopt(i32 %6, i32 %7, i32 %8, i8* %9, i32* %5)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @get_socket_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i64 @getsockopt(i32 %0, i32 %6, i32 %7, i8* %4, i32* %3)
%9 = icmp eq i64 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i32 %10, i32 -1
ret i32 %11
}
int max(int s1, int s2) {
  if (s1 > s2)
    return s1;
  else
    return s2;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int type_mode_per_thread(struct obj_tx_bench *obj_bench, int worker_idx,
                         int op_idx) {
  return worker_idx;
}


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

x86 assembly (clang, -O2):
<type_mode_per_thread>:
mov    %esi,%eax
ret

LLVM IR (-O0):
%struct.obj_tx_bench = type opaque
define i32 @type_mode_per_thread(%struct.obj_tx_bench* %0, i32 %1, i32 %2) {
%4 = alloca %struct.obj_tx_bench*
%5 = alloca i32
%6 = alloca i32
store %struct.obj_tx_bench* %0, %struct.obj_tx_bench** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
ret i32 %7
}

LLVM IR (-O2):
%struct.obj_tx_bench = type opaque
define i32 @type_mode_per_thread(%struct.obj_tx_bench* nocapture readnone %0, i32 returned %1, i32 %2) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ p32x_pwm_schedule(unsigned int);
void p32x_pwm_irq_event(unsigned int m68k_now) { p32x_pwm_schedule(m68k_now); }


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

x86 assembly (clang, -O2):
<p32x_pwm_irq_event>:
jmp    1030 <p32x_pwm_schedule@plt>

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

LLVM IR (-O2):
define void @p32x_pwm_irq_event(i32 %0) {
%2 = tail call i32 @p32x_pwm_schedule(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ ft_strncmp(char const *, char const *, size_t);
int ft_strnequ(char const *s1, char const *s2, size_t n) {
  if (s1 && s2)
    if (ft_strncmp(s1, s2, n) == 0)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_strnequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <ft_strnequ+0x56>
cmpq   $0x0,-0x18(%rbp)
je     1166 <ft_strnequ+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <ft_strncmp@plt>
cmp    $0x0,%rax
jne    1161 <ft_strnequ+0x51>
movl   $0x1,-0x4(%rbp)
jmp    116d <ft_strnequ+0x5d>
jmp    1166 <ft_strnequ+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnequ>:
test   %rdi,%rdi
je     112a <ft_strnequ+0x1a>
test   %rsi,%rsi
je     112a <ft_strnequ+0x1a>
push   %rax
call   1030 <ft_strncmp@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     112d <ft_strnequ+0x1d>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strnequ(i8* %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i64 @ft_strncmp(i8* %0, i8* %1, i64 %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %3
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ 0, %10 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ check_library(char *);
int main(void) {
  if (check_library("libdlclosetest1.so"))
    return 1;
  if (check_library("libdlclosetest2.so"))
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <check_library@plt>
cmp    $0x0,%rax
je     1141 <main+0x31>
movl   $0x1,-0x4(%rbp)
jmp    116a <main+0x5a>
lea    0xecb(%rip),%rdi
call   1030 <check_library@plt>
cmp    $0x0,%rax
je     1163 <main+0x53>
movl   $0x2,-0x4(%rbp)
jmp    116a <main+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <check_library@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112c <main+0x1c>
pop    %rcx
ret
lea    0xee0(%rip),%rdi
call   1030 <check_library@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"libdlclosetest1.so\00"
@.str.1 = [19 x i8] c"libdlclosetest2.so\00"
define i32 @main() {
%1 = tail call i64 @check_library(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @check_library(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 0, i32 2
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void LCDIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x44050000);
  ASSERT(
      !(ui32IntFlags & ~(0x00000001 | 0x00000004 | 0x00000008 | 0x00000020 |
                         0x00000040 | 0x00000100 | 0x00000200 | 0x00000002)));
  (*((volatile uint32_t *)(ui32Base + 0x00000064))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<LCDIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
and    $0xfffffc90,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x64,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIntDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
test   $0xfffffc90,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x64(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @LCDIntDisable(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 = icmp eq i32 %5, 1141178368
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = and i32 %9, -880
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 100
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %15, i32* %19
ret void
}

LLVM IR (-O2):
define void @LCDIntDisable(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141178368
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = and i32 %1, -880
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = add nsw i32 %0, 100
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %1, i32* %12
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *SkipWS(const char *string) {
  while (isspace(*string))
    string++;
  return string;
}


x86 assembly (clang, -O0):
<SkipWS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <SkipWS+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <SkipWS+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipWS>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <SkipWS+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SkipWS(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _PDCLIB_memswp(char *, char *, size_t);
void memswp(char *i, char *j, size_t size) { _PDCLIB_memswp(i, j, size); }


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

x86 assembly (clang, -O2):
<memswp>:
jmp    1030 <_PDCLIB_memswp@plt>

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

LLVM IR (-O2):
define void @memswp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @_PDCLIB_memswp(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
float kill_denormal(float);
float fmul_native(float a, float b) { return kill_denormal(a * b); }


x86 assembly (clang, -O0):
<fmul_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <kill_denormal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmul_native>:
mulss  %xmm1,%xmm0
jmp    1030 <kill_denormal@plt>

LLVM IR (-O0):
define float @fmul_native(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
%8 = call float @kill_denormal(float %7)
ret float %8
}

LLVM IR (-O2):
define float @fmul_native(float %0, float %1) {
%3 = fmul float %0, %1
%4 = tail call float @kill_denormal(float %3)
ret float %4
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ iput(struct inode *);
int /*<<< orphan*/ iunlock(struct inode *);
void iunlockput(struct inode *ip) {
  iunlock(ip);
  iput(ip);
}


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

x86 assembly (clang, -O2):
<iunlockput>:
push   %rbx
mov    %rdi,%rbx
call   1040 <iunlock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <iput@plt>

LLVM IR (-O0):
%struct.inode = type { i32 }
define void @iunlockput(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load %struct.inode*, %struct.inode** %2
%4 = call i32 @iunlock(%struct.inode* %3)
%5 = load %struct.inode*, %struct.inode** %2
%6 = call i32 @iput(%struct.inode* %5)
ret void
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define void @iunlockput(%struct.inode* %0) {
%2 = tail call i32 @iunlock(%struct.inode* %0)
%3 = tail call i32 @iput(%struct.inode* %0)
ret void
}
int stol(val)
char *val;
{
  if (val[0] == 'F')
    return (0);
  if (val[0] == 'T')
    return (1);
  return ((asc_int(val) != 0));
}


x86 assembly (clang, -O0):
<stol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x46,%eax
jne    1138 <stol+0x28>
movl   $0x0,-0x4(%rbp)
jmp    116d <stol+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x54,%eax
jne    1154 <stol+0x44>
movl   $0x1,-0x4(%rbp)
jmp    116d <stol+0x5d>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <asc_int@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stol>:
push   %rax
mov    (%rdi),%al
cmp    $0x46,%al
je     1122 <stol+0x12>
cmp    $0x54,%al
jne    1126 <stol+0x16>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <asc_int@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stol(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %4 [
i8 70, label %8
i8 84, label %3
]
3: ; preds = %1
br label %8
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @asc_int to i32 (i8*, ...)*)(i8* %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4, %3
%9 = phi i32 [ 1, %3 ], [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *wcschr(const wchar_t *p, wchar_t c) {
  for (;; ++p) {
    if (*p == c) {
      return (wchar_t *)p;
    }
    if (!*p)
      return NULL;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<wcschr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    112a <wcschr+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <wcschr+0x5b>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1145 <wcschr+0x45>
movq   $0x0,-0x8(%rbp)
jmp    115b <wcschr+0x5b>
jmp    114a <wcschr+0x4a>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <wcschr+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschr>:
mov    %rdi,%rax
mov    (%rdi),%rcx
cmp    %rsi,%rcx
je     1122 <wcschr+0x22>
nopl   0x0(%rax,%rax,1)
test   %rcx,%rcx
je     1123 <wcschr+0x23>
mov    0x8(%rax),%rcx
add    $0x8,%rax
cmp    %rsi,%rcx
jne    1110 <wcschr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @wcschr(i64* %0, i64 %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, %1
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %11, %9 ], [ %3, %2 ]
%7 = phi i64* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i64 %6, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %7, i64 1
%11 = load i64, i64* %10
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %9, %5, %2
%14 = phi i64* [ %0, %2 ], [ null, %5 ], [ %10, %9 ]
ret i64* %14
}
/* Variables and functions */
int /*<<< orphan*/ die_if_with_errno(int, char *, int);
int posix_memalign(void **, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ smallest_power_of_2_that_holds(size_t);
void *allocate_aligned_memory(size_t alignment, size_t size) {
  void *buffer;
  int retval;
  retval =
      posix_memalign(&buffer, smallest_power_of_2_that_holds(alignment), size);
  die_if_with_errno(retval != 0, "posix_memalign", retval);
  return buffer;
}


x86 assembly (clang, -O0):
<allocate_aligned_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <smallest_power_of_2_that_holds@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1040 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x1c(%rbp),%edx
lea    0xe8f(%rip),%rsi
call   1050 <die_if_with_errno@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_aligned_memory>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <smallest_power_of_2_that_holds@plt>
lea    0x8(%rsp),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <posix_memalign@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
lea    0xea5(%rip),%rsi
mov    %eax,%edx
call   1050 <die_if_with_errno@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"posix_memalign\00"
define i8* @allocate_aligned_memory(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = call i32 @smallest_power_of_2_that_holds(i64 %7)
%9 = load i64, i64* %4
%10 = call i32 @posix_memalign(i8** %5, i32 %8, i64 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
%14 = load i32, i32* %6
%15 = call i32 @die_if_with_errno(i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"posix_memalign\00"
define i8* @allocate_aligned_memory(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i32 @smallest_power_of_2_that_holds(i64 %0)
%6 = call i32 @posix_memalign(i8** %3, i32 %5, i64 %1)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @die_if_with_errno(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
%10 = load i8*, i8** %3
ret i8* %10
}
/* Type definitions */
struct llist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __llist_splice(struct llist_head *, struct llist_head *);
int /*<<< orphan*/ llist_empty(struct llist_head *);
void llist_splice(struct llist_head *llist, struct llist_head *head) {
  if (!llist_empty(llist))
    __llist_splice(llist, head);
}


x86 assembly (clang, -O0):
<llist_splice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <llist_empty@plt>
cmp    $0x0,%eax
jne    114f <llist_splice+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__llist_splice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llist_splice>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <llist_empty@plt>
test   %eax,%eax
je     113b <llist_splice+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__llist_splice@plt>

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

LLVM IR (-O2):
%struct.llist_head = type { i32 }
define void @llist_splice(%struct.llist_head* %0, %struct.llist_head* %1) {
%3 = tail call i32 @llist_empty(%struct.llist_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @__llist_splice(%struct.llist_head* %0, %struct.llist_head* %1)
br label %7
7: ; preds = %5, %2
ret void
}
void testClosureFBFrV(void (*closure)(float, char, float), float a1, char a2,
                      float a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureFBFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movss  %xmm1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    -0xd(%rbp),%cl
movss  -0x14(%rbp),%xmm1
movsbl %cl,%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFBFrV>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureFBFrV(void (float, i8, float)* %0, float %1, i8 signext %2, float %3) {
%5 = alloca void (float, i8, float)*
%6 = alloca float
%7 = alloca i8
%8 = alloca float
store void (float, i8, float)* %0, void (float, i8, float)** %5
store float %1, float* %6
store i8 %2, i8* %7
store float %3, float* %8
%9 = load void (float, i8, float)*, void (float, i8, float)** %5
%10 = load float, float* %6
%11 = load i8, i8* %7
%12 = load float, float* %8
ret void
}

LLVM IR (-O2):
define void @testClosureFBFrV(void (float, i8, float)* nocapture %0, float %1, i8 signext %2, float %3) {
tail call void %0(float %1, i8 signext %2, float %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, int);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *malrealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (!p) {
    fprintf(stderr, "realloc(%p, %i) returned NULL\n", ptr, (int)size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<malrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1185 <malrealloc+0x55>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
lea    0xe8a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     114c <malrealloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"realloc(%p, %i) returned NULL\0A\00"
define i8* @malrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %18, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"realloc(%p, %i) returned NULL\0A\00"
define noalias i8* @malrealloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = trunc i64 %1 to i32
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ vt100TextColor(int, int /*<<< orphan*/);
int /*<<< orphan*/ vt100TextDefault();
void PrintErrorMessage(const char *msg) {
  vt100TextColor(1, 0);
  printf("%s\r\n", msg);
  vt100TextDefault();
}


x86 assembly (clang, -O0):
<PrintErrorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <vt100TextColor@plt>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <vt100TextDefault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintErrorMessage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <vt100TextColor@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <vt100TextDefault@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @PrintErrorMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @vt100TextColor(i32 1, i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @vt100TextDefault()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @PrintErrorMessage(i8* %0) {
%2 = tail call i32 @vt100TextColor(i32 1, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @vt100TextDefault()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AdjustAscii(char);
int /*<<< orphan*/ PutLetter(int, int, int /*<<< orphan*/);
void PutString(int x, int y, char *p) {
  while (*p != 0) {
    PutLetter(x, y, AdjustAscii(*p));
    p += 1;
    x += 8;
  }
}


x86 assembly (clang, -O0):
<PutString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1181 <PutString+0x61>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <AdjustAscii@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1030 <PutLetter@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <PutString+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutString>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdx),%al
test   %al,%al
je     1162 <PutString+0x42>
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edi
call   1040 <AdjustAscii@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %eax,%edx
call   1030 <PutLetter@plt>
add    $0x8,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <PutString+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @PutString(i32 %0, i32 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i8* [ %12, %6 ], [ %2, %3 ]
%9 = phi i32 [ %13, %6 ], [ %0, %3 ]
%10 = tail call i32 @AdjustAscii(i8 signext %7)
%11 = tail call i32 @PutLetter(i32 %9, i32 %1, i32 %10)
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = add nsw i32 %9, 8
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3
ret void
}
char char_toUpper(char sv) {
  char sv_ret = 0;
  if (sv >= 'a' && sv <= 'z') {
    int sv_int = (int)sv - 32;
    sv_ret = (char)sv_int;
  }
  return sv_ret;
}


x86 assembly (clang, -O0):
<char_toUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1138 <char_toUpper+0x38>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1138 <char_toUpper+0x38>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_toUpper>:
lea    -0x61(%rdi),%eax
add    $0xe0,%dil
xor    %ecx,%ecx
cmp    $0x1a,%al
movzbl %dil,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @char_toUpper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %2
store i8 0, i8* %3
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 32
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
br label %18
18: ; preds = %12, %8, %1
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @char_toUpper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 0
ret i8 %5
}
/* Variables and functions */
int __ESBMC_isfinite(double);
int isfinite(double d) { return __ESBMC_isfinite(d); }


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

x86 assembly (clang, -O2):
<isfinite>:
jmp    1030 <__ESBMC_isfinite@plt>

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

LLVM IR (-O2):
define i32 @isfinite(double %0) {
%2 = tail call i32 @__ESBMC_isfinite(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signalHandler(int signal) { exit(0); }


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

x86 assembly (clang, -O2):
<signalHandler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @signalHandler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ C_in_heapp(long);
int /*<<< orphan*/ C_in_stackp(long);
long C_permanentp(long x) {
  return ((!((x)&0x00000003) && !C_in_stackp(x) && !C_in_heapp(x))
              ? ((long)(0x00000006 | 0x00000010))
              : ((long)(0x00000006 | 0x00000000)));
}


x86 assembly (clang, -O0):
<C_permanentp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1170 <C_permanentp+0x50>
mov    -0x8(%rbp),%rdi
call   1030 <C_in_stackp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1170 <C_permanentp+0x50>
mov    -0x8(%rbp),%rdi
call   1040 <C_in_heapp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x6,%eax
mov    $0x16,%ecx
test   $0x1,%dl
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_permanentp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x6,%r14d
test   $0x3,%bl
jne    1157 <C_permanentp+0x37>
mov    %rbx,%rdi
call   1030 <C_in_stackp@plt>
test   %eax,%eax
jne    1157 <C_permanentp+0x37>
mov    %rbx,%rdi
call   1040 <C_in_heapp@plt>
xor    %r14d,%r14d
test   %eax,%eax
sete   %r14b
shl    $0x4,%r14
or     $0x6,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @C_permanentp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 3
%5 = icmp ne i64 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i32 @C_in_stackp(i64 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i64, i64* %2
%12 = call i32 @C_in_heapp(i64 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i64 22, i64 6
ret i64 %18
}

LLVM IR (-O2):
define i64 @C_permanentp(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 @C_in_stackp(i64 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @C_in_heapp(i64 %0)
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i64 22, i64 6
br label %11
11: ; preds = %7, %4, %1
%12 = phi i64 [ 6, %4 ], [ 6, %1 ], [ %10, %7 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
long glongminus(long x, long y) {
  x -= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<glongminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <glongminus+0x33>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glongminus>:
push   %rbx
mov    %rdi,%rbx
sub    %rsi,%rbx
jne    1120 <glongminus+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @glongminus(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
int test_imm_79uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x79 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_79uint64_highword_reg>:
movabs $0x7900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_79uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 121
%6 = icmp ne i64 %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_79uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 519691042816
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int h2(int a, int b) { return b + 8; }


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

x86 assembly (clang, -O2):
<h2>:
lea    0x8(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @h2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 8
ret i32 %3
}
void a(unsigned char x) {
  if (x < 0)
    return;
  if (x >= 0)
    return;
  if (0 > x)
    return;
  if (0 <= x)
    return;
  if (x <= 255)
    return;
  if (255 >= x)
    return;
  if ((int)x <= 255)
    return;
  if (255 >= (unsigned char)1)
    return;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jge    111c <a+0x1c>
jmp    1197 <a+0x97>
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     112e <a+0x2e>
jmp    1197 <a+0x97>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jle    1141 <a+0x41>
jmp    1197 <a+0x97>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1154 <a+0x54>
jmp    1197 <a+0x97>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     1168 <a+0x68>
jmp    1197 <a+0x97>
movzbl -0x1(%rbp),%ecx
mov    $0xff,%eax
cmp    %ecx,%eax
jl     117e <a+0x7e>
jmp    1197 <a+0x97>
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jg     1192 <a+0x92>
jmp    1197 <a+0x97>
jmp    1197 <a+0x97>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @a(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %38
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %38
12: ; preds = %7
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = icmp sgt i32 0, %14
br i1 %15, label %16, label %17
16: ; preds = %12
br label %38
17: ; preds = %12
%18 = load i8, i8* %2
%19 = zext i8 %18 to i32
%20 = icmp sle i32 0, %19
br i1 %20, label %21, label %22
21: ; preds = %17
br label %38
22: ; preds = %17
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp sle i32 %24, 255
br i1 %25, label %26, label %27
26: ; preds = %22
br label %38
27: ; preds = %22
%28 = load i8, i8* %2
%29 = zext i8 %28 to i32
%30 = icmp sge i32 255, %29
br i1 %30, label %31, label %32
31: ; preds = %27
br label %38
32: ; preds = %27
%33 = load i8, i8* %2
%34 = zext i8 %33 to i32
%35 = icmp sle i32 %34, 255
br i1 %35, label %36, label %37
36: ; preds = %32
br label %38
37: ; preds = %32
br label %38
38: ; preds = %37, %36, %31, %26, %21, %16, %11, %6
ret void
}

LLVM IR (-O2):
define void @a(i8 zeroext %0) {
ret void
}