xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double display_intermediate_harris_results(double harris_poll) {
  harris_poll = harris_poll / 2850;
  printf("Intermediate Results - Harris Poll = %lf\n", harris_poll);
  return 0;
}


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

x86 assembly (clang, -O2):
<display_intermediate_harris_results>:
push   %rax
divsd  0xee7(%rip),%xmm0
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Intermediate Results - Harris Poll = %lf\0A\00"
define double @display_intermediate_harris_results(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.850000e+03
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), double %5)
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [42 x i8] c"Intermediate Results - Harris Poll = %lf\0A\00"
define double @display_intermediate_harris_results(double %0) {
%2 = fdiv double %0, 2.850000e+03
%3 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), double %2)
ret double 0.000000e+00
}
int(isupper)(int c) { return isupper(c); }


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

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

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

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
ret i32 undef
}
int int_floorlog2(int a) {
  int l;
  for (l = 0; a > 1; l++) {
    a >>= 1;
  }
  return l;
}


x86 assembly (clang, -O0):
<int_floorlog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <int_floorlog2+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <int_floorlog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_floorlog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <int_floorlog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <int_floorlog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_floorlog2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void foo_2_2_2_2_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_1_2_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ls(char const *);
void ls_command(const char *dir) { ls(dir); }


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

x86 assembly (clang, -O2):
<ls_command>:
jmp    1030 <ls@plt>

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

LLVM IR (-O2):
define void @ls_command(i8* %0) {
%2 = tail call i32 @ls(i8* %0)
ret void
}
/* Type definitions */
struct wl_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_surface, user_data);
}


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

x86 assembly (clang, -O2):
<wl_surface_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_set_user_data(%struct.wl_surface* %0, i8* %1) {
%3 = alloca %struct.wl_surface*
%4 = alloca i8*
store %struct.wl_surface* %0, %struct.wl_surface** %3
store i8* %1, i8** %4
%5 = load %struct.wl_surface*, %struct.wl_surface** %3
%6 = bitcast %struct.wl_surface* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_set_user_data(%struct.wl_surface* %0, i8* %1) {
%3 = bitcast %struct.wl_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
char GetEncoding0() { return 0x27; }


x86 assembly (clang, -O0):
<GetEncoding0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEncoding0>:
mov    $0x27,%al
ret

LLVM IR (-O0):
define signext i8 @GetEncoding0() {
ret i8 39
}

LLVM IR (-O2):
define signext i8 @GetEncoding0() {
ret i8 39
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void default_oom(void) {
  fprintf(stderr, "Out of memory.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<default_oom>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<default_oom>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
@EXIT_FAILURE = global i32 0
define void @default_oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
@EXIT_FAILURE = global i32 0
define void @default_oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int test_imm_E3int32_reg(int val) { return ((val) & (0xE3 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_E3int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E3int32_reg(i32 %0) {
%2 = and i32 %0, 227
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_clock_gettime;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, struct timespec *);
int sys_clock_gettime(clockid_t id, struct timespec *ts) {
  return syscall(SYS_clock_gettime, id, ts);
}


x86 assembly (clang, -O0):
<sys_clock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_clock_gettime>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ed4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_clock_gettime = global i32 0
define i32 @sys_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* @SYS_clock_gettime
%6 = load i32, i32* %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @syscall(i32 %5, i32 %6, %struct.timespec* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_clock_gettime = global i32 0
define i32 @sys_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = load i32, i32* @SYS_clock_gettime
%4 = tail call i32 @syscall(i32 %3, i32 %0, %struct.timespec* %1)
ret i32 %4
}
/* Variables and functions */
char **createChessBoard();
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char **board = createChessBoard();
  free(board[1]);
  printf("Hooray!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <createChessBoard@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <free@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <createChessBoard@plt>
mov    0x8(%rax),%rdi
call   1030 <free@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"Hooray!\00"
define i32 @main() {
%1 = tail call i8** (...) @createChessBoard()
%2 = getelementptr inbounds i8*, i8** %1, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flusha();
int /*<<< orphan*/ printf(char *, char const *);
void err(const char *msg) {
  printf("-ERR %s\r\n", msg);
  flusha();
}


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

x86 assembly (clang, -O2):
<err>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <flusha@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"-ERR %s\0D\0A\00"
define void @err(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @flusha()
ret void
}
void gtk_widget_size_request() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_size_request() {
ret void
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int socket_handler_get_connection(int sock) {
  int t;
  if ((t = accept(sock, NULL, NULL)) < 0) {
    return -1;
  }
  return t;
}


x86 assembly (clang, -O0):
<socket_handler_get_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <accept@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1142 <socket_handler_get_connection+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <socket_handler_get_connection+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_handler_get_connection>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1030 <accept@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @socket_handler_get_connection(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
int /*<<< orphan*/ write_through_ptr(int *, int);
void test_36(int i) {
  __analyzer_eval(i == 42);
  write_through_ptr(&i, 42);
  __analyzer_eval(i == 42);
}


x86 assembly (clang, -O0):
<test_36>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
lea    -0x4(%rbp),%rdi
mov    $0x2a,%esi
call   1040 <write_through_ptr@plt>
cmpl   $0x2a,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_36>:
push   %rax
mov    %edi,0x4(%rsp)
xor    %eax,%eax
cmp    $0x2a,%edi
sete   %al
mov    %eax,%edi
call   1030 <__analyzer_eval@plt>
lea    0x4(%rsp),%rdi
mov    $0x2a,%esi
call   1040 <write_through_ptr@plt>
xor    %edi,%edi
cmpl   $0x2a,0x4(%rsp)
sete   %dil
call   1030 <__analyzer_eval@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_36(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 42
%5 = zext i1 %4 to i32
%6 = call i32 @__analyzer_eval(i32 %5)
%7 = call i32 @write_through_ptr(i32* %2, i32 42)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 42
%10 = zext i1 %9 to i32
%11 = call i32 @__analyzer_eval(i32 %10)
ret void
}

LLVM IR (-O2):
define void @test_36(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = icmp eq i32 %0, 42
%4 = zext i1 %3 to i32
%5 = tail call i32 @__analyzer_eval(i32 %4)
%6 = call i32 @write_through_ptr(i32* %2, i32 42)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 42
%9 = zext i1 %8 to i32
%10 = call i32 @__analyzer_eval(i32 %9)
ret void
}
void kasan_cache_create(struct kmem_cache *cache, unsigned long *size,
                        unsigned long *flags) {}


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

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

LLVM IR (-O0):
%struct.kmem_cache = type opaque
define void @kasan_cache_create(%struct.kmem_cache* %0, i64* %1, i64* %2) {
%4 = alloca %struct.kmem_cache*
%5 = alloca i64*
%6 = alloca i64*
store %struct.kmem_cache* %0, %struct.kmem_cache** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
ret void
}

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @kasan_cache_create(%struct.kmem_cache* nocapture %0, i64* nocapture %1, i64* nocapture %2) {
ret void
}
void tick_suspend_broadcast(void) {}


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

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

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

LLVM IR (-O2):
define void @tick_suspend_broadcast() {
ret void
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};

/* Variables and functions */
size_t sockaddr_size(void) { return sizeof(struct sockaddr_storage); }


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

x86 assembly (clang, -O2):
<sockaddr_size>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i64 @sockaddr_size() {
ret i64 4
}

LLVM IR (-O2):
define i64 @sockaddr_size() {
ret i64 4
}
char *lib_strchr(const char *dest, int c) {
  while (*dest) {
    if (*dest == c)
      return (char *)dest;
    dest++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<lib_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <lib_strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <lib_strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <lib_strchr+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <lib_strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <lib_strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <lib_strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <lib_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @lib_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
int setSelection_BaseScreen(int startColumn, int startRow, int endColumn,
                            int endRow) {
  return 0;
}


x86 assembly (clang, -O0):
<setSelection_BaseScreen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setSelection_BaseScreen(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @setSelection_BaseScreen(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
int sc_is_digit(char el) { return (('0' <= el && el <= '9')) ? 1 : 0; }


x86 assembly (clang, -O0):
<sc_is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <sc_is_digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sc_is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *error() {
  char *teste = malloc(20);
  strcpy(teste, "Isto eh um teste!\n");
  return teste;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Isto eh um teste!\0A\00"
define i8* @error() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 20)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [19 x i8] c"Isto eh um teste!\0A\00"
define i8* @error() {
%1 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int test_imm_62int64_midword_reg(long long val) {
  return ((val >> 16) & (0x62 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_62int64_midword_reg>:
test   $0x620000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_62int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 98
%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_62int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6422528
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bignum_integer_length(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ tag_bignum(int /*<<< orphan*/);
int /*<<< orphan*/ untag_object(int /*<<< orphan*/);
void primitive_bignum_log2(void) {
  drepl(tag_bignum(bignum_integer_length(untag_object(dpeek()))));
}


x86 assembly (clang, -O0):
<primitive_bignum_log2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1060 <bignum_integer_length@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_bignum_log2>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1060 <bignum_integer_length@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_bignum_log2() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @untag_object(i32 %1)
%3 = call i32 @bignum_integer_length(i32 %2)
%4 = call i32 @tag_bignum(i32 %3)
%5 = call i32 @drepl(i32 %4)
ret void
}

LLVM IR (-O2):
define void @primitive_bignum_log2() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @untag_object(i32 %1)
%3 = tail call i32 @bignum_integer_length(i32 %2)
%4 = tail call i32 @tag_bignum(i32 %3)
%5 = tail call i32 @drepl(i32 %4)
ret void
}
/* Variables and functions */
unsigned short bitreverse1(int /*<<< orphan*/);
int /*<<< orphan*/ bitreverse2(int /*<<< orphan*/);
int /*<<< orphan*/ bitreverse4(int /*<<< orphan*/);
int /*<<< orphan*/ bitreverse8(unsigned short);
unsigned short bitreverse(unsigned short i) {
  return bitreverse1(bitreverse2(bitreverse4(bitreverse8(i))));
}


x86 assembly (clang, -O0):
<bitreverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1050 <bitreverse8@plt>
mov    %eax,%edi
call   1040 <bitreverse4@plt>
mov    %eax,%edi
call   1060 <bitreverse2@plt>
mov    %eax,%edi
call   1030 <bitreverse1@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitreverse>:
push   %rax
call   1050 <bitreverse8@plt>
mov    %eax,%edi
call   1040 <bitreverse4@plt>
mov    %eax,%edi
call   1060 <bitreverse2@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <bitreverse1@plt>

LLVM IR (-O0):
define zeroext i16 @bitreverse(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @bitreverse8(i16 zeroext %3)
%5 = call i32 @bitreverse4(i32 %4)
%6 = call i32 @bitreverse2(i32 %5)
%7 = call zeroext i16 @bitreverse1(i32 %6)
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @bitreverse(i16 zeroext %0) {
%2 = tail call i32 @bitreverse8(i16 zeroext %0)
%3 = tail call i32 @bitreverse4(i32 %2)
%4 = tail call i32 @bitreverse2(i32 %3)
%5 = tail call zeroext i16 @bitreverse1(i32 %4)
ret i16 %5
}
int addition(int a, int b) {
  int result, temporaire;
  temporaire = a;
  result = temporaire + b;
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @addition(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct url {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fetchXGet(struct url *, int /*<<< orphan*/ *, char const *);
FILE *fetchGet(struct url *URL, const char *flags) {
  return (fetchXGet(URL, NULL, flags));
}


x86 assembly (clang, -O0):
<fetchGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <fetchXGet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetchGet>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <fetchXGet@plt>

LLVM IR (-O0):
%struct.url = type { i32 }
define i32* @fetchGet(%struct.url* %0, i8* %1) {
%3 = alloca %struct.url*
%4 = alloca i8*
store %struct.url* %0, %struct.url** %3
store i8* %1, i8** %4
%5 = load %struct.url*, %struct.url** %3
%6 = load i8*, i8** %4
%7 = call i32* @fetchXGet(%struct.url* %5, i32* null, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
%struct.url = type { i32 }
define i32* @fetchGet(%struct.url* %0, i8* %1) {
%3 = tail call i32* @fetchXGet(%struct.url* %0, i32* null, i8* %1)
ret i32* %3
}
void fftss_cleanup_threads(void) { return; }


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

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

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

LLVM IR (-O2):
define void @fftss_cleanup_threads() {
ret void
}
long mod_sum(long x, long y, long mod) {
  if (y >= mod - x) {
    return y - (mod - x);
  } else {
    return y + x;
  }
}


x86 assembly (clang, -O0):
<mod_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
jl     113d <mod_sum+0x3d>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <mod_sum+0x49>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_sum>:
sub    %rdi,%rdx
mov    %rdx,%rax
neg    %rax
cmp    %rsi,%rdx
cmovg  %rdi,%rax
add    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @mod_sum(i64 %0, i64 %1, i64 %2) {
%4 = sub nsw i64 %2, %0
%5 = icmp sgt i64 %4, %1
%6 = sub i64 0, %4
%7 = select i1 %5, i64 %0, i64 %6
%8 = add i64 %7, %1
ret i64 %8
}
void EDIPARTYNAME_new(void) {}


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

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

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

LLVM IR (-O2):
define void @EDIPARTYNAME_new() {
ret void
}
/* Variables and functions */
int inb(unsigned int);
int serial_fifo_empty(unsigned int com) { return inb((com + 5)) & 0x20; }


x86 assembly (clang, -O0):
<serial_fifo_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x5,%edi
call   1030 <inb@plt>
and    $0x20,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_fifo_empty>:
push   %rax
add    $0x5,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_fifo_empty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 5
%5 = call i32 @inb(i32 %4)
%6 = and i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
define i32 @serial_fifo_empty(i32 %0) {
%2 = add i32 %0, 5
%3 = tail call i32 @inb(i32 %2)
%4 = and i32 %3, 32
ret i32 %4
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
unsigned int tipc_cluster(__u32 addr) { return (addr >> 12) & 0xfff; }


x86 assembly (clang, -O0):
<tipc_cluster>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
and    $0xfff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tipc_cluster>:
mov    %edi,%eax
shr    $0xc,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @tipc_cluster(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 12
%5 = and i32 %4, 4095
ret i32 %5
}

LLVM IR (-O2):
define i32 @tipc_cluster(i32 %0) {
%2 = lshr i32 %0, 12
%3 = and i32 %2, 4095
ret i32 %3
}
int gettext_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gettext_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_166(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_166() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
bool fields_crlf(char ch) { return (ch == 13) || (ch == 10); }


x86 assembly (clang, -O0):
<fields_crlf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1129 <fields_crlf+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fields_crlf>:
cmp    $0xd,%dil
sete   %al
cmp    $0xa,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @fields_crlf(i8 signext %0) {
%2 = icmp eq i8 %0, 13
%3 = icmp eq i8 %0, 10
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool branch_conditional_is_conditional(uint32_t insn) {
  return !!(((((insn) >> 21) & 0x1f) & 0x14) != 0x14);
}


x86 assembly (clang, -O0):
<branch_conditional_is_conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x15,%eax
and    $0x1f,%eax
and    $0x14,%eax
cmp    $0x14,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<branch_conditional_is_conditional>:
not    %edi
xor    %eax,%eax
test   $0x2800000,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @branch_conditional_is_conditional(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 21
%5 = and i32 %4, 31
%6 = and i32 %5, 20
%7 = icmp ne i32 %6, 20
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @branch_conditional_is_conditional(i32 %0) {
%2 = and i32 %0, 41943040
%3 = icmp ne i32 %2, 41943040
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(float);
main() { f(1.2f); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  0xee4(%rip),%xmm0
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(float 0x3FF3333340000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(float 0x3FF3333340000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void text_importfree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @text_importfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PlaySoundExt(int, int, int, int /*<<< orphan*/);
void PlaySound(int nr) { PlaySoundExt(nr, 128, (255 / 2), ((0))); }


x86 assembly (clang, -O0):
<PlaySound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x80,%esi
mov    $0x7f,%edx
xor    %ecx,%ecx
call   1030 <PlaySoundExt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PlaySound>:
mov    $0x80,%esi
mov    $0x7f,%edx
xor    %ecx,%ecx
jmp    1030 <PlaySoundExt@plt>

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

LLVM IR (-O2):
define void @PlaySound(i32 %0) {
%2 = tail call i32 @PlaySoundExt(i32 %0, i32 128, i32 127, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f0() { printf("a\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"a\00"
define void @f0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Hw32xInit(int, int /*<<< orphan*/);
void mars_init(void) { Hw32xInit(0x0001, 0); }


x86 assembly (clang, -O0):
<mars_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <Hw32xInit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mars_init>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <Hw32xInit@plt>

LLVM IR (-O0):
define void @mars_init() {
%1 = call i32 @Hw32xInit(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @mars_init() {
%1 = tail call i32 @Hw32xInit(i32 1, i32 0)
ret void
}
long falcom_read_bit_flags(unsigned char *buf, long *buf_off,
                           unsigned long *bit_flags, int *bit_flags_len) {
  (*bit_flags) |= *((unsigned short *)(buf + *buf_off)) << *bit_flags_len;
  (*bit_flags_len) += 16;
  (*buf_off) += 2;
  return 2;
}


x86 assembly (clang, -O0):
<falcom_read_bit_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movzwl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x10,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<falcom_read_bit_flags>:
mov    %rcx,%rax
mov    (%rsi),%rcx
movzwl (%rdi,%rcx,1),%edi
mov    (%rax),%ecx
shl    %cl,%edi
movslq %edi,%rdi
or     %rdi,(%rdx)
add    $0x10,%ecx
mov    %ecx,(%rax)
addq   $0x2,(%rsi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i64 @falcom_read_bit_flags(i8* %0, i64* %1, i64* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32*
store i8* %0, i8** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64*, i64** %6
%11 = load i64, i64* %10
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = bitcast i8* %12 to i16*
%14 = load i16, i16* %13
%15 = zext i16 %14 to i32
%16 = load i32*, i32** %8
%17 = load i32, i32* %16
%18 = shl i32 %15, %17
%19 = sext i32 %18 to i64
%20 = load i64*, i64** %7
%21 = load i64, i64* %20
%22 = or i64 %21, %19
store i64 %22, i64* %20
%23 = load i32*, i32** %8
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 16
store i32 %25, i32* %23
%26 = load i64*, i64** %6
%27 = load i64, i64* %26
%28 = add nsw i64 %27, 2
store i64 %28, i64* %26
ret i64 2
}

LLVM IR (-O2):
define i64 @falcom_read_bit_flags(i8* nocapture %0, i64* nocapture %1, i64* nocapture %2, i32* nocapture %3) {
%5 = load i64, i64* %1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = bitcast i8* %6 to i16*
%8 = load i16, i16* %7
%9 = zext i16 %8 to i32
%10 = load i32, i32* %3
%11 = shl i32 %9, %10
%12 = sext i32 %11 to i64
%13 = load i64, i64* %2
%14 = or i64 %13, %12
store i64 %14, i64* %2
%15 = add nsw i32 %10, 16
store i32 %15, i32* %3
%16 = load i64, i64* %1
%17 = add nsw i64 %16, 2
store i64 %17, i64* %1
ret i64 2
}
void test___atomic_fetch_and_0(char *mem) { __atomic_fetch_and(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_and_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test___atomic_fetch_and_0+0x4a>
jmp    111f <test___atomic_fetch_and_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_and_0>:
lock andb $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_fetch_and_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw and i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_and_0(i8* nocapture %0) {
%2 = atomicrmw and i8* %0, i8 1 acq_rel
ret void
}
int rho_ruby_to_str_ex(unsigned long val, const char **dest, int *len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_to_str_ex(i64 %0, i8** nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, void const *);
int default_print(const void *data, FILE *fp) {
  return fprintf(fp, "%p", data);
}


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

x86 assembly (clang, -O2):
<default_print>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%p\00"
define i32 @default_print(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i32 @default_print(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %3
}
/* Variables and functions */
char *oauth_serialize_url_sep(int, int, char **, char *);
char *oauth_serialize_url(int argc, int start, char **argv) {
  return oauth_serialize_url_sep(argc, start, argv, "&");
}


x86 assembly (clang, -O0):
<oauth_serialize_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rcx
call   1030 <oauth_serialize_url_sep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oauth_serialize_url>:
lea    0xee9(%rip),%rcx
jmp    1030 <oauth_serialize_url_sep@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"&\00"
define i8* @oauth_serialize_url(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
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = call i8* @oauth_serialize_url_sep(i32 %7, i32 %8, i8** %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"&\00"
define i8* @oauth_serialize_url(i32 %0, i32 %1, i8** %2) {
%4 = tail call i8* @oauth_serialize_url_sep(i32 %0, i32 %1, i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
int main() {
  char arr[] = {2, 'a'};
  return (int)(arr[0] + arr[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%ax
mov    %ax,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x63,%eax
ret

LLVM IR (-O0):
@__const.main.arr = [2 x i8] c"\02a"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ viterm();
vdterm() { viterm(); }


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

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

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

LLVM IR (-O2):
define i32 @vdterm() {
%1 = tail call i32 (...) @viterm()
ret i32 undef
}
void PreInit_board(void) {}


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

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

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

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