xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void genbankfree(void *ptr) { free((char *)ptr); }


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

LLVM IR (-O0):
define void @genbankfree(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 @genbankfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void genseed(int seed) { srand((unsigned)seed); }


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

x86 assembly (clang, -O2):
<genseed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @genseed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void special(int k, int x, int y) { glutPostRedisplay(); }


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @special(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @glutPostRedisplay()
ret void
}
int c_fsync_(FileDescriptor)
int *FileDescriptor;
{
  int rc;
  rc = fsync(*FileDescriptor);
  return rc;
}


x86 assembly (clang, -O0):
<c_fsync_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <fsync@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fsync_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <fsync@plt>

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

LLVM IR (-O2):
define i32 @c_fsync_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @fsync to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
unsigned long I2CMasterDataGet(unsigned long ulBase) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  return ((*((volatile unsigned long *)(ulBase + 0x00000008))));
}


x86 assembly (clang, -O0):
<I2CMasterDataGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterDataGet>:
push   %rbx
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    0x8(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @I2CMasterDataGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CMasterBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 8
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @I2CMasterDataGet(i64 %0) {
%2 = tail call i32 @I2CMasterBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 1, times = 5;
  while (n <= times) {
    printf("C while loops: %d\n", n);
    ++n;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1156 <main+0x46>
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"C while loops: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Type definitions */
struct dirent {
  scalar_t__ d_type;
};

/* Variables and functions */
scalar_t__ DT_DIR;
int isDir(struct dirent *dir) { return (dir->d_type == DT_DIR) ? 1 : 0; }


x86 assembly (clang, -O0):
<isDir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    0x2eca(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDir>:
mov    (%rdi),%rcx
mov    0x2ed6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.dirent = type { i64 }
@DT_DIR = global i64 0
define i32 @isDir(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @DT_DIR
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
%struct.dirent = type { i64 }
@DT_DIR = global i64 0
define i32 @isDir(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @DT_DIR
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ restart(int);
void RST_00() { restart(0x00); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <restart@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %edi,%edi
jmp    1030 <restart@plt>

LLVM IR (-O0):
define void @RST_00() {
%1 = call i32 @restart(i32 0)
ret void
}

LLVM IR (-O2):
define void @RST_00() {
%1 = tail call i32 @restart(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char ascii_to_dec(int /*<<< orphan*/);
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
unsigned char get_byte(FILE *f) {
  char h = ascii_to_dec(fgetc(f));
  char l = ascii_to_dec(fgetc(f));
  return (h << 4) | l;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,%edi
call   1030 <ascii_to_dec@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,%edi
call   1030 <ascii_to_dec@plt>
mov    %al,-0xa(%rbp)
movsbl -0x9(%rbp),%eax
shl    $0x4,%eax
movsbl -0xa(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fgetc@plt>
mov    %eax,%edi
call   1030 <ascii_to_dec@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <fgetc@plt>
mov    %eax,%edi
call   1030 <ascii_to_dec@plt>
shl    $0x4,%bl
or     %bl,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i8 @get_byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i8
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
%7 = call signext i8 @ascii_to_dec(i32 %6)
store i8 %7, i8* %3
%8 = load i32*, i32** %2
%9 = call i32 @fgetc(i32* %8)
%10 = call signext i8 @ascii_to_dec(i32 %9)
store i8 %10, i8* %4
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = shl i32 %12, 4
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = or i32 %13, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @get_byte(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call signext i8 @ascii_to_dec(i32 %2)
%4 = tail call i32 @fgetc(i32* %0)
%5 = tail call signext i8 @ascii_to_dec(i32 %4)
%6 = shl i8 %3, 4
%7 = or i8 %5, %6
ret i8 %7
}
/* Variables and functions */
int inadyn_main(int, char **);
int main(int argc, char *argv[]) { return inadyn_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <inadyn_main@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @inadyn_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @inadyn_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ net_driverlist_add(void *, int);
int add_helper(int driver, void *dat) {
  return !net_driverlist_add(dat, driver);
}


x86 assembly (clang, -O0):
<add_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <net_driverlist_add@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_helper>:
push   %rax
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
call   1030 <net_driverlist_add@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @add_helper(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 = load i32, i32* %3
%7 = call i32 @net_driverlist_add(i8* %5, i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @add_helper(i32 %0, i8* %1) {
%3 = tail call i32 @net_driverlist_add(i8* %1, i32 %0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_memdel(void **);
void ft_strdel(char **as) {
  if (as && *as)
    ft_memdel((void **)as);
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <ft_strdel+0x2e>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <ft_strdel+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <ft_memdel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
test   %rdi,%rdi
je     1120 <ft_strdel+0x10>
cmpq   $0x0,(%rdi)
je     1120 <ft_strdel+0x10>
jmp    1030 <ft_memdel@plt>
ret

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @ft_memdel(i8** %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void zombie_handler(int sig) { waitpid(-1, NULL, WNOHANG); }


x86 assembly (clang, -O0):
<zombie_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zombie_handler>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
jmp    1030 <waitpid@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @zombie_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @WNOHANG
%4 = call i32 @waitpid(i32 -1, i32* null, i32 %3)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @zombie_handler(i32 %0) {
%2 = load i32, i32* @WNOHANG
%3 = tail call i32 @waitpid(i32 -1, i32* null, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void arch_spin_lock(pthread_mutex_t *mutex) { pthread_mutex_lock(mutex); }


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

x86 assembly (clang, -O2):
<arch_spin_lock>:
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define void @arch_spin_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret void
}
void ECAPIntEnable(unsigned int baseAdd, unsigned int flag) {
  (*((volatile unsigned short *)(baseAdd + (0x2C)))) |= flag;
}


x86 assembly (clang, -O0):
<ECAPIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
or     %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPIntEnable>:
add    $0x2c,%edi
or     %si,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPIntEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 44
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i16*
%10 = load volatile i16, i16* %9
%11 = zext i16 %10 to i32
%12 = or i32 %11, %5
%13 = trunc i32 %12 to i16
store volatile i16 %13, i16* %9
ret void
}

LLVM IR (-O2):
define void @ECAPIntEnable(i32 %0, i32 %1) {
%3 = add i32 %0, 44
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
%7 = trunc i32 %1 to i16
%8 = or i16 %6, %7
store volatile i16 %8, i16* %5
ret void
}
int chr_iswhite(const char c) {
  return c == ' ' || c == '\t' || c == '\r' || c == '\n';
}


x86 assembly (clang, -O0):
<chr_iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <chr_iswhite+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <chr_iswhite+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <chr_iswhite+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr_iswhite>:
cmp    $0x20,%dil
ja     1120 <chr_iswhite+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <chr_iswhite+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @chr_iswhite(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int sqrt(int);
int get_num_divisors(int num) {
  int counter = 0;
  int running = 1;
  while (running <= sqrt(num)) {
    if (!(num % running))
      counter++;
    running++;
  }
  return counter;
}


x86 assembly (clang, -O0):
<get_num_divisors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     116b <get_num_divisors+0x5b>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115d <get_num_divisors+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <get_num_divisors+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_divisors>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
call   1030 <sqrt@plt>
test   %eax,%eax
jle    114d <get_num_divisors+0x3d>
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
mov    %r14d,%eax
cltd
idiv   %ebx
cmp    $0x1,%edx
adc    $0x0,%ebp
mov    %r14d,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <get_num_divisors+0x20>
jmp    114f <get_num_divisors+0x3f>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_num_divisors(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ 1, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = srem i32 %0, %5
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %6, %9
%11 = add nuw nsw i32 %5, 1
%12 = tail call i32 @sqrt(i32 %0)
%13 = icmp slt i32 %5, %12
br i1 %13, label %4, label %14
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *module_libc_memset(void *dest, int ch, size_t n) {
  return memset(dest, ch, n);
}


x86 assembly (clang, -O0):
<module_libc_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_libc_memset>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @module_libc_memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = load i64, i64* %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @module_libc_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ christmas_tree(int);
int main() {
  christmas_tree(4);
  christmas_tree(7);
  christmas_tree(11);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @christmas_tree(i32 4)
%2 = tail call i32 @christmas_tree(i32 7)
%3 = tail call i32 @christmas_tree(i32 11)
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, struct timespec const *);
int clock_settime(clockid_t clk, const struct timespec *ts) {
  return syscall(262, clk, ts);
}


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

x86 assembly (clang, -O2):
<clock_settime>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x106,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @clock_settime(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @syscall(i32 262, i32 %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ copia();
int obtenlinea();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int longitud;
  extern int max;
  extern char linea_max[1000];
  max = 0;
  while ((longitud = obtenlinea()) > 0) {
    max = longitud;
    copia();
    printf("%s", linea_max);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <obtenlinea@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118a <main+0x5a>
mov    -0x8(%rbp),%ecx
mov    0x2e6f(%rip),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <copia@plt>
lea    0xe87(%rip),%rdi
mov    0x2e60(%rip),%rsi
call   1050 <printf@plt>
jmp    114c <main+0x1c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2e9c(%rip),%r15
movl   $0x0,(%r15)
xor    %eax,%eax
call   1030 <obtenlinea@plt>
test   %eax,%eax
jle    1180 <main+0x50>
lea    0xeab(%rip),%r14
mov    0x2e84(%rip),%rbx
nopl   0x0(%rax)
mov    %eax,(%r15)
xor    %eax,%eax
call   1040 <copia@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <obtenlinea@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@max = external global i32
@.str = [3 x i8] c"%s\00"
@linea_max = external global [1000 x i8]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* @max
br label %3
3: ; preds = %6, %0
%4 = call i32 (...) @obtenlinea()
store i32 %4, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* %2
store i32 %7, i32* @max
%8 = call i32 (...) @copia()
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@max = external global i32
@.str = [3 x i8] c"%s\00"
@linea_max = external global [1000 x i8]
define i32 @main() {
store i32 0, i32* @max
%1 = tail call i32 (...) @obtenlinea()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
store i32 %4, i32* @max
%5 = tail call i32 (...) @copia()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
%7 = tail call i32 (...) @obtenlinea()
%8 = icmp sgt i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ veg_class_destructor();
void ___vc_exitfunc(int ___ar, void *___ar2) { veg_class_destructor(); }


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

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

LLVM IR (-O0):
define void @___vc_exitfunc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @veg_class_destructor()
ret void
}

LLVM IR (-O2):
define void @___vc_exitfunc(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @veg_class_destructor()
ret void
}
int FMT_istext(int format) { return (format & 0x8000) == 0x8000; }


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

x86 assembly (clang, -O2):
<FMT_istext>:
mov    %edi,%eax
shr    $0xf,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @FMT_istext(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp eq i32 %4, 32768
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @FMT_istext(i32 %0) {
%2 = lshr i32 %0, 15
%3 = and i32 %2, 1
ret i32 %3
}
void rockchip_rgb_fini(struct rockchip_rgb *rgb) {}


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

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

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

LLVM IR (-O2):
%struct.rockchip_rgb = type opaque
define void @rockchip_rgb_fini(%struct.rockchip_rgb* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fdiv_preg32_dword(int reg32) {
  put8(0xD8);
  put8(0x30 + reg32);
}


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

x86 assembly (clang, -O2):
<fdiv_preg32_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xd8,%edi
call   1030 <put8@plt>
add    $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fdiv_preg32_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 216)
%4 = load i32, i32* %2
%5 = add nsw i32 48, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fdiv_preg32_dword(i32 %0) {
%2 = tail call i32 @put8(i32 216)
%3 = add nsw i32 %0, 48
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearRST();
int /*<<< orphan*/ waitmillisec(int);
void deactivate() {
  ClearRST();
  waitmillisec(12);
}


x86 assembly (clang, -O0):
<deactivate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ClearRST@plt>
mov    $0xc,%edi
call   1040 <waitmillisec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deactivate>:
push   %rax
xor    %eax,%eax
call   1030 <ClearRST@plt>
mov    $0xc,%edi
pop    %rax
jmp    1040 <waitmillisec@plt>

LLVM IR (-O0):
define void @deactivate() {
%1 = call i32 (...) @ClearRST()
%2 = call i32 @waitmillisec(i32 12)
ret void
}

LLVM IR (-O2):
define void @deactivate() {
%1 = tail call i32 (...) @ClearRST()
%2 = tail call i32 @waitmillisec(i32 12)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ show_error(char *);
void *xmalloc(size_t size) {
  void *tmp = malloc(size);
  if (!tmp)
    show_error("Out of memory");
  memset(tmp, 0, size);
  return tmp;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <xmalloc+0x30>
lea    0xea5(%rip),%rdi
call   1050 <show_error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <xmalloc+0x20>
lea    0xeb5(%rip),%rdi
call   1050 <show_error@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @show_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
int isFullQ(int Q[], int front, int rear) {
  if (rear == 5 - 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isFullQ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jne    1124 <isFullQ+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <isFullQ+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFullQ>:
xor    %eax,%eax
cmp    $0x4,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isFullQ(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 4
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double __builtin_fabs(double);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  double d = __builtin_fabs(-2.0);
  printf("Result is %lf\n", d);
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
movsd  0xec0(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Result is %lf\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 2.000000e+00, double* %2
%3 = load double, double* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Result is %lf\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 2.000000e+00)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long double do_round(long double, int);
long double floorl(long double x) { return do_round(x, 0x400); }


x86 assembly (clang, -O0):
<floorl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x400,%edi
call   1030 <do_round@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorl>:
mov    $0x400,%edi
jmp    1030 <do_round@plt>

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

LLVM IR (-O2):
define x86_fp80 @floorl(x86_fp80 %0) {
%2 = tail call x86_fp80 @do_round(x86_fp80 %0, i32 1024)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void bplus_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<bplus_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @bplus_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void nseel_asm_or0_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_or0_end() {
ret void
}
const char *_Locale_full_dayofweek(struct _Locale_time *__DUMMY_PAR1,
                                   int __DUMMY_PAR2) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
define i8* @_Locale_full_dayofweek(%struct._Locale_time* %0, i32 %1) {
%3 = alloca %struct._Locale_time*
%4 = alloca i32
store %struct._Locale_time* %0, %struct._Locale_time** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
define noalias i8* @_Locale_full_dayofweek(%struct._Locale_time* nocapture readnone %0, i32 %1) {
ret i8* null
}
int isdigit(int c) {
  if ((c <= '9') && (c >= '0'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x39,-0x8(%rbp)
jg     1127 <isdigit+0x27>
cmpl   $0x30,-0x8(%rbp)
jl     1127 <isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int gram_getindex(int node, int sz, int *tbl) {
  unsigned i;
  for (i = 0; i < sz; i++) {
    if (node == tbl[i]) {
      return (i);
    }
  }
  return (-1);
}


x86 assembly (clang, -O0):
<gram_getindex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1152 <gram_getindex+0x52>
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%edx
cmp    (%rcx,%rdx,4),%eax
jne    113f <gram_getindex+0x3f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <gram_getindex+0x59>
jmp    1144 <gram_getindex+0x44>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <gram_getindex+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gram_getindex>:
mov    $0xffffffff,%eax
test   %esi,%esi
je     111e <gram_getindex+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edi,(%rdx,%rcx,4)
je     111f <gram_getindex+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <gram_getindex+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gram_getindex(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int *lauren(int x, int y) {}


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

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

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

LLVM IR (-O2):
define noalias i32* @lauren(i32 %0, i32 %1) {
ret i32* undef
}
int nu_suppress_func() {}


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

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

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

LLVM IR (-O2):
define i32 @nu_suppress_func() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand_double() { return ((double)rand() / (double)RAND_MAX); }


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_double() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_double() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
int HelpCloseWindow(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpCloseWindow() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int test = 0;
  printf("test: %d\n", test);
  printf("test: %d\n", ++test);
  printf("test: %d\n", test);
  printf("test: %d\n", test++);
  printf("test: %d\n", test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"test: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}