xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar('c');
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 99)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ReadFromFile(char *);
int /*<<< orphan*/ WriteToFile(char *);
void FileOperations() {
  WriteToFile("test.txt");
  ReadFromFile("test.txt");
}


x86 assembly (clang, -O0):
<FileOperations>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <WriteToFile@plt>
lea    0xec9(%rip),%rdi
call   1040 <ReadFromFile@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileOperations>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <WriteToFile@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ReadFromFile@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
define void @FileOperations() {
%1 = call i32 @WriteToFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ReadFromFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
define void @FileOperations() {
%1 = tail call i32 @WriteToFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ReadFromFile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void _udelay(int t) { usleep(t); }


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

x86 assembly (clang, -O2):
<_udelay>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @_udelay(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
void e() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v16_10_avx2() {
ret void
}
/* Variables and functions */
float *malloc(int);
float *create_rand(int L) {
  float *M = malloc(L * sizeof(float));
  return M;
}


x86 assembly (clang, -O0):
<create_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_rand>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define float* @create_rand(i32 %0) {
%2 = alloca i32
%3 = alloca float*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call float* @malloc(i32 %7)
store float* %8, float** %3
%9 = load float*, float** %3
ret float* %9
}

LLVM IR (-O2):
define noalias float* @create_rand(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call float* @malloc(i32 %2)
ret float* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void item_dump(void *data) { printf("  -- %d\n", *(int *)data); }


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

x86 assembly (clang, -O2):
<item_dump>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c" -- %d\0A\00"
define void @item_dump(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int z80_unpack_legacy(const void *data) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @z80_unpack_legacy(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void init(void) { write(STDOUT_FILENO, "DSO init\n", 9); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x9,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x9,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [10 x i8] c"DSO init\0A\00"
define void @init() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [10 x i8] c"DSO init\0A\00"
define void @init() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_swap(char *str) {
  sprintf(str, "SWAP  A                         ");
}


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

x86 assembly (clang, -O2):
<sprint_swap>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
@.str = [33 x i8] c"SWAP A \00"
define void @sprint_swap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"SWAP A \00"
define void @sprint_swap(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int main(void) {
  char *p;
  p = malloc(10);
  p = malloc(123);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x7b,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = call i8* @malloc(i32 123)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(123) i8* @malloc(i32 123)
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
int hash_to_array() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hash_to_array() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fac(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%.Lf\n", fac(num));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%.Lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fac(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ aes_ctr_encrypt(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
uint8_t AES_CTR_EncryptData(uint8_t *plainText, uint16_t textLen,
                            uint8_t *aesKey, uint8_t *nonce,
                            uint8_t *initVector) {
  return aes_ctr_encrypt(plainText, textLen, aesKey, nonce, initVector);
}


x86 assembly (clang, -O0):
<AES_CTR_EncryptData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <aes_ctr_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_CTR_EncryptData>:
jmp    1030 <aes_ctr_encrypt@plt>

LLVM IR (-O0):
define i32 @AES_CTR_EncryptData(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @aes_ctr_encrypt(i32* %11, i32 %12, i32* %13, i32* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @AES_CTR_EncryptData(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @aes_ctr_encrypt(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4)
ret i32 %6
}
void f_blank_p1() { return; }


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

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

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

LLVM IR (-O2):
define void @f_blank_p1() {
ret void
}
/* Variables and functions */
char *vect_mus_audio_moniker();
char *mus_audio_moniker(void) { return (vect_mus_audio_moniker()); }


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

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

LLVM IR (-O0):
define i8* @mus_audio_moniker() {
%1 = call i8* (...) @vect_mus_audio_moniker()
ret i8* %1
}

LLVM IR (-O2):
define i8* @mus_audio_moniker() {
%1 = tail call i8* (...) @vect_mus_audio_moniker()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
size_t strnlen(char const *, size_t);
char *strncpy(char *restrict whither, const char *restrict whence,
              size_t maxlen) {
  size_t n = strnlen(whence, maxlen);
  memcpy(whither, whence, n);
  memset(whither + n, 0, maxlen - n);
  return whither;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
sub    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <strnlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <memcpy@plt>
lea    (%r15,%rbx,1),%rdi
sub    %rbx,%r12
xor    %esi,%esi
mov    %r12,%rdx
call   1030 <memset@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strncpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @strnlen(i8* %8, i64 %9)
store i64 %10, i64* %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %7
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i64, i64* %7
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = sub i64 %18, %19
%21 = call i32 @memset(i8* %17, i32 0, i64 %20)
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @strncpy(i8* noalias returned %0, i8* noalias %1, i64 %2) {
%4 = tail call i64 @strnlen(i8* %1, i64 %2)
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = sub i64 %2, %4
%8 = tail call i32 @memset(i8* %6, i32 0, i64 %7)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exchange(int *, int, int);
int partition(int *, int, int);
int random_between(int, int);
int partition_rand(int A[], int p, int r) {
  int i = random_between(p, r);
  exchange(A, r, i);
  return partition(A, p, r);
}


x86 assembly (clang, -O0):
<partition_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <random_between@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1050 <exchange@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partition_rand>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %esi,%edi
mov    %edx,%esi
call   1040 <random_between@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1050 <exchange@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <partition@plt>

LLVM IR (-O0):
define i32 @partition_rand(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @random_between(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @exchange(i32* %11, i32 %12, i32 %13)
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 @partition(i32* %15, i32 %16, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @partition_rand(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @random_between(i32 %1, i32 %2)
%5 = tail call i32 @exchange(i32* %0, i32 %2, i32 %4)
%6 = tail call i32 @partition(i32* %0, i32 %1, i32 %2)
ret i32 %6
}
void __IO_sys_yield() {}


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

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

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

LLVM IR (-O2):
define void @__IO_sys_yield() {
ret void
}
/* Variables and functions */
int addToZero(int);
void main(void) {
  volatile int result = addToZero(5);
  ;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <addToZero@plt>
mov    %eax,0x4(%rsp)
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 @addToZero(i32 5)
store volatile i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @addToZero(i32 5)
store volatile i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int help_help(int argc, char **argv) {
  printf("\n\033[1m%s\033[0m, Print help. Use command \033[1m?\033[0m for more "
         "help\n",
         argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<help_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [62 x i8] c"\0A\1B[1m%s\1B[0m, Print help. Use command \1B[1m?\1B[0m for more help\0A\00"
define i32 @help_help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 1
}

LLVM IR (-O2):
@.str = [62 x i8] c"\0A\1B[1m%s\1B[0m, Print help. Use command \1B[1m?\1B[0m for more help\0A\00"
define i32 @help_help(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int MT_check_redzone(void *address, unsigned long int size) {
  char *start = (char *)address + size - 4;
  if (strncmp(start, "xxxx", 4) != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<MT_check_redzone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     115b <MT_check_redzone+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1162 <MT_check_redzone+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_check_redzone>:
push   %rax
add    %rsi,%rdi
add    $0xfffffffffffffffc,%rdi
lea    0xee1(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"xxxx\00"
define i32 @MT_check_redzone(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = getelementptr inbounds i8, i8* %3, i64 -4
%5 = tail call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int sw_sync_fence_create(int fd, const char *name, unsigned value) { return 0; }


x86 assembly (clang, -O0):
<sw_sync_fence_create>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sw_sync_fence_create(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void alpha_yyfree(void *ptr) { free((char *)ptr); }


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

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

LLVM IR (-O2):
define void @alpha_yyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int mod_init(void) {
  fprintf(stderr, "cpl - initializing\n");
  return 0;
}


x86 assembly (clang, -O0):
<mod_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_init>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"cpl - initializing\0A\00"
define i32 @mod_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"cpl - initializing\0A\00"
define i32 @mod_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float getDepth() {
  float depth = 0.0f;
  return depth;
}


x86 assembly (clang, -O0):
<getDepth>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDepth>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @getDepth() {
%1 = alloca float
store float 0.000000e+00, float* %1
%2 = load float, float* %1
ret float %2
}

LLVM IR (-O2):
define float @getDepth() {
ret float 0.000000e+00
}
/* Variables and functions */
float rintf(float);
float test1f(float x) { return rintf(x); }


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

x86 assembly (clang, -O2):
<test1f>:
jmp    1030 <rintf@plt>

LLVM IR (-O0):
define float @test1f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.rint.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test1f(float %0) {
%2 = tail call float @llvm.rint.f32(float %0)
ret float %2
}
/* Type definitions */
struct globtree {
  int dummy;
};

/* Variables and functions */
struct globtree *globtree_new(int);
struct globtree *globtree_true(void) {
  struct globtree *gt;
  gt = globtree_new(5);
  return (gt);
}


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

x86 assembly (clang, -O2):
<globtree_true>:
mov    $0x5,%edi
jmp    1030 <globtree_new@plt>

LLVM IR (-O0):
%struct.globtree = type { i32 }
define %struct.globtree* @globtree_true() {
%1 = alloca %struct.globtree*
%2 = call %struct.globtree* @globtree_new(i32 5)
store %struct.globtree* %2, %struct.globtree** %1
%3 = load %struct.globtree*, %struct.globtree** %1
ret %struct.globtree* %3
}

LLVM IR (-O2):
%struct.globtree = type { i32 }
define %struct.globtree* @globtree_true() {
%1 = tail call %struct.globtree* @globtree_new(i32 5)
ret %struct.globtree* %1
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ semctl(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
void delete_sem(int sem) {
  if ((semctl(sem, 1, IPC_RMID, 0)) < 0) {
    perror("[semctl -- delete]");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<delete_sem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%esi
xor    %ecx,%ecx
call   1040 <semctl@plt>
cmp    $0x0,%rax
jge    1173 <delete_sem+0x43>
lea    0xe9c(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_sem>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%esi
xor    %ecx,%ecx
call   1040 <semctl@plt>
test   %rax,%rax
js     114d <delete_sem+0x1d>
pop    %rax
ret
lea    0xeac(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [19 x i8] c"[semctl -- delete]\00"
define void @delete_sem(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i64 @semctl(i32 %0, i32 1, i32 %2, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret void
}
int add_two(int a) { return a + 2; }


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

x86 assembly (clang, -O2):
<add_two>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @add_two(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("this is tare\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"this is tare\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void arch_free_page(struct page *page, int order) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @arch_free_page(%struct.page* %0, i32 %1) {
%3 = alloca %struct.page*
%4 = alloca i32
store %struct.page* %0, %struct.page** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @arch_free_page(%struct.page* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc17(int status, void *arg) {
  printf("Executing exitfunc17 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


x86 assembly (clang, -O0):
<exitfunc17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc17>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc17 (status=%d, arg=%d)\0A\00"
define void @exitfunc17(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc17 (status=%d, arg=%d)\0A\00"
define void @exitfunc17(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_add(float *, float *, float *);
__attribute__((always_)) struct vec3 *
psvec3_add(struct vec3 *result, struct vec3 *a, struct vec3 *b) {
  vec3_add((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3_add>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_add@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_add(%struct.vec3* %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = alloca %struct.vec3*
%5 = alloca %struct.vec3*
%6 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %4
store %struct.vec3* %1, %struct.vec3** %5
store %struct.vec3* %2, %struct.vec3** %6
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load %struct.vec3*, %struct.vec3** %6
%12 = bitcast %struct.vec3* %11 to float*
%13 = call i32 @vec3_add(float* %8, float* %10, float* %12)
%14 = load %struct.vec3*, %struct.vec3** %4
ret %struct.vec3* %14
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_add(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = bitcast %struct.vec3* %0 to float*
%5 = bitcast %struct.vec3* %1 to float*
%6 = bitcast %struct.vec3* %2 to float*
%7 = tail call i32 @vec3_add(float* %4, float* %5, float* %6)
ret %struct.vec3* %0
}
extern int f() {
  static int i;
  return i++;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@f.i = internal global i32 0
define i32 @f() {
%1 = load i32, i32* @f.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.i
ret i32 %1
}

LLVM IR (-O2):
@f.i = internal unnamed_addr global i32 0
define i32 @f() {
%1 = load i32, i32* @f.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f.i
ret i32 %1
}
char *_lw6hlp_true_false(int b) {
  char *ret = "false";
  if (b) {
    ret = "true";
  }
  return ret;
}


x86 assembly (clang, -O0):
<_lw6hlp_true_false>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1127 <_lw6hlp_true_false+0x27>
lea    0xee3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lw6hlp_true_false>:
test   %edi,%edi
lea    0xef7(%rip),%rcx
lea    0xef6(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"false\00"
@.str.1 = [5 x i8] c"true\00"
define i8* @_lw6hlp_true_false(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %7
7: ; preds = %6, %1
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"false\00"
@.str.1 = [5 x i8] c"true\00"
define i8* @_lw6hlp_true_false(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
set(int x, int y, int *a, int *b) {
  *a = 5;
  *b = 10;
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
movl   $0x5,(%rdx)
movl   $0xa,(%rcx)
ret

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

LLVM IR (-O2):
define i32 @set(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
store i32 5, i32* %2
store i32 10, i32* %3
ret i32 undef
}
/* Variables and functions */
scalar_t__ isalnum(char);
int is_identifier(char input) { return isalnum(input) || input == '-'; }


x86 assembly (clang, -O0):
<is_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <is_identifier+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_identifier>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_identifier(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 45
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void free_vector(v, nl, nh) float *v;
int nl, nh;
{ free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_vector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_vector(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds float, float* %7, i64 %9
%11 = bitcast float* %10 to i8*
ret void
}

LLVM IR (-O2):
define void @free_vector(float* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = bitcast float* %5 to i8*
tail call void @free(i8* %6)
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_v32_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v32_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_archives(char const *);
int fs_add_path(char const *);
int fs_add_path_with_archives(const char *path) {
  add_archives(path);
  return fs_add_path(path);
}


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

x86 assembly (clang, -O2):
<fs_add_path_with_archives>:
push   %rbx
mov    %rdi,%rbx
call   1030 <add_archives@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fs_add_path@plt>

LLVM IR (-O0):
define i32 @fs_add_path_with_archives(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @add_archives(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @fs_add_path(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @fs_add_path_with_archives(i8* %0) {
%2 = tail call i32 @add_archives(i8* %0)
%3 = tail call i32 @fs_add_path(i8* %0)
ret i32 %3
}
int execute_getpmsg() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getpmsg() {
ret i32 0
}
/* Variables and functions */
int StringsAreEqual(char *, char *);
int GetStackSize(int count, char *type) {
  int outSize = count;
  if (outSize < 0)
    outSize = 1;
  if (StringsAreEqual(type, "char") == 1) {
    outSize = 1 + count;
  }
  return outSize;
}


x86 assembly (clang, -O0):
<GetStackSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1136 <GetStackSize+0x26>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <StringsAreEqual@plt>
cmp    $0x1,%eax
jne    1158 <GetStackSize+0x48>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetStackSize>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %edi,%ebx
test   %edi,%edi
mov    $0x1,%ebp
cmovns %edi,%ebp
lea    0xed7(%rip),%rsi
mov    %rax,%rdi
call   1030 <StringsAreEqual@plt>
add    $0x1,%ebx
cmp    $0x1,%eax
cmovne %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"char\00"
define i32 @GetStackSize(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 1, i32 %0
%5 = tail call i32 @StringsAreEqual(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = add nsw i32 %0, 1
%8 = select i1 %6, i32 %7, i32 %4
ret i32 %8
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int tvdiff(struct timeval *tv2, struct timeval *tv1) {
  return (tv2->tv_sec - tv1->tv_sec) * 1000 * 1000 + tv2->tv_usec -
         tv1->tv_usec;
}


x86 assembly (clang, -O0):
<tvdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3e8,%eax,%eax
imul   $0x3e8,%eax,%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x10(%rbp),%rcx
sub    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvdiff>:
mov    (%rdi),%eax
sub    (%rsi),%eax
imul   $0xf4240,%eax,%eax
add    0x4(%rdi),%eax
sub    0x4(%rsi),%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @tvdiff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000
%13 = mul nsw i32 %12, 1000
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = add nsw i32 %13, %16
%18 = load %struct.timeval*, %struct.timeval** %4
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %18, i32 0, i32 1
%20 = load i32, i32* %19
%21 = sub nsw i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @tvdiff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%13 = load i32, i32* %12
%14 = sub i32 %11, %13
ret i32 %14
}
/* Variables and functions */
char *getpass(char *);
char *passwordPrompt(void) {
  char *password;
  password = getpass("Enter MySQL Password: ");
  return password;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Enter MySQL Password: \00"
define i8* @passwordPrompt() {
%1 = alloca i8*
%2 = call i8* @getpass(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter MySQL Password: \00"
define i8* @passwordPrompt() {
%1 = tail call i8* @getpass(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int foo(int i) {
  int x;
  int y;
  x = 4;
  y = 3;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void kputs(char *a) {
  puts("\t[kernalloc] ");
  puts(a);
}


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

x86 assembly (clang, -O2):
<kputs>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\09[kernalloc] \00"
define void @kputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\09[kernalloc] \00"
define void @kputs(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}