xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, char *, int);
int main() {
  char c;
  while (read(STDIN_FILENO, &c, 1) == 1 && c != 'q')
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x6(%rbp)
jne    1153 <main+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    1163 <main+0x53>
jmp    1168 <main+0x58>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
lea    0x7(%rsp),%rbx
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    113c <main+0x2c>
cmpb   $0x71,0x7(%rsp)
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* @STDIN_FILENO
%5 = call i32 @read(i32 %4, i8* %2, i32 1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 113
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ false, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %3
14: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i8* %1, i32 1)
%5 = icmp eq i32 %4, 1
%6 = load i8, i8* %1
%7 = icmp ne i8 %6, 113
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(0);
  foo(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
ret i32 0
}
XSetFont() {}


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

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

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

LLVM IR (-O2):
define i32 @XSetFont() {
ret i32 undef
}
/* Type definitions */
struct strategy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void left_justify(struct strategy *strat, char *line) { printf("left "); }


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

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

LLVM IR (-O0):
%struct.strategy = type { i32 }
@.str = [6 x i8] c"left \00"
define void @left_justify(%struct.strategy* %0, i8* %1) {
%3 = alloca %struct.strategy*
%4 = alloca i8*
store %struct.strategy* %0, %struct.strategy** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.strategy = type { i32 }
@.str = [6 x i8] c"left \00"
define void @left_justify(%struct.strategy* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_add_int32_t(int /*<<< orphan*/ *, int);
int32_t atomic_inc_int32_t(int32_t *var) { return atomic_add_int32_t(var, 1); }


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

x86 assembly (clang, -O2):
<atomic_inc_int32_t>:
mov    $0x1,%esi
jmp    1030 <atomic_add_int32_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_inc_int32_t(i32* %0) {
%2 = tail call i32 @atomic_add_int32_t(i32* %0, i32 1)
ret i32 %2
}
__attribute__((weak)) int write_stdout(const unsigned char *ptr,
                                       unsigned int len) {
  do {
    (void)(ptr);
  } while (0);
  do {
    (void)(len);
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<write_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
jmp    1110 <write_stdout+0x10>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define weak i32 @write_stdout(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i8*, i8** %3
br label %7
7: ; preds = %5
br label %8
8: ; preds = %7
%9 = load i32, i32* %4
br label %10
10: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define weak i32 @write_stdout(i8* %0, i32 %1) {
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_h8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h8_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void tx_request_command() {
  unsigned char r_val;
  printf("Send transmit-request \n");
  r_val = *((unsigned char *)(0xfffc0001)) | 0x01;
  *((unsigned char *)(0xfffc0001)) = r_val;
  printf("command register: 0x%X \n\n", *((unsigned char *)(0xfffc0001)));
}


x86 assembly (clang, -O0):
<tx_request_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0001,%eax
movzbl (%rax),%eax
or     $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xfffc0001,%eax
mov    %cl,(%rax)
mov    $0xfffc0001,%eax
movzbl (%rax),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_request_command>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffc0001,%eax
movzbl (%rax),%esi
or     $0x1,%esi
mov    %sil,(%rax)
lea    0xebe(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Send transmit-request \0A\00"
@.str.1 = [26 x i8] c"command register: 0x%X \0A\0A\00"
define void @tx_request_command() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* inttoptr (i64 4294705153 to i8*)
%4 = zext i8 %3 to i32
%5 = or i32 %4, 1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
store i8 %7, i8* inttoptr (i64 4294705153 to i8*)
%8 = load i8, i8* inttoptr (i64 4294705153 to i8*)
%9 = zext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"command register: 0x%X \0A\0A\00"
@str = [23 x i8] c"Send transmit-request \00"
define void @tx_request_command() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = load i8, i8* inttoptr (i64 4294705153 to i8*)
%3 = or i8 %2, 1
store i8 %3, i8* inttoptr (i64 4294705153 to i8*)
%4 = zext i8 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
unsigned int BWTOccValueMinorSizeInWord(const unsigned int numChar) {
  unsigned int numOfOccValue;
  numOfOccValue = (numChar + 256 - 1) / 256 + 1;
  return (numOfOccValue + 2 - 1) / 2 * 4;
}


x86 assembly (clang, -O0):
<BWTOccValueMinorSizeInWord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%eax
sub    $0x1,%eax
shr    $0x8,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
sub    $0x1,%eax
shr    $0x1,%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BWTOccValueMinorSizeInWord>:
add    $0xff,%edi
shr    $0x8,%edi
lea    (%rdi,%rdi,1),%eax
add    $0x4,%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @BWTOccValueMinorSizeInWord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 256
%6 = sub i32 %5, 1
%7 = udiv i32 %6, 256
%8 = add i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = add i32 %9, 2
%11 = sub i32 %10, 1
%12 = udiv i32 %11, 2
%13 = mul i32 %12, 4
ret i32 %13
}

LLVM IR (-O2):
define i32 @BWTOccValueMinorSizeInWord(i32 %0) {
%2 = add i32 %0, 255
%3 = lshr i32 %2, 7
%4 = and i32 %3, 33554430
%5 = add nuw nsw i32 %4, 4
%6 = and i32 %5, 67108860
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ d86f_common_format(int, int, int, int /*<<< orphan*/, int);
void d86f_proxy_format(int drive, int side, int rate, uint8_t fill) {
  d86f_common_format(drive, side, rate, fill, 1);
}


x86 assembly (clang, -O0):
<d86f_proxy_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <d86f_common_format@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d86f_proxy_format>:
mov    $0x1,%r8d
jmp    1030 <d86f_common_format@plt>

LLVM IR (-O0):
define void @d86f_proxy_format(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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @d86f_common_format(i32 %9, i32 %10, i32 %11, i32 %12, i32 1)
ret void
}

LLVM IR (-O2):
define void @d86f_proxy_format(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @d86f_common_format(i32 %0, i32 %1, i32 %2, i32 %3, i32 1)
ret void
}
/* Type definitions */
struct ctrl_command {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_error(char *);
void cmd_start_crypt_in(struct ctrl_command *cmd) {
  send_error("can't start decryption - no OpenSSL support!");
}


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

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

LLVM IR (-O0):
%struct.ctrl_command = type { i32 }
@.str = [45 x i8] c"can't start decryption - no OpenSSL support!\00"
define void @cmd_start_crypt_in(%struct.ctrl_command* %0) {
%2 = alloca %struct.ctrl_command*
store %struct.ctrl_command* %0, %struct.ctrl_command** %2
%3 = call i32 @send_error(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ctrl_command = type { i32 }
@.str = [45 x i8] c"can't start decryption - no OpenSSL support!\00"
define void @cmd_start_crypt_in(%struct.ctrl_command* nocapture readnone %0) {
%2 = tail call i32 @send_error(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *wmemcpy(wchar_t *restrict whither, const wchar_t *restrict whence,
                 size_t size) {
  wchar_t *r = whither;
  while (size--)
    *whither++ = *whence++;
  return r;
}


x86 assembly (clang, -O0):
<wmemcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1158 <wmemcpy+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    1118 <wmemcpy+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmemcpy>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1125 <wmemcpy+0x15>
shl    $0x2,%rdx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @wmemcpy(i32* noalias returned writeonly %0, i32* noalias nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %0 to i8*
%8 = shl nuw i64 %2, 2
br label %9
9: ; preds = %5, %3
ret i32* %0
}
/* Variables and functions */
double *getVector(double, double, double);
double *multVector(double *a, double *b) {
  return getVector(a[0] * b[0], a[1] * b[1], a[2] * b[2]);
}


x86 assembly (clang, -O0):
<multVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm2
call   1030 <getVector@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multVector>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
mulsd  0x8(%rsi),%xmm1
movsd  0x10(%rdi),%xmm2
mulsd  0x10(%rsi),%xmm2
jmp    1030 <getVector@plt>

LLVM IR (-O0):
define double* @multVector(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fmul double %7, %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %14, %17
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fmul double %21, %24
%26 = call double* @getVector(double %11, double %18, double %25)
ret double* %26
}

LLVM IR (-O2):
define double* @multVector(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fmul double %3, %4
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = fmul double %7, %9
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = fmul double %12, %14
%16 = tail call double* @getVector(double %5, double %10, double %15)
ret double* %16
}
void caller_1_1_1_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_1_2_1_2() {
ret void
}
/* Variables and functions */
size_t assert(char const *);
scalar_t__ strlen(char const *);
size_t __t_strlen(const char *s) {
  return assert(s), (*s ? (strlen(s + 1) + 1) : 0);
}


x86 assembly (clang, -O0):
<__t_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <__t_strlen+0x3f>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116a <__t_strlen+0x4a>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    116a <__t_strlen+0x4a>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__t_strlen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
cmpb   $0x0,(%rbx)
je     1140 <__t_strlen+0x20>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @__t_strlen(i8* %0) {
%2 = tail call i64 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
br label %9
9: ; preds = %1, %5
%10 = phi i64 [ %8, %5 ], [ 0, %1 ]
ret i64 %10
}
void RTVfsObjToFsStream(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsObjToFsStream() {
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double return_time() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (1.0 * (tv.tv_sec + tv.tv_usec / 1000000.0));
}


x86 assembly (clang, -O0):
<return_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xed3(%rip),%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @return_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
%9 = fmul double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @return_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void display(int a[], int n) {
  int i;
  printf("\n");
  for (i = 0; i < n; i++) {
    printf("%d\t", a[i]);
  }
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <display+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <display+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    1167 <display+0x47>
mov    %ebp,%ebp
lea    0xebd(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <display+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c"%d\09\00"
define void @display(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\09\00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end();
void endintersection(void) { end(); }


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

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

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

LLVM IR (-O2):
define void @endintersection() {
%1 = tail call i32 (...) @end()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void free_u32(uint32_t *val) {}


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

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

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

LLVM IR (-O2):
define void @free_u32(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_int64_t(int64_t const k1, int64_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_int64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_int64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_int64_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check(int);
int main(void) {
  int i;
  for (i = 1; i < 11; i = i + 1) {
    check(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <check@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <check@plt>
mov    $0x2,%edi
call   1030 <check@plt>
mov    $0x3,%edi
call   1030 <check@plt>
mov    $0x4,%edi
call   1030 <check@plt>
mov    $0x5,%edi
call   1030 <check@plt>
mov    $0x6,%edi
call   1030 <check@plt>
mov    $0x7,%edi
call   1030 <check@plt>
mov    $0x8,%edi
call   1030 <check@plt>
mov    $0x9,%edi
call   1030 <check@plt>
mov    $0xa,%edi
call   1030 <check@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @check(i32 1)
%2 = tail call i32 @check(i32 2)
%3 = tail call i32 @check(i32 3)
%4 = tail call i32 @check(i32 4)
%5 = tail call i32 @check(i32 5)
%6 = tail call i32 @check(i32 6)
%7 = tail call i32 @check(i32 7)
%8 = tail call i32 @check(i32 8)
%9 = tail call i32 @check(i32 9)
%10 = tail call i32 @check(i32 10)
ret i32 0
}
int test_imm_95int64_midword_reg(long long val) {
  return ((val >> 16) & (0x95 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_95int64_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, 149
%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_95int64_midword_reg(i64 %0) {
%2 = and i64 %0, 9764864
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void SPIWordCountSet(unsigned long ulBase, unsigned long ulWordCount) {
  unsigned long ulRegVal;
  ulRegVal = (*((volatile unsigned long *)(ulBase + 0x0000017C)));
  (*((volatile unsigned long *)(ulBase + 0x0000017C))) =
      ((ulRegVal & 0x0000FFFF) | (ulWordCount & 0xFFFF) << 16);
}


x86 assembly (clang, -O0):
<SPIWordCountSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x17c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
and    $0xffff,%rcx
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
shl    $0x10,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x17c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIWordCountSet>:
mov    0x17c(%rdi),%rax
movzwl %ax,%eax
shl    $0x10,%esi
or     %rax,%rsi
mov    %rsi,0x17c(%rdi)
ret

LLVM IR (-O0):
define void @SPIWordCountSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 380
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, 65535
%12 = load i64, i64* %4
%13 = and i64 %12, 65535
%14 = shl i64 %13, 16
%15 = or i64 %11, %14
%16 = load i64, i64* %3
%17 = add i64 %16, 380
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @SPIWordCountSet(i64 %0, i64 %1) {
%3 = add i64 %0, 380
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, 65535
%7 = shl i64 %1, 16
%8 = and i64 %7, 4294901760
%9 = or i64 %6, %8
store volatile i64 %9, i64* %4
ret void
}
void XkbLockGroup() {}


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

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

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

LLVM IR (-O2):
define void @XkbLockGroup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ rx_buf;

/* Variables and functions */
int read(int, int /*<<< orphan*/ *, int);
int clear_rx(int fd) {
  uint8_t rx_buf[2048];
  int n;
  return 0;
  do {
    n = read(fd, rx_buf, sizeof(rx_buf));
  } while (n > 0);
  return n;
}


x86 assembly (clang, -O0):
<clear_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1fa0,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
add    $0x1fa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clear_rx(i32 %0) {
%2 = alloca i32
%3 = alloca [2048 x i32]
%4 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @clear_rx(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ mainserv_towrite(int, int *, scalar_t__, int);
uint8_t mainserv_send_and_free(int sock, uint8_t *ptr, uint32_t pleng) {
  uint8_t r;
  r = (mainserv_towrite(sock, ptr, pleng + 8, 5000) != (int32_t)(pleng + 8))
          ? 0
          : 1;
  free(ptr);
  return r;
}


x86 assembly (clang, -O0):
<mainserv_send_and_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
mov    $0x1388,%ecx
call   1040 <mainserv_towrite@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainserv_send_and_free>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
add    $0x8,%rbx
mov    %rbx,%rdx
mov    $0x1388,%ecx
call   1040 <mainserv_towrite@plt>
xor    %ebp,%ebp
cmp    %rbx,%rax
sete   %bpl
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mainserv_send_and_free(i32 %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = add nsw i64 %10, 8
%12 = call i64 @mainserv_towrite(i32 %8, i32* %9, i64 %11, i32 5000)
%13 = load i64, i64* %6
%14 = add nsw i64 %13, 8
%15 = icmp ne i64 %12, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 1
store i32 %17, i32* %7
%18 = load i32*, i32** %5
%19 = call i32 @free(i32* %18)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @mainserv_send_and_free(i32 %0, i32* %1, i64 %2) {
%4 = add nsw i64 %2, 8
%5 = tail call i64 @mainserv_towrite(i32 %0, i32* %1, i64 %4, i32 5000)
%6 = icmp eq i64 %5, %4
%7 = zext i1 %6 to i32
%8 = tail call i32 @free(i32* %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void int_0h(void) { printf("xxx\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"xxx\00"
define void @int_0h() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pic_enable(int);
void interrupt_enable(int i) {
  if (i < 32) {
  } else {
    pic_enable(i - 32);
  }
}


x86 assembly (clang, -O0):
<interrupt_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    112a <interrupt_enable+0x1a>
jmp    1135 <interrupt_enable+0x25>
mov    -0x4(%rbp),%edi
sub    $0x20,%edi
call   1030 <pic_enable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_enable>:
cmp    $0x20,%edi
jge    1116 <interrupt_enable+0x6>
ret
add    $0xffffffe0,%edi
jmp    1030 <pic_enable@plt>

LLVM IR (-O0):
define void @interrupt_enable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
%9 = call i32 @pic_enable(i32 %8)
br label %10
10: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @interrupt_enable(i32 %0) {
%2 = icmp slt i32 %0, 32
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -32
%5 = tail call i32 @pic_enable(i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int even(int);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  printf("200 is even?: ");
  printf("%d\n", even(200));
  printf("201 is even?: ");
  printf("%d\n", even(201));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xc8,%edi
call   1040 <even@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xc9,%edi
call   1040 <even@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xc8,%edi
call   1040 <even@plt>
lea    0xecf(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xc9,%edi
call   1040 <even@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"200 is even?: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [15 x i8] c"201 is even?: \00"
define void @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @even(i32 200)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @even(i32 201)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"200 is even?: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [15 x i8] c"201 is even?: \00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @even(i32 200)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @even(i32 201)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
double ceil(int);
double drand48();
int log10(double);
double Binomial_aggregations(double mu, double p) {
  return (mu * ceil(log10(1 - drand48()) / log10(p)));
}


x86 assembly (clang, -O0):
<Binomial_aggregations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <drand48@plt>
movaps %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1040 <log10@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Binomial_aggregations>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <drand48@plt>
movsd  0xeb1(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <log10@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1040 <log10@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @Binomial_aggregations(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double (...) @drand48()
%7 = fsub double 1.000000e+00, %6
%8 = call i32 @log10(double %7)
%9 = load double, double* %4
%10 = call i32 @log10(double %9)
%11 = sdiv i32 %8, %10
%12 = call double @ceil(i32 %11)
%13 = fmul double %5, %12
ret double %13
}

LLVM IR (-O2):
define double @Binomial_aggregations(double %0, double %1) {
%3 = tail call double (...) @drand48()
%4 = fsub double 1.000000e+00, %3
%5 = tail call i32 @log10(double %4)
%6 = tail call i32 @log10(double %1)
%7 = sdiv i32 %5, %6
%8 = tail call double @ceil(i32 %7)
%9 = fmul double %8, %0
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("integer: %d\n", 1234); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"integer: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1234)
ret i32 0
}
void foo771() {}


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

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

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

LLVM IR (-O2):
define void @foo771() {
ret void
}
/* Variables and functions */
int M_PI_2;
double pow(int, int);
double sin(int);
double elasticEaseInd(double p) {
  return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1));
}


x86 assembly (clang, -O0):
<elasticEaseInd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2eb4(%rip),%rax
imul   $0xd,(%rax),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xead(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elasticEaseInd>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
cvtsi2sd %eax,%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xea2(%rip),%xmm0
mulsd  0xea2(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI_2 = global i32 0
define double @elasticEaseInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_PI_2
%4 = mul nsw i32 13, %3
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = fptosi double %7 to i32
%9 = call double @sin(i32 %8)
%10 = load double, double* %2
%11 = fsub double %10, 1.000000e+00
%12 = fmul double 1.000000e+01, %11
%13 = fptosi double %12 to i32
%14 = call double @pow(i32 2, i32 %13)
%15 = fmul double %9, %14
ret double %15
}

LLVM IR (-O2):
@M_PI_2 = global i32 0
define double @elasticEaseInd(double %0) {
%2 = load i32, i32* @M_PI_2
%3 = mul nsw i32 %2, 13
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
%6 = fptosi double %5 to i32
%7 = tail call double @sin(i32 %6)
%8 = fadd double %0, -1.000000e+00
%9 = fmul double %8, 1.000000e+01
%10 = fptosi double %9 to i32
%11 = tail call double @pow(i32 2, i32 %10)
%12 = fmul double %7, %11
ret double %12
}
int test_imm_F9int64_midword_reg(long long val) {
  return ((val >> 16) & (0xF9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F9int64_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, 249
%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_F9int64_midword_reg(i64 %0) {
%2 = and i64 %0, 16318464
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t);
void *new_thread(void *arg) {
  printf("Thread %zu created\n", (size_t)arg);
  return arg;
}


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

x86 assembly (clang, -O2):
<new_thread>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Thread %zu created\0A\00"
define i8* @new_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str = [20 x i8] c"Thread %zu created\0A\00"
define i8* @new_thread(i8* returned %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i8* %0
}
/* Variables and functions */
int getch(int);
int skip_string(int quote) {
  int ch = quote;
  for (;;) {
    ch = getch(ch);
    if (ch == quote)
      break;
    if (ch == '\\')
      ch = getch(ch);
  }
  return getch(ch);
}


x86 assembly (clang, -O0):
<skip_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    113d <skip_string+0x2d>
jmp    1157 <skip_string+0x47>
cmpl   $0x5c,-0x8(%rbp)
jne    1152 <skip_string+0x42>
mov    -0x8(%rbp),%edi
call   1030 <getch@plt>
mov    %eax,-0x8(%rbp)
jmp    1121 <skip_string+0x11>
mov    -0x8(%rbp),%edi
call   1030 <getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_string>:
push   %rbx
mov    %edi,%ebx
jmp    1122 <skip_string+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%edi
call   1030 <getch@plt>
cmp    %ebx,%eax
je     113c <skip_string+0x2c>
cmp    $0x5c,%eax
jne    1120 <skip_string+0x10>
mov    $0x5c,%edi
call   1030 <getch@plt>
jmp    1120 <skip_string+0x10>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <getch@plt>

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

LLVM IR (-O2):
define i32 @skip_string(i32 %0) {
%2 = tail call i32 @getch(i32 %0)
%3 = icmp eq i32 %2, %0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i32 [ %11, %9 ], [ %2, %1 ]
%6 = icmp eq i32 %5, 92
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @getch(i32 92)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ %5, %4 ]
%11 = tail call i32 @getch(i32 %10)
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %4
13: ; preds = %9, %1
%14 = tail call i32 @getch(i32 %0)
ret i32 %14
}