xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ llog(int, char *, size_t, void *);
void *malloc(size_t);
int /*<<< orphan*/ xmalloc_fatal(char *, int, size_t);
void *xmalloc(size_t size) {
  void *p;
  if (!(p = malloc(size)))
    xmalloc_fatal("xmalloc", 1, size);
  llog(9, "xmalloc(%d): %p\n", size, p);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1168 <xmalloc+0x38>
mov    -0x8(%rbp),%rdx
lea    0xea2(%rip),%rdi
mov    $0x1,%esi
call   1050 <xmalloc_fatal@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x9,%edi
lea    0xe8c(%rip),%rsi
call   1040 <llog@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <xmalloc+0x28>
lea    0xeb5(%rip),%rdi
mov    $0x1,%esi
mov    %r14,%rdx
call   1050 <xmalloc_fatal@plt>
lea    0xea9(%rip),%rsi
mov    $0x9,%edi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <llog@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"xmalloc\00"
@.str.1 = [17 x i8] c"xmalloc(%d): %p\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @xmalloc_fatal(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1, i64 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @llog(i32 9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %0, i8* %2)
ret i8* %2
}
/* Variables and functions */
scalar_t__ malloc(int);
double *zeros(int dim) {
  int i = 0;
  double *vector __attribute__((aligned(16)));
  vector = (double *)malloc(sizeof(double) * dim);
#pragma omp parallel for private(i) schedule(static)
  for (i = 0; i < dim; i++) {
    vector[i] = 0;
  }
  return vector;
}


x86 assembly (clang, -O0):
<zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <zeros+0x56>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <zeros+0x2c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeros>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <zeros+0x29>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double* @zeros(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %4
store i32 0, i32* %3
br label %11
11: ; preds = %20, %1
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load double*, double** %4
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
store double 0.000000e+00, double* %19
br label %20
20: ; preds = %15
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %11
23: ; preds = %11
%24 = load double*, double** %4
ret double* %24
}

LLVM IR (-O2):
define double* @zeros(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = inttoptr i64 %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 3
br label %9
9: ; preds = %5, %1
%10 = inttoptr i64 %3 to double*
ret double* %10
}
/* Variables and functions */
int /*<<< orphan*/ test_skip();
void skip1_test_skip_file_and_function(void) { test_skip(); }


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

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

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

LLVM IR (-O2):
define void @skip1_test_skip_file_and_function() {
%1 = tail call i32 (...) @test_skip()
ret void
}
int test_imm_DEuint16_mem(unsigned short *val) {
  return ((*val) & (-0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff22,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DEuint16_mem>:
movzwl (%rdi),%eax
test   $0xff22,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -222
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_greetings(void) { printf("TLS UNPATCHED\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"TLS UNPATCHED\00"
define void @print_greetings() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_destroy(pthread_cond_t *__cond) { return 0; }


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

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

LLVM IR (-O0):
define i32 @pthread_cond_destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_cond_destroy(i32* nocapture readnone %0) {
ret i32 0
}
void wifi_rsp_sme_wifi_off(const struct wifi_msg_sme_wifi_off_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_wifi_off_rsp_t = type opaque
define void @wifi_rsp_sme_wifi_off(%struct.wifi_msg_sme_wifi_off_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int write_string_to_file(char *, char *, char *);
int write_int_to_file(char *prefix, char *path, int value) {
  char buffer[16];
  snprintf(buffer, sizeof(buffer) - 1, "%d", value);
  buffer[sizeof(buffer) - 1] = '\0';
  return write_string_to_file(prefix, path, buffer);
}


x86 assembly (clang, -O0):
<write_int_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0xf,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
movb   $0x0,-0x21(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <write_string_to_file@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int_to_file>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec8(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xf,%esi
call   1030 <snprintf@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <write_string_to_file@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @write_int_to_file(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %8, i32 15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 15
store i8 0, i8* %11
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%15 = call i32 @write_string_to_file(i8* %12, i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @write_int_to_file(i8* %0, i8* %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 15
store i8 0, i8* %7
%8 = call i32 @write_string_to_file(i8* %0, i8* %1, i8* %5)
ret i32 %8
}
void av_frame_get_decode_error_flags() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_get_decode_error_flags() {
ret void
}
int treadp() {}


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

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

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

LLVM IR (-O2):
define i32 @treadp() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ FileError(char *, char *);
void inconsistent_trial_action_warning(char *s) {
  FileError("inconsistent trial actions for %s", s);
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"inconsistent trial actions for %s\00"
define void @inconsistent_trial_action_warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FileError(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"inconsistent trial actions for %s\00"
define void @inconsistent_trial_action_warning(i8* %0) {
%2 = tail call i32 @FileError(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_chunk {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_ref(struct i8x_object *);
struct i8x_chunk *__attribute__((always_)) i8x_chunk_ref(struct i8x_chunk *x) {
  return (struct i8x_chunk *)i8x_ob_ref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_chunk_ref>:
jmp    1030 <i8x_ob_ref@plt>

LLVM IR (-O0):
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_chunk* @i8x_chunk_ref(%struct.i8x_chunk* %0) {
%2 = alloca %struct.i8x_chunk*
store %struct.i8x_chunk* %0, %struct.i8x_chunk** %2
%3 = load %struct.i8x_chunk*, %struct.i8x_chunk** %2
%4 = bitcast %struct.i8x_chunk* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_ref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_chunk*
ret %struct.i8x_chunk* %6
}

LLVM IR (-O2):
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_chunk* @i8x_chunk_ref(%struct.i8x_chunk* %0) {
%2 = bitcast %struct.i8x_chunk* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_ref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_chunk*
ret %struct.i8x_chunk* %4
}
void ff_hevc_put_hevc_bi_w_qpel_v16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v16_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main() {
  int n;
  while (!feof(stdin)) {
    scanf("%d\n", &n);
    printf("%d\n", n * 10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1162 <main+0x32>
jmp    1187 <main+0x57>
lea    0xe97(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
imul   $0xa,-0x8(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2ea8(%rip),%r15
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1188 <main+0x58>
lea    0xead(%rip),%rbx
lea    0xc(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
je     1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* @stdin
%5 = call i32 @feof(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @stdin
%4 = call i32 @feof(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %0, %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 10
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdin
%12 = call i32 @feof(i32 %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %6, label %14
14: ; preds = %6, %0
ret i32 0
}
float fabsf(float x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <fabsf+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <fabsf+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void foo545() {}


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

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

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

LLVM IR (-O2):
define void @foo545() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t argv_count(char **argv) {
  size_t cnt = 0;
  assert(argv != NULL);
  while (*argv++)
    cnt++;
  return cnt;
}


x86 assembly (clang, -O0):
<argv_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     1160 <argv_count+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <argv_count+0x26>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_count>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
cmpq   $0x0,(%rbx)
je     1141 <argv_count+0x31>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rbx,%rcx,8)
mov    %rax,%rcx
jne    1130 <argv_count+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @argv_count(i8** %0) {
%2 = icmp ne i8** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %14, label %7
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = phi i8** [ %10, %7 ], [ %0, %1 ]
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = add i64 %8, 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %7
14: ; preds = %7, %1
%15 = phi i64 [ 0, %1 ], [ %11, %7 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_KCPSM(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_KCPSM() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("./test -s <stun_srv>\n"
         "./test -s <stun_srv> [-c <local_ip> <local_port>]\n");
}


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

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

LLVM IR (-O0):
@.str = [72 x i8] c"./test -s <stun_srv>\0A./test -s <stun_srv> [-c <local_ip> <local_port>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [71 x i8] c"./test -s <stun_srv>\0A./test -s <stun_srv> [-c <local_ip> <local_port>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
ret void
}
void bitmap_set(void *p, unsigned long long b) {
  unsigned char *ptr = p;
  ptr[b / 8] |= 1U << (b & 7);
}


x86 assembly (clang, -O0):
<bitmap_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_set>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%al
shl    %cl,%al
shr    $0x3,%rsi
or     %al,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @bitmap_set(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i64, i64* %4
%8 = and i64 %7, 7
%9 = trunc i64 %8 to i32
%10 = shl i32 1, %9
%11 = load i8*, i8** %5
%12 = load i64, i64* %4
%13 = udiv i64 %12, 8
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = or i32 %16, %10
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
ret void
}

LLVM IR (-O2):
define void @bitmap_set(i8* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = and i8 %3, 7
%5 = shl nuw i8 1, %4
%6 = lshr i64 %1, 3
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = or i8 %8, %5
store i8 %9, i8* %7
ret void
}
void bitcomp_handler(void) { push(~pop()); }


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

x86 assembly (clang, -O2):
<bitcomp_handler>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
not    %eax
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @bitcomp_handler() {
%1 = call i32 (...) @pop()
%2 = xor i32 %1, -1
%3 = call i32 (i32, ...) bitcast (i32 (...)* @push to i32 (i32, ...)*)(i32 %2)
ret void
}

LLVM IR (-O2):
define void @bitcomp_handler() {
%1 = tail call i32 (...) @pop()
%2 = xor i32 %1, -1
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @push to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void ts_die(const char *plaint) {
  fprintf(stderr, "%s\n", plaint);
  exit(1);
}


x86 assembly (clang, -O0):
<ts_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ts_die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ts_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ts_die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mainSample();
int mainT(void) {
  mainSample();
  return 0;
}


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

x86 assembly (clang, -O2):
<mainT>:
push   %rax
xor    %eax,%eax
call   1030 <mainSample@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mainT() {
%1 = call i32 (...) @mainSample()
ret i32 0
}

LLVM IR (-O2):
define i32 @mainT() {
%1 = tail call i32 (...) @mainSample()
ret i32 0
}
double _three_way_min(const double cost0, const double cost1,
                      const double cost2) {
  if ((cost0 <= cost1) && (cost0 <= cost2)) {
    return cost0;
  }
  if (cost1 <= cost2) {
    return cost1;
  }
  return cost2;
}


x86 assembly (clang, -O0):
<_three_way_min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     114a <_three_way_min+0x4a>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     114a <_three_way_min+0x4a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1177 <_three_way_min+0x77>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     116d <_three_way_min+0x6d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1177 <_three_way_min+0x77>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_three_way_min>:
movapd %xmm1,%xmm4
cmplesd %xmm2,%xmm4
movapd %xmm4,%xmm3
andpd  %xmm1,%xmm3
andnpd %xmm2,%xmm4
orpd   %xmm3,%xmm4
movapd %xmm0,%xmm3
cmpnlesd %xmm1,%xmm3
movapd %xmm3,%xmm1
andpd  %xmm4,%xmm1
movapd %xmm0,%xmm5
cmpnlesd %xmm2,%xmm5
andpd  %xmm5,%xmm4
andnpd %xmm0,%xmm5
orpd   %xmm4,%xmm5
andnpd %xmm5,%xmm3
orpd   %xmm1,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @_three_way_min(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp ole double %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fcmp ole double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load double, double* %5
store double %16, double* %4
br label %25
17: ; preds = %11, %3
%18 = load double, double* %6
%19 = load double, double* %7
%20 = fcmp ole double %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load double, double* %6
store double %22, double* %4
br label %25
23: ; preds = %17
%24 = load double, double* %7
store double %24, double* %4
br label %25
25: ; preds = %23, %21, %15
%26 = load double, double* %4
ret double %26
}

LLVM IR (-O2):
define double @_three_way_min(double %0, double %1, double %2) {
%4 = fcmp ugt double %0, %1
%5 = fcmp ugt double %0, %2
%6 = or i1 %4, %5
%7 = fcmp ole double %1, %2
%8 = select i1 %7, double %1, double %2
%9 = select i1 %6, double %8, double %0
ret double %9
}
/* Variables and functions */
int fmax(int x, int y) { return x > y ? x : y; }


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

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

LLVM IR (-O0):
define i32 @fmax(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
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @fmax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int rpmatch(const char *response) {
  return (*response == 'y' || *response == 'Y'   ? 1
          : *response == 'n' || *response == 'N' ? 0
                                                 : -1);
}


x86 assembly (clang, -O0):
<rpmatch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x79,%eax
je     1128 <rpmatch+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x59,%eax
jne    1135 <rpmatch+0x35>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <rpmatch+0x6d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x6e,%ecx
mov    %al,-0xd(%rbp)
je     115a <rpmatch+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4e,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
mov    $0xffffffff,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmatch>:
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x59,%cl
je     1120 <rpmatch+0x20>
cmp    $0x6e,%cl
je     1121 <rpmatch+0x21>
cmp    $0x79,%cl
je     1120 <rpmatch+0x20>
xor    %eax,%eax
cmp    $0x4e,%cl
setne  %al
neg    %eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rpmatch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 121
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 89
br i1 %11, label %12, label %13
12: ; preds = %7, %1
br label %27
13: ; preds = %7
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 110
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 78
br label %23
23: ; preds = %18, %13
%24 = phi i1 [ true, %13 ], [ %22, %18 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 0, i32 -1
br label %27
27: ; preds = %23, %12
%28 = phi i32 [ 1, %12 ], [ %26, %23 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @rpmatch(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 121, label %8
i8 89, label %8
i8 110, label %6
]
3: ; preds = %1
%4 = icmp ne i8 %2, 78
%5 = sext i1 %4 to i32
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
br label %8
8: ; preds = %1, %1, %6
%9 = phi i32 [ %7, %6 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  int x, y;
  scanf("%d%d", &x, &y);
  printf("%d\n", add(x, y));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <add@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @add(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Dispose();
int /*<<< orphan*/ Init();
int /*<<< orphan*/ Receiver();
int main() {
  Init();
  Receiver();
  Dispose();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <Init@plt>
mov    $0x0,%al
call   1040 <Receiver@plt>
mov    $0x0,%al
call   1030 <Dispose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <Init@plt>
xor    %eax,%eax
call   1040 <Receiver@plt>
xor    %eax,%eax
call   1030 <Dispose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Init()
%3 = call i32 (...) @Receiver()
%4 = call i32 (...) @Dispose()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Init()
%2 = tail call i32 (...) @Receiver()
%3 = tail call i32 (...) @Dispose()
ret i32 0
}
void I_ResumeCD(void) {}


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

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

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

LLVM IR (-O2):
define void @I_ResumeCD() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void stop() { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<stop>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @stop() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @stop() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct chunk *);
void free_chunk(struct chunk *c) { free(c); }


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

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

LLVM IR (-O2):
%struct.chunk = type { i32 }
define void @free_chunk(%struct.chunk* nocapture %0) {
%2 = tail call i32 @free(%struct.chunk* %0)
ret void
}
/* Variables and functions */
int print(int /*<<< orphan*/, int *);
int printf(const char *format, ...) {
  int *varg = (int *)(char *)(&format);
  return print(0, varg);
}


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

x86 assembly (clang, -O2):
<printf>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <print@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = bitcast i8** %2 to i8*
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @print(i32 0, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i32*
%4 = call i32 @print(i32 0, i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ testComma();
int main() {
  testComma();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testComma()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testComma()
ret i32 0
}
int test_imm_3Bint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x3B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Bint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3866624
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned xrop3_118_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~S;
  stk3 = T & stk4;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_118_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
shl    $0x8,%esi
not    %eax
and    %esi,%eax
or     $0xff,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_118_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, 255
%11 = xor i32 %10, %5
ret i32 %11
}
/* Variables and functions */
int link1(int);
int link2(int n) { return link1(n); }


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

x86 assembly (clang, -O2):
<link2>:
jmp    1030 <link1@plt>

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

LLVM IR (-O2):
define i32 @link2(i32 %0) {
%2 = tail call i32 @link1(i32 %0)
ret i32 %2
}
void avcodec_get_class() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_get_class() {
ret void
}
void STEAM_LogLevelLoadStarted(const char *name) {}


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

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

LLVM IR (-O0):
define void @STEAM_LogLevelLoadStarted(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @STEAM_LogLevelLoadStarted(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharOM(void) { printf("\x01B(0\x077\x01B(B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0w\1B(B\00"
define void @putLDCharOM() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int raw_irqs_disabled_flags(unsigned long flags) { return !(flags & (1 << 9)); }


x86 assembly (clang, -O0):
<raw_irqs_disabled_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x200,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_irqs_disabled_flags>:
xor    %eax,%eax
test   $0x200,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 512
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 9
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}
void native_add_command_line_opts(struct args_struct_t *args) {
  void bs_add_extra_dynargs(struct args_struct_t * args);
  bs_add_extra_dynargs(args);
}


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

x86 assembly (clang, -O2):
<native_add_command_line_opts>:
jmp    1030 <bs_add_extra_dynargs@plt>

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

LLVM IR (-O2):
%struct.args_struct_t = type opaque
define void @native_add_command_line_opts(%struct.args_struct_t* %0) {
tail call void @bs_add_extra_dynargs(%struct.args_struct_t* %0)
ret void
}
moo(__sp, __fuck) {}


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

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

LLVM IR (-O0):
define i32 @moo(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @moo(i32 %0, i32 %1) {
ret i32 undef
}