xunge/DecIR huggingface dataset:
int test_imm_89uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x89 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_89uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 137
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_cmd(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int memtest() {
  char cmd[20];
  printf("memory test\n");
  strcpy(cmd, "mt");
  do_cmd(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<memtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
call   1050 <do_cmd@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memtest>:
push   %rbx
sub    $0x20,%rsp
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <do_cmd@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"memory test\0A\00"
@.str.1 = [3 x i8] c"mt\00"
define i32 @memtest() {
%1 = alloca [20 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i32 @do_cmd(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"mt\00"
@str = [12 x i8] c"memory test\00"
define i32 @memtest() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @do_cmd(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t hton64(uint64_t n) { return n; }


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

x86 assembly (clang, -O2):
<hton64>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hton64(i32 returned %0) {
ret i32 %0
}
char *textdomain(domainname) const char *domainname;
{ return textdomain__(domainname); }


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

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

LLVM IR (-O0):
define i8* @textdomain(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @textdomain__ to i32 (i8*, ...)*)(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @textdomain(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @textdomain__ to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzFetch_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQDOWN(int);
void BrzFetch_reqdown(struct comp *comp, int port) {
  struct BrzFetch_ *c = (struct BrzFetch_ *)comp;
  SEND_REQDOWN(1);
}


x86 assembly (clang, -O0):
<BrzFetch_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <SEND_REQDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzFetch_reqdown>:
mov    $0x1,%edi
jmp    1030 <SEND_REQDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzFetch_ = type { i32 }
define void @BrzFetch_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzFetch_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzFetch_*
store %struct.BrzFetch_* %7, %struct.BrzFetch_** %5
%8 = call i32 @SEND_REQDOWN(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzFetch_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_REQDOWN(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int O_CREAT;
int O_EXCL;
int /*<<< orphan*/ close(int);
int openat(int, char const *, int, int /*<<< orphan*/);
int mknodat(int fd, const char *path, mode_t mode, dev_t dev) {
  int tmpfd;
  if ((tmpfd = openat(fd, path, O_CREAT | O_EXCL, mode)) == -1) {
    return (-1);
  }
  (void)close(tmpfd);
  return (0);
}


x86 assembly (clang, -O0):
<mknodat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    0x2e8c(%rip),%rax
or     (%rax),%edx
mov    -0x14(%rbp),%ecx
call   1030 <openat@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    116e <mknodat+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <mknodat+0x5d>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mknodat>:
push   %rax
mov    %edx,%ecx
mov    0x2ece(%rip),%rax
mov    0x2ea7(%rip),%rdx
mov    (%rdx),%edx
or     (%rax),%edx
call   1030 <openat@plt>
cmp    $0xffffffff,%eax
je     114a <mknodat+0x2a>
mov    %eax,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_EXCL = global i32 0
define i32 @mknodat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* @O_CREAT
%14 = load i32, i32* @O_EXCL
%15 = or i32 %13, %14
%16 = load i32, i32* %8
%17 = call i32 @openat(i32 %11, i8* %12, i32 %15, i32 %16)
store i32 %17, i32* %10
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %20
19: ; preds = %4
store i32 -1, i32* %5
br label %23
20: ; preds = %4
%21 = load i32, i32* %10
%22 = call i32 @close(i32 %21)
store i32 0, i32* %5
br label %23
23: ; preds = %20, %19
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_EXCL = global i32 0
define i32 @mknodat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = load i32, i32* @O_CREAT
%6 = load i32, i32* @O_EXCL
%7 = or i32 %6, %5
%8 = tail call i32 @openat(i32 %0, i8* %1, i32 %7, i32 %2)
%9 = icmp eq i32 %8, -1
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @close(i32 %8)
br label %12
12: ; preds = %4, %10
%13 = phi i32 [ 0, %10 ], [ -1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(char *);
void *start_thread(void *argv) {
  printf("======start_thread========\n");
  pthread_exit("hello world");
  printf("after pthread_exit\n");
}


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

x86 assembly (clang, -O2):
<start_thread>:
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <pthread_exit@plt>
lea    0xee7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"======start_thread========\0A\00"
@.str.1 = [12 x i8] c"hello world\00"
@.str.2 = [20 x i8] c"after pthread_exit\0A\00"
define i8* @start_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"hello world\00"
@str = [27 x i8] c"======start_thread========\00"
@str.3 = [19 x i8] c"after pthread_exit\00"
define noalias i8* @start_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
scalar_t__ rand();
void random_matrix_short(short *a, const unsigned int rows,
                         const unsigned int cols) {
  for (unsigned int i = 0; i < rows * cols; i++) {
    a[i] = (short)rand();
  }
}


x86 assembly (clang, -O0):
<random_matrix_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jae    115e <random_matrix_short+0x4e>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %ax,%dx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dx,(%rax,%rcx,2)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <random_matrix_short+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_matrix_short>:
push   %r15
push   %r14
push   %rbx
imul   %edx,%esi
test   %esi,%esi
je     1145 <random_matrix_short+0x35>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %ax,(%r14,%rbx,2)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_matrix_short+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_matrix_short(i16* %0, i32 %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i16* %0, i16** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul i32 %10, %11
%13 = icmp ult i32 %9, %12
br i1 %13, label %14, label %24
14: ; preds = %8
%15 = call i64 (...) @rand()
%16 = trunc i64 %15 to i16
%17 = load i16*, i16** %4
%18 = load i32, i32* %7
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i16, i16* %17, i64 %19
store i16 %16, i16* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %7
%23 = add i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @random_matrix_short(i16* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %14, %9 ]
%11 = tail call i64 (...) @rand()
%12 = trunc i64 %11 to i16
%13 = getelementptr inbounds i16, i16* %0, i64 %10
store i16 %12, i16* %13
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %9
}
void PrintFactJNGetVar1(void *theEnv, const char *logicalName, void *theValue) {

}


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

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

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

LLVM IR (-O2):
define void @PrintFactJNGetVar1(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_commands();
int cli_loop();
int main(int argc, char *argv[]) {
  add_commands();
  return cli_loop();
}


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    $0x0,%al
call   1040 <add_commands@plt>
mov    $0x0,%al
call   1030 <cli_loop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <add_commands@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cli_loop@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 = call i32 (...) @add_commands()
%7 = call i32 (...) @cli_loop()
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @add_commands()
%4 = tail call i32 (...) @cli_loop()
ret i32 %4
}
void stripChar(char *s, char *d, char c) {
  while (*s) {
    if (*s != c) {
      *d++ = *s;
    }
    s++;
  }
  *d = '\0';
}


x86 assembly (clang, -O0):
<stripChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <stripChar+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     1148 <stripChar+0x48>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1111 <stripChar+0x11>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripChar>:
mov    (%rdi),%al
test   %al,%al
je     1127 <stripChar+0x27>
add    $0x1,%rdi
jmp    111b <stripChar+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1127 <stripChar+0x27>
cmp    %dl,%al
je     1110 <stripChar+0x10>
mov    %al,(%rsi)
add    $0x1,%rsi
jmp    1110 <stripChar+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @stripChar(i8* nocapture %0, i8* nocapture writeonly %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3, %13
%7 = phi i8 [ %16, %13 ], [ %4, %3 ]
%8 = phi i8* [ %15, %13 ], [ %0, %3 ]
%9 = phi i8* [ %14, %13 ], [ %1, %3 ]
%10 = icmp eq i8 %7, %2
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %7, i8* %9
br label %13
13: ; preds = %11, %6
%14 = phi i8* [ %12, %11 ], [ %9, %6 ]
%15 = getelementptr inbounds i8, i8* %8, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %13, %3
%19 = phi i8* [ %1, %3 ], [ %14, %13 ]
store i8 0, i8* %19
ret void
}
/* Variables and functions */
int yla_suite();
int main() { return yla_suite(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yla_suite()
ret i32 %1
}
int foo(int bar) { return bar * bar / bar + bar - bar % bar; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0x4(%rbp)
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    %edx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_ortho(float *, float, float, float, float, float,
                              float);
__attribute__((always_)) struct mat4 *psmat4_ortho(struct mat4 *result, float l,
                                                   float r, float b, float t,
                                                   float n, float f) {
  mat4_ortho((float *)result, l, r, b, t, n, f);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_ortho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  %xmm4,-0x1c(%rbp)
movss  %xmm5,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
movss  -0x1c(%rbp),%xmm4
movss  -0x20(%rbp),%xmm5
call   1030 <mat4_ortho@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_ortho(%struct.mat4* %0, float %1, float %2, float %3, float %4, float %5, float %6) {
%8 = alloca %struct.mat4*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store %struct.mat4* %0, %struct.mat4** %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
store float %6, float* %14
%15 = load %struct.mat4*, %struct.mat4** %8
%16 = bitcast %struct.mat4* %15 to float*
%17 = load float, float* %9
%18 = load float, float* %10
%19 = load float, float* %11
%20 = load float, float* %12
%21 = load float, float* %13
%22 = load float, float* %14
%23 = call i32 @mat4_ortho(float* %16, float %17, float %18, float %19, float %20, float %21, float %22)
%24 = load %struct.mat4*, %struct.mat4** %8
ret %struct.mat4* %24
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_ortho(%struct.mat4* returned %0, float %1, float %2, float %3, float %4, float %5, float %6) {
%8 = bitcast %struct.mat4* %0 to float*
%9 = tail call i32 @mat4_ortho(float* %8, float %1, float %2, float %3, float %4, float %5, float %6)
ret %struct.mat4* %0
}
/* Variables and functions */
int fc8080_init(void *);
int bbm_com_init(void *handle) {
  int res;
  res = fc8080_init(handle);
  return res;
}


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

x86 assembly (clang, -O2):
<bbm_com_init>:
jmp    1030 <fc8080_init@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_init(i8* %0) {
%2 = tail call i32 @fc8080_init(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpgid(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  (void)getpgid((pid_t)0);
  printf("#define HAVE_GETPGID /* yes */\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <getpgid@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"#define HAVE_GETPGID /* yes */\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @getpgid(i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"#define HAVE_GETPGID /* yes */\00"
define i32 @main() {
%1 = tail call i32 @getpgid(i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ driveLift(int /*<<< orphan*/);
void stopLift() { driveLift(0); }


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

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

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

LLVM IR (-O2):
define void @stopLift() {
%1 = tail call i32 @driveLift(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ analyse_param_convert(int, char **, char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char *argv[]) {
  char input[512];
  char output[512];
  analyse_param_convert(argc, argv, input, output, "geno");
  printf("%s %s\n", input, output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    -0x410(%rbp),%rcx
lea    0xeab(%rip),%r8
call   1040 <analyse_param_convert@plt>
lea    -0x210(%rbp),%rsi
lea    -0x410(%rbp),%rdx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
lea    0xecf(%rip),%r8
lea    0x200(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <analyse_param_convert@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"geno\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%7 = call i32 @analyse_param_convert(i32 %0, i8** %1, i8* %5, i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
ret i32 0
}
int par(int i) { return (i - 1) / 2; }


x86 assembly (clang, -O0):
<par>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<par>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @par(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
extern __attribute__((gnu_)) int iscntrl(int __c) { return __c < 0x20; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
xor    %eax,%eax
cmp    $0x20,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 32
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int factorial1(int);
int factorial2(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("factorial1(5) = %d\n", factorial1(5));
  printf("factorial2(5) = %d\n", factorial2(5));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1050 <factorial1@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <factorial2@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <factorial1@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <factorial2@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"factorial1(5) = %d\0A\00"
@.str.1 = [20 x i8] c"factorial2(5) = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @factorial1(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @factorial2(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int test_04(unsigned char *x) { return x[9000]; }


x86 assembly (clang, -O0):
<test_04>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2328(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_04>:
movzbl 0x2328(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_04(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 9000
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_04(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 9000
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
void com() { mpush(~mpop()); }


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

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

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

LLVM IR (-O2):
define void @com() {
%1 = tail call i32 (...) @mpop()
%2 = xor i32 %1, -1
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @mpush to i32 (i32, ...)*)(i32 %2)
ret void
}
extern unsigned int __inw(unsigned short port) {
  unsigned int _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       "w"
                       "1,%"
                       "w"
                       "0"
                       : "=a"(_v)
                       : "d"(port), "0"(0));
  return _v;
}


x86 assembly (clang, -O0):
<__inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
xor    %eax,%eax
in     (%dx),%ax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inw>:
mov    %edi,%edx
xor    %eax,%eax
in     (%dx),%ax
ret

LLVM IR (-O0):
define i32 @__inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inw ${1:w},${0:w}", "={ax},{dx},0,~{dirflag},~{fpsr},~{flags}"(i16 %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @__inw(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inw ${1:w},${0:w}", "={ax},{dx},0,~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 0)
ret i32 %2
}
void pause_for_debug_() {}


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

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

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

LLVM IR (-O2):
define void @pause_for_debug_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void barf(const char *s, ...) { __coverity_panic__(); }


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

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

LLVM IR (-O0):
define void @barf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @barf(i8* nocapture readnone %0, ...) {
%2 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void *d_rtclock_time_new() {
  empty_log("d_rtclock_time_new\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"d_rtclock_time_new\0A\00"
define i8* @d_rtclock_time_new() {
%1 = call i32 @empty_log(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [20 x i8] c"d_rtclock_time_new\0A\00"
define noalias i8* @d_rtclock_time_new() {
%1 = tail call i32 @empty_log(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200];
  scanf("%s", word);
  printf("%ld", hash(word));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char toupper(char);
char *Q_strupr(char *string) {
  char *s = string;
  while (*s) {
    *s = toupper(*s);
    s++;
  }
  return string;
}


x86 assembly (clang, -O0):
<Q_strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <Q_strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Q_strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <Q_strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Q_strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @Q_strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
void BASIC_CONSTRAINTS_free(void) {}


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

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

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

LLVM IR (-O2):
define void @BASIC_CONSTRAINTS_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main_demo();
int main(void) { main_demo(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_demo()
ret i32 0
}
int my_strlen(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0')
    i = i + 1;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
double clampd(double val, double min, double max) {
  return (val < min) ? min : (val > max) ? max : val;
}


x86 assembly (clang, -O0):
<clampd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clampd+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <clampd+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <clampd+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <clampd+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampd>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @clampd(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ aes_close();
int /*<<< orphan*/ net_close();
void cnet_close(void) {
  aes_close();
  net_close();
}


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

x86 assembly (clang, -O2):
<cnet_close>:
push   %rax
xor    %eax,%eax
call   1030 <aes_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <net_close@plt>

LLVM IR (-O0):
define void @cnet_close() {
%1 = call i32 (...) @aes_close()
%2 = call i32 (...) @net_close()
ret void
}

LLVM IR (-O2):
define void @cnet_close() {
%1 = tail call i32 (...) @aes_close()
%2 = tail call i32 (...) @net_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display(int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ selSort(int *, int);
int main() {
  int arr[10] = {32, 99, 56, 10, 12, 9, 11, 1, 6, 8};
  printf("\n\n\t\t\t  * * *  Welcome  * * * ");
  display(arr);
  selSort(arr, 10);
  display(arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <display@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1060 <selSort@plt>
lea    -0x30(%rbp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <display@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <selSort@plt>
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 32, i32 99, i32 56, i32 10, i32 12, i32 9, i32 11, i32 1, i32 6, i32 8]
@.str = [30 x i8] c"\0A\0A\09\09\09 * * * Welcome * * * \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @display(i32* %5)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @selSort(i32* %7, i32 10)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @display(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 32, i32 99, i32 56, i32 10, i32 12, i32 9, i32 11, i32 1, i32 6, i32 8]
@.str = [30 x i8] c"\0A\0A\09\09\09 * * * Welcome * * * \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @display(i32* %4)
%6 = call i32 @selSort(i32* %4, i32 10)
%7 = call i32 @display(i32* %4)
ret i32 0
}
/* Variables and functions */
int checker_read_long_long(int, char const *, int, long long *);
int checker_read_team_long_long(const char *name, int eof_error_flag,
                                long long *p_val) {
  return checker_read_long_long(1, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_team_long_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <checker_read_long_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_team_long_long>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <checker_read_long_long@plt>

LLVM IR (-O0):
define i32 @checker_read_team_long_long(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 = load i64*, i64** %6
%10 = call i32 @checker_read_long_long(i32 1, i8* %7, i32 %8, i64* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @checker_read_team_long_long(i8* %0, i32 %1, i64* %2) {
%4 = tail call i32 @checker_read_long_long(i32 1, i8* %0, i32 %1, i64* %2)
ret i32 %4
}
/* Type definitions */
struct connectdata {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t Curl_ssl_send(struct connectdata *conn, int sockindex, void *mem,
                      size_t len) {
  (void)conn;
  (void)sockindex;
  (void)mem;
  (void)len;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.connectdata = type { i32 }
define i32 @Curl_ssl_send(%struct.connectdata* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i64 %3) {
ret i32 0
}