xunge/DecIR huggingface dataset:
int cmp_gt(const int a, const int val) { return a > val; }


x86 assembly (clang, -O0):
<cmp_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_gt>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @cmp_gt(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmp_gt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct ast_sockaddr {
  int dummy;
};

/* Variables and functions */
char *ast_sockaddr_stringify_fmt(struct ast_sockaddr const *, int);
char *ast_sockaddr_stringify_host(const struct ast_sockaddr *addr) {
  return ast_sockaddr_stringify_fmt(addr, ((1 << 0) | (1 << 2)));
}


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

x86 assembly (clang, -O2):
<ast_sockaddr_stringify_host>:
mov    $0x5,%esi
jmp    1030 <ast_sockaddr_stringify_fmt@plt>

LLVM IR (-O0):
%struct.ast_sockaddr = type { i32 }
define i8* @ast_sockaddr_stringify_host(%struct.ast_sockaddr* %0) {
%2 = alloca %struct.ast_sockaddr*
store %struct.ast_sockaddr* %0, %struct.ast_sockaddr** %2
%3 = load %struct.ast_sockaddr*, %struct.ast_sockaddr** %2
%4 = call i8* @ast_sockaddr_stringify_fmt(%struct.ast_sockaddr* %3, i32 5)
ret i8* %4
}

LLVM IR (-O2):
%struct.ast_sockaddr = type { i32 }
define i8* @ast_sockaddr_stringify_host(%struct.ast_sockaddr* %0) {
%2 = tail call i8* @ast_sockaddr_stringify_fmt(%struct.ast_sockaddr* %0, i32 5)
ret i8* %2
}
void _longsplit(unsigned value, unsigned *low, unsigned *high) {
  *high = value >> (sizeof(unsigned) * 4);
  *low = value & ((1 << (sizeof(unsigned) * 4)) - 1);
}


x86 assembly (clang, -O0):
<_longsplit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_longsplit>:
movzwl %di,%eax
shr    $0x10,%edi
mov    %edi,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @_longsplit(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = lshr i32 %7, 16
%9 = load i32*, i32** %6
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 65535
%12 = load i32*, i32** %5
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @_longsplit(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = lshr i32 %0, 16
store i32 %4, i32* %2
%5 = and i32 %0, 65535
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void undefinedCommandMsg() { printf("  Undefined command.\n\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c" Undefined command.\0A\00"
define void @undefinedCommandMsg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
int tick_check_broadcast_expired(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tick_check_broadcast_expired() {
ret i32 0
}
/* Variables and functions */
int *calloc(size_t, int);
int *create_table_1D(size_t height, size_t width) {
  return calloc(width * height, sizeof(int));
}


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

x86 assembly (clang, -O2):
<create_table_1D>:
imul   %rsi,%rdi
mov    $0x4,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i32* @create_table_1D(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 = mul i64 %5, %6
%8 = call i32* @calloc(i64 %7, i32 4)
ret i32* %8
}

LLVM IR (-O2):
define i32* @create_table_1D(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i32* @calloc(i64 %3, i32 4)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ askQuestions(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand((time(NULL)));
  askQuestions(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x5,%edi
call   1030 <askQuestions@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x5,%edi
call   1030 <askQuestions@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 @askQuestions(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @askQuestions(i32 5)
ret i32 0
}
void gdk_visual_get_screen() {}


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

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

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

LLVM IR (-O2):
define void @gdk_visual_get_screen() {
ret void
}
/* Type definitions */
typedef int __pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
__pid_t __wait(int *stat_loc) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wait>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
const char *pw_at_offset(const struct passwd *pw, size_t offset) {
  return *(const char **)((const char *)pw + offset);
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i8* @pw_at_offset(%struct.passwd* %0, i64 %1) {
%3 = alloca %struct.passwd*
%4 = alloca i64
store %struct.passwd* %0, %struct.passwd** %3
store i64 %1, i64* %4
%5 = load %struct.passwd*, %struct.passwd** %3
%6 = bitcast %struct.passwd* %5 to i8*
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
ret i8* %10
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i8* @pw_at_offset(%struct.passwd* nocapture %0, i64 %1) {
%3 = bitcast %struct.passwd* %0 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 %1
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
ret i8* %6
}
void cbheap_swap(void **a, void **b) {
  void *c = *a;
  *a = *b;
  *b = c;
}


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

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

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

LLVM IR (-O2):
define void @cbheap_swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
int funcaoH(int m, int n) {
  if (n == 1)
    return m + 1;
  if (m == 1)
    return n + 1;
  return funcaoH(m, n - 1) + funcaoH(m - 1, n);
}


x86 assembly (clang, -O0):
<funcaoH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1136 <funcaoH+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <funcaoH+0x67>
cmpl   $0x1,-0x8(%rbp)
jne    114e <funcaoH+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <funcaoH+0x67>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <funcaoH@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <funcaoH@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcaoH>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x1,%esi
je     1147 <funcaoH+0x37>
mov    %esi,%r14d
cmp    $0x1,%ebx
je     1144 <funcaoH+0x34>
lea    -0x1(%r14),%r15d
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <funcaoH@plt>
add    $0xffffffff,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
jne    1130 <funcaoH+0x20>
mov    %r14d,%ebx
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @funcaoH(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* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %27
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %27
17: ; preds = %11
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = call i32 @funcaoH(i32 %18, i32 %20)
%22 = load i32, i32* %4
%23 = sub nsw i32 %22, 1
%24 = load i32, i32* %5
%25 = call i32 @funcaoH(i32 %23, i32 %24)
%26 = add nsw i32 %21, %25
store i32 %26, i32* %3
br label %27
27: ; preds = %17, %14, %8
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @funcaoH(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = icmp eq i32 %0, 1
br i1 %6, label %14, label %7
7: ; preds = %4, %7
%8 = phi i32 [ %12, %7 ], [ 0, %4 ]
%9 = phi i32 [ %11, %7 ], [ %0, %4 ]
%10 = tail call i32 @funcaoH(i32 %9, i32 %5)
%11 = add nsw i32 %9, -1
%12 = add nsw i32 %10, %8
%13 = icmp eq i32 %11, 1
br i1 %13, label %14, label %7
14: ; preds = %7, %4, %2
%15 = phi i32 [ 0, %2 ], [ 0, %4 ], [ %12, %7 ]
%16 = phi i32 [ %0, %2 ], [ %1, %4 ], [ %1, %7 ]
%17 = add nsw i32 %16, 1
%18 = add nsw i32 %17, %15
ret i32 %18
}
unsigned long t6(unsigned long a, unsigned long b) {
  printf("%s: a: %lu\n", __func__, a);
  printf("%s: b: %lu\n", __func__, b);
  return a + b;
}


x86 assembly (clang, -O0):
<t6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xecb(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t6>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xede(%rip),%rdi
lea    0xee3(%rip),%r15
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s: a: %lu\0A\00"
@__func__.t6 = [3 x i8] c"t6\00"
@.str.1 = [12 x i8] c"%s: b: %lu\0A\00"
define i64 @t6(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t6, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t6, i64 0, i64 0), i64 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = add i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s: a: %lu\0A\00"
@__func__.t6 = [3 x i8] c"t6\00"
@.str.1 = [12 x i8] c"%s: b: %lu\0A\00"
define i64 @t6(i64 %0, i64 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t6, i64 0, i64 0), i64 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t6, i64 0, i64 0), i64 %1)
%5 = add i64 %1, %0
ret i64 %5
}
void uart0_init(void) {
  (*(volatile unsigned long *)0x56000070) |= 0xa0;
  (*(volatile unsigned long *)0x56000078) = 0x0c;
  (*(volatile unsigned long *)0x50000000) = 0x03;
  (*(volatile unsigned long *)0x50000004) = 0x05;
  (*(volatile unsigned long *)0x50000008) = 0x00;
  (*(volatile unsigned long *)0x5000000c) = 0x00;
  (*(volatile unsigned long *)0x50000028) = ((50000000 / (115200 * 16)) - 1);
}


x86 assembly (clang, -O0):
<uart0_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000070,%eax
mov    (%rax),%rcx
or     $0xa0,%rcx
mov    $0x56000070,%eax
mov    %rcx,(%rax)
mov    $0x56000078,%eax
movq   $0xc,(%rax)
mov    $0x50000000,%eax
movq   $0x3,(%rax)
mov    $0x50000004,%eax
movq   $0x5,(%rax)
mov    $0x50000008,%eax
movq   $0x0,(%rax)
mov    $0x5000000c,%eax
movq   $0x0,(%rax)
mov    $0x50000028,%eax
movq   $0x1a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0_init>:
orq    $0xa0,0x56000070
movq   $0xc,0x56000078
movq   $0x3,0x50000000
movq   $0x5,0x50000004
movq   $0x0,0x50000008
movq   $0x0,0x5000000c
movq   $0x1a,0x50000028
ret

LLVM IR (-O0):
define void @uart0_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840688 to i64*)
%2 = or i64 %1, 160
store volatile i64 %2, i64* inttoptr (i64 1442840688 to i64*)
store volatile i64 12, i64* inttoptr (i64 1442840696 to i64*)
store volatile i64 3, i64* inttoptr (i64 1342177280 to i64*)
store volatile i64 5, i64* inttoptr (i64 1342177284 to i64*)
store volatile i64 0, i64* inttoptr (i64 1342177288 to i64*)
store volatile i64 0, i64* inttoptr (i64 1342177292 to i64*)
store volatile i64 26, i64* inttoptr (i64 1342177320 to i64*)
ret void
}

LLVM IR (-O2):
define void @uart0_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840688 to i64*)
%2 = or i64 %1, 160
store volatile i64 %2, i64* inttoptr (i64 1442840688 to i64*)
store volatile i64 12, i64* inttoptr (i64 1442840696 to i64*)
store volatile i64 3, i64* inttoptr (i64 1342177280 to i64*)
store volatile i64 5, i64* inttoptr (i64 1342177284 to i64*)
store volatile i64 0, i64* inttoptr (i64 1342177288 to i64*)
store volatile i64 0, i64* inttoptr (i64 1342177292 to i64*)
store volatile i64 26, i64* inttoptr (i64 1342177320 to i64*)
ret void
}
void idcchar(const char *s2) {
  if (s2)
    ;
}


x86 assembly (clang, -O0):
<idcchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <idcchar+0x18>
jmp    1118 <idcchar+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @idcchar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @idcchar(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t demarshal16(uint8_t *d) { return (*d << 8) | (*(d + 1)); }


x86 assembly (clang, -O0):
<demarshal16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<demarshal16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @demarshal16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strlen(char const *);
scalar_t__ write(int, char const *, int /*<<< orphan*/);
void send_message_self(const char *s, int connfd) {
  if (write(connfd, s, strlen(s)) < 0) {
    perror("Write to descriptor failed");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<send_message_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1194 <send_message_self+0x54>
lea    0xe7b(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message_self>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
js     1165 <send_message_self+0x25>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe94(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Write to descriptor failed\00"
define void @send_message_self(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @write(i32 %5, i8* %6, i32 %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Write to descriptor failed\00"
define void @send_message_self(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @write(i32 %1, i8* %0, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_error(int, char *);
int pthread_join(int /*<<< orphan*/, void **);
void joinThread(pthread_t thread, void **value_ptr) {
  int r = pthread_join(thread, value_ptr);
  if (r != 0) {
    log_error(r, "Error pthread_join()");
    abort();
  }
}


x86 assembly (clang, -O0):
<joinThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_join@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116e <joinThread+0x3e>
mov    -0x14(%rbp),%edi
lea    0xe9e(%rip),%rsi
call   1040 <log_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<joinThread>:
push   %rax
call   1050 <pthread_join@plt>
test   %eax,%eax
jne    113c <joinThread+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rsi
mov    %eax,%edi
call   1040 <log_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Error pthread_join()\00"
define void @joinThread(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @pthread_join(i32 %6, i8** %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 @log_error(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Error pthread_join()\00"
define void @joinThread(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @log_error(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1,
        "\x1b"
        "c"
        "\x1b"
        "(B"
        "\x1b"
        "[0m"
        "\x1b"
        "[J"
        "\x1b"
        "[?25h",
        18);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x12,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x12,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\1Bc\1B(B\1B[0m\1B[J\1B[?25h\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1Bc\1B(B\1B[0m\1B[J\1B[?25h\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 18)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int releaseControlResources() {
  printf("'releaseControlResources()': Nothing to do.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"'releaseControlResources()': Nothing to do.\0A\00"
define i32 @releaseControlResources() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"'releaseControlResources()': Nothing to do.\00"
define i32 @releaseControlResources() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TEST_ASSERT(int);
int get_incremented_value();
void fail(void) { TEST_ASSERT(get_incremented_value() == 2); }


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_incremented_value@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <TEST_ASSERT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
push   %rax
xor    %eax,%eax
call   1030 <get_incremented_value@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
pop    %rax
jmp    1040 <TEST_ASSERT@plt>

LLVM IR (-O0):
define void @fail() {
%1 = call i32 (...) @get_incremented_value()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
%4 = call i32 @TEST_ASSERT(i32 %3)
ret void
}

LLVM IR (-O2):
define void @fail() {
%1 = tail call i32 (...) @get_incremented_value()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @TEST_ASSERT(i32 %3)
ret void
}
void f(int NB, int *a) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0, i32* nocapture %1) {
ret void
}
void saveterm(save) struct termio_dummy *save;
{ ; }


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

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

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

LLVM IR (-O2):
%struct.termio_dummy = type opaque
define void @saveterm(%struct.termio_dummy* nocapture %0) {
ret void
}
int string_length(char *str) {
  int i;
  char *ptr;
  for (i = 0, ptr = str; *(ptr) != '\0'; i++, ptr++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1146 <string_length+0x46>
jmp    112c <string_length+0x2c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <string_length+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
cmpb   $0x0,(%rdi)
je     111c <string_length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <string_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %0, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void ClearAllTabs() { WRITETEST("\033[3g"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[3g\00"
define void @ClearAllTabs() {
%1 = call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[3g\00"
define void @ClearAllTabs() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int nopStat3(void *a1, void *a2, void *a3) { return rand(); }


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

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

LLVM IR (-O0):
define i32 @nopStat3(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 (...) @rand()
ret i32 %7
}

LLVM IR (-O2):
define i32 @nopStat3(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @rand()
ret i32 %4
}
int isxdigit(int c) {
  if (isdigit(c))
    return 1;
  switch (c) {
  case 'a' ... 'f':
  case 'A' ... 'F':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1138 <isxdigit+0x28>
movl   $0x1,-0x4(%rbp)
jmp    117b <isxdigit+0x6b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffbf,%eax
sub    $0x6,%eax
jb     1168 <isxdigit+0x58>
jmp    114f <isxdigit+0x3f>
mov    -0xc(%rbp),%eax
add    $0xffffff9f,%eax
sub    $0x5,%eax
ja     1174 <isxdigit+0x64>
jmp    1163 <isxdigit+0x53>
jmp    1168 <isxdigit+0x58>
movl   $0x1,-0x4(%rbp)
jmp    117b <isxdigit+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%ecx
jb     1125 <isxdigit+0x25>
add    $0xffffffbf,%edi
cmp    $0x25,%edi
ja     1126 <isxdigit+0x26>
movabs $0x3f0000003f,%rcx
bt     %rdi,%rcx
jae    1126 <isxdigit+0x26>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @isdigit(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %3
switch i32 %9, label %12 [
i32 65, label %11
i32 66, label %11
i32 67, label %11
i32 68, label %11
i32 69, label %11
i32 70, label %11
i32 97, label %10
i32 98, label %10
i32 99, label %10
i32 100, label %10
i32 101, label %10
i32 102, label %10
]
10: ; preds = %8, %8, %8, %8, %8, %8
br label %11
11: ; preds = %8, %8, %8, %8, %8, %8, %10
store i32 1, i32* %2
br label %13
12: ; preds = %8
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %6, label %4
4: ; preds = %1
switch i32 %0, label %5 [
i32 65, label %6
i32 66, label %6
i32 67, label %6
i32 68, label %6
i32 69, label %6
i32 70, label %6
i32 97, label %6
i32 98, label %6
i32 99, label %6
i32 100, label %6
i32 101, label %6
i32 102, label %6
]
5: ; preds = %4
br label %6
6: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %4, %4, %4, %4, %1, %5
%7 = phi i32 [ 0, %5 ], [ 1, %1 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ]
ret i32 %7
}
/* Type definitions */
struct sccb_mgr_info {
  int dummy;
};
struct FlashPoint_Info {
  int dummy;
};

/* Variables and functions */
unsigned char FlashPoint_ProbeHostAdapter(struct sccb_mgr_info *);
unsigned char
FlashPoint__ProbeHostAdapter(struct FlashPoint_Info *FlashPointInfo) {
  return FlashPoint_ProbeHostAdapter((struct sccb_mgr_info *)FlashPointInfo);
}


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

x86 assembly (clang, -O2):
<FlashPoint__ProbeHostAdapter>:
jmp    1030 <FlashPoint_ProbeHostAdapter@plt>

LLVM IR (-O0):
%struct.FlashPoint_Info = type { i32 }
%struct.sccb_mgr_info = type { i32 }
define zeroext i8 @FlashPoint__ProbeHostAdapter(%struct.FlashPoint_Info* %0) {
%2 = alloca %struct.FlashPoint_Info*
store %struct.FlashPoint_Info* %0, %struct.FlashPoint_Info** %2
%3 = load %struct.FlashPoint_Info*, %struct.FlashPoint_Info** %2
%4 = bitcast %struct.FlashPoint_Info* %3 to %struct.sccb_mgr_info*
%5 = call zeroext i8 @FlashPoint_ProbeHostAdapter(%struct.sccb_mgr_info* %4)
ret i8 %5
}

LLVM IR (-O2):
%struct.FlashPoint_Info = type { i32 }
%struct.sccb_mgr_info = type { i32 }
define zeroext i8 @FlashPoint__ProbeHostAdapter(%struct.FlashPoint_Info* %0) {
%2 = bitcast %struct.FlashPoint_Info* %0 to %struct.sccb_mgr_info*
%3 = tail call zeroext i8 @FlashPoint_ProbeHostAdapter(%struct.sccb_mgr_info* %2)
ret i8 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_window(void *_p, unsigned long _v) {
  ((XButtonEvent *)_p)->window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XButtonEvent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
unsigned num_constrained(const unsigned flags) {
  const unsigned y = flags | flags >> 1;
  return (y & 1u) + (y >> 2 & 1u);
}


x86 assembly (clang, -O0):
<num_constrained>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_constrained>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
and    $0x1,%ecx
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @num_constrained(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = or i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, 1
%10 = load i32, i32* %3
%11 = lshr i32 %10, 2
%12 = and i32 %11, 1
%13 = add i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @num_constrained(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = and i32 %3, 1
%5 = lshr i32 %3, 2
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %6, %4
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
scalar_t__ sched_getcpu();
int32_t rseq_fallback_current_cpu(void) {
  int32_t cpu;
  cpu = sched_getcpu();
  if (cpu < 0) {
    perror("sched_getcpu()");
    abort();
  }
  return cpu;
}


x86 assembly (clang, -O0):
<rseq_fallback_current_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <sched_getcpu@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1161 <rseq_fallback_current_cpu+0x31>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rseq_fallback_current_cpu>:
push   %rax
xor    %eax,%eax
call   1050 <sched_getcpu@plt>
test   %rax,%rax
js     113f <rseq_fallback_current_cpu+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"sched_getcpu()\00"
define i64 @rseq_fallback_current_cpu() {
%1 = alloca i64
%2 = call i64 (...) @sched_getcpu()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i64, i64* %1
ret i64 %9
}

LLVM IR (-O2):
@.str = [15 x i8] c"sched_getcpu()\00"
define i64 @rseq_fallback_current_cpu() {
%1 = tail call i64 (...) @sched_getcpu()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i64 %1
}
int i_trailing_zero(int a) { return __builtin_ctz(a); }


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

x86 assembly (clang, -O2):
<i_trailing_zero>:
bsf    %edi,%eax
ret

LLVM IR (-O0):
define i32 @i_trailing_zero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @i_trailing_zero(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int LOG_ERR;
int LOG_USER;
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ syslog(int, char *);
int main() {
  FILE *fp;
  fp = fopen("not_exist", "r");
  if (!fp)
    syslog(LOG_ERR | LOG_USER, "Oops - %m\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <main+0x4f>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    0x2e87(%rip),%rax
or     (%rax),%edi
lea    0xea2(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
jne    1157 <main+0x37>
mov    0x2e90(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"not_exist\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_ERR = global i32 0
@LOG_USER = global i32 0
@.str.2 = [11 x i8] c"Oops - %m\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = load i32, i32* @LOG_ERR
%8 = load i32, i32* @LOG_USER
%9 = or i32 %7, %8
%10 = call i32 @syslog(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"not_exist\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_ERR = global i32 0
@LOG_USER = global i32 0
@.str.2 = [11 x i8] c"Oops - %m\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @LOG_ERR
%5 = load i32, i32* @LOG_USER
%6 = or i32 %5, %4
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t le16getv(void *p) {
  uint8_t *a;
  uint16_t v;
  a = p;
  v = a[0];
  v |= a[1] << 8;
  return v;
}


x86 assembly (clang, -O0):
<le16getv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16getv>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @le16getv(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = load i32, i32* %4
%15 = or i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @le16getv(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void HUMIDITY_MAKE_PWR_OUTPUT() {}


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_MAKE_PWR_OUTPUT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crypto_dh_init();
scalar_t__ crypto_early_init();
int subsys_crypto_initialize(void) {
  if (crypto_early_init() < 0)
    return -1;
  crypto_dh_init();
  return 0;
}


x86 assembly (clang, -O0):
<subsys_crypto_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <crypto_early_init@plt>
cmp    $0x0,%rax
jge    1145 <subsys_crypto_initialize+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <subsys_crypto_initialize+0x33>
mov    $0x0,%al
call   1030 <crypto_dh_init@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subsys_crypto_initialize>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <crypto_early_init@plt>
test   %rax,%rax
js     1138 <subsys_crypto_initialize+0x18>
xor    %eax,%eax
call   1030 <crypto_dh_init@plt>
jmp    113d <subsys_crypto_initialize+0x1d>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @subsys_crypto_initialize() {
%1 = alloca i32
%2 = call i64 (...) @crypto_early_init()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @crypto_dh_init()
store i32 0, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @subsys_crypto_initialize() {
%1 = tail call i64 (...) @crypto_early_init()
%2 = icmp slt i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @crypto_dh_init()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpeq_pd(__m128d __a, __m128d __b) {
  return _mm_cmpeq_pd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpeq_pd>:
jmp    1030 <_mm_cmpeq_pd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpeq_pd(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 = call i32 @_mm_cmpeq_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpeq_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAChannelDisable(uint32_t ui32ChannelNum) {
  ;
  (*((volatile uint32_t *)(0x400FF02C))) = 1 << (ui32ChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff02c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelDisable>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff02c
ret

LLVM IR (-O0):
define void @uDMAChannelDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = shl i32 1, %4
store volatile i32 %5, i32* inttoptr (i64 1074786348 to i32*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelDisable(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw i32 1, %2
store volatile i32 %3, i32* inttoptr (i64 1074786348 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M_ASN1_OCTET_STRING_free(void *);
void ocsp_nonce_free(void *a) { M_ASN1_OCTET_STRING_free(a); }


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

x86 assembly (clang, -O2):
<ocsp_nonce_free>:
jmp    1030 <M_ASN1_OCTET_STRING_free@plt>

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

LLVM IR (-O2):
define void @ocsp_nonce_free(i8* %0) {
%2 = tail call i32 @M_ASN1_OCTET_STRING_free(i8* %0)
ret void
}