xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hash_fnv1a_64(char *, size_t);
uint32_t get_key_hash(char *key, size_t len) {
  uint32_t val = hash_fnv1a_64(key, len);
  val %= 420000;
  return val;
}


x86 assembly (clang, -O0):
<get_key_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <hash_fnv1a_64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x668a0,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key_hash>:
push   %rax
call   1030 <hash_fnv1a_64@plt>
cltq
imul   $0x9fc8735,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2e,%rcx
add    %edx,%ecx
imul   $0x668a0,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_key_hash(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @hash_fnv1a_64(i8* %6, i64 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = srem i32 %9, 420000
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_key_hash(i8* %0, i64 %1) {
%3 = tail call i32 @hash_fnv1a_64(i8* %0, i64 %1)
%4 = srem i32 %3, 420000
ret i32 %4
}
void EEPROMIntEnable(unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(0x400AF040))) |= 0x00000001;
  (*((volatile unsigned long *)(0x400FD010))) |= 0x00000004;
}


x86 assembly (clang, -O0):
<EEPROMIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400af040,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x400af040,%eax
mov    %rcx,(%rax)
mov    $0x400fd010,%eax
mov    (%rax),%rcx
or     $0x4,%rcx
mov    $0x400fd010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMIntEnable>:
orq    $0x1,0x400af040
40 01
orq    $0x4,0x400fd010
40 04
ret

LLVM IR (-O0):
define void @EEPROMIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1074458688 to i64*)
%4 = or i64 %3, 1
store volatile i64 %4, i64* inttoptr (i64 1074458688 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%6 = or i64 %5, 4
store volatile i64 %6, i64* inttoptr (i64 1074778128 to i64*)
ret void
}

LLVM IR (-O2):
define void @EEPROMIntEnable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074458688 to i64*)
%3 = or i64 %2, 1
store volatile i64 %3, i64* inttoptr (i64 1074458688 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%5 = or i64 %4, 4
store volatile i64 %5, i64* inttoptr (i64 1074778128 to i64*)
ret void
}
__attribute__((no, noclone)) signed __int128 t108_5mul(unsigned __int128 x) {
  signed __int128 r;
  if (__builtin_mul_overflow(x, (unsigned __int128)(32), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t108_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x20,%ecx
mul    %rcx
mov    %rax,%rsi
mov    -0x50(%rbp),%rax
seto   %dl
mov    %dl,-0x41(%rbp)
mul    %rcx
mov    %rax,%rcx
mov    -0x41(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
test   %rdx,%rdx
sets   %sil
or     %sil,%al
mov    %rcx,-0x40(%rbp)
mov    %rdx,-0x38(%rbp)
test   $0x1,%al
jne    1183 <t108_5mul+0x73>
jmp    118a <t108_5mul+0x7a>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t108_5mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    $0x20,%esi
mul    %rsi
mov    %rax,%rcx
mov    %rdi,%rax
seto   %dil
mul    %rsi
mov    %rax,%r14
mov    %rdx,%rbx
add    %rcx,%rbx
setb   %al
or     %dil,%al
jne    1142 <t108_5mul+0x32>
test   %rbx,%rbx
jns    1149 <t108_5mul+0x39>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t108_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %11, i128 32)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ugt i128 %14, 170141183460469231731687303715884105727
%16 = or i1 %13, %15
store i128 %14, i128* %6
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %6
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t108_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 32)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
%10 = icmp slt i128 %9, 0
%11 = or i1 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 (...) @bar()
br label %14
14: ; preds = %12, %2
%15 = trunc i128 %9 to i64
%16 = lshr i128 %9, 64
%17 = trunc i128 %16 to i64
%18 = insertvalue { i64, i64 } poison, i64 %15, 0
%19 = insertvalue { i64, i64 } %18, i64 %17, 1
ret { i64, i64 } %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void reportTotalNum(int num) {
  printf("<rsp state=\"ok\"><return totalnum=\"%d\" /></rsp>\n", num);
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"<rsp state=\22ok\22><return totalnum=\22%d\22 /></rsp>\0A\00"
define void @reportTotalNum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"<rsp state=\22ok\22><return totalnum=\22%d\22 /></rsp>\0A\00"
define void @reportTotalNum(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M800_f(char *s) {
  debug("M800_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M800_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M800_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M800_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M800_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ machine;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int /*<<< orphan*/ uname(struct utsname *);
void setup_machinename(char *machine_out) {
  struct utsname host;
  uname(&host);
  strcpy(machine_out, host.machine);
}


x86 assembly (clang, -O0):
<setup_machinename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_machinename>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
%struct.utsname = type { i32 }
define void @setup_machinename(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.utsname
store i8* %0, i8** %2
%4 = call i32 @uname(%struct.utsname* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @strcpy(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define void @setup_machinename(i8* %0) {
%2 = alloca %struct.utsname
%3 = bitcast %struct.utsname* %2 to i8*
%4 = call i32 @uname(%struct.utsname* %2)
%5 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @strcpy(i8* %0, i32 %6)
ret void
}
/* Variables and functions */
int mvtlolevelirqinstall(int, void (*)());
int lolevelirqinstall(int irqnr, void (*handler)()) {
  return mvtlolevelirqinstall(irqnr, handler);
}


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

x86 assembly (clang, -O2):
<lolevelirqinstall>:
jmp    1030 <mvtlolevelirqinstall@plt>

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

LLVM IR (-O2):
define i32 @lolevelirqinstall(i32 %0, void (...)* %1) {
%3 = tail call i32 @mvtlolevelirqinstall(i32 %0, void (...)* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ execl(char *, char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  execl("/bin/ls", "ls", "-l", "./", NULL);
  perror("execl");
  exit(EXIT_FAILURE);
}


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)
lea    0xeb3(%rip),%rdi
lea    0xeb1(%rip),%rsi
lea    0xead(%rip),%rdx
lea    0xea9(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <execl@plt>
lea    0xe9b(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xebe(%rip),%rcx
xor    %r8d,%r8d
call   1050 <execl@plt>
lea    0xeb2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [3 x i8] c"-l\00"
@.str.3 = [3 x i8] c"./\00"
@.str.4 = [6 x i8] c"execl\00"
@EXIT_FAILURE = global i32 0
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 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* null)
%7 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [3 x i8] c"-l\00"
@.str.3 = [3 x i8] c"./\00"
@.str.4 = [6 x i8] c"execl\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* null)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void levelmatch(void) { nocall("levelmatch"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"levelmatch\00"
define void @levelmatch() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void ScaleARGBRowDown2_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDown2_Any_SSE2() {
ret void
}
void my_strcpy1(char *dst, const char *src) {
  while (*src != 0) {
    *dst = *src;
    ++dst, ++src;
  }
}


x86 assembly (clang, -O0):
<my_strcpy1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <my_strcpy1+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <my_strcpy1+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy1>:
mov    (%rsi),%al
test   %al,%al
je     1120 <my_strcpy1+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <my_strcpy1+0x10>
ret

LLVM IR (-O0):
define void @my_strcpy1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %10, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %4
%12 = load i8, i8* %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
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @my_strcpy1(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("No openmp");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"No openmp\00"
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 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"No openmp\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ XPending(int /*<<< orphan*/ *);
void flush_events(Display *display) {
  XEvent e;
  while (XPending(display))
    XNextEvent(display, &e);
}


x86 assembly (clang, -O0):
<flush_events>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <XPending@plt>
cmp    $0x0,%rax
je     1151 <flush_events+0x31>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <XNextEvent@plt>
jmp    112c <flush_events+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_events>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <XPending@plt>
test   %rax,%rax
je     1158 <flush_events+0x38>
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <XNextEvent@plt>
mov    %rbx,%rdi
call   1030 <XPending@plt>
test   %rax,%rax
jne    1140 <flush_events+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @flush_events(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @XPending(i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1, %6
%7 = call i32 @XNextEvent(i32* %0, i32* %2)
%8 = call i64 @XPending(i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_sub_uint16_t(int /*<<< orphan*/ *, int);
uint16_t atomic_dec_uint16_t(uint16_t *var) {
  return atomic_sub_uint16_t(var, 1);
}


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

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

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

LLVM IR (-O2):
define i32 @atomic_dec_uint16_t(i32* %0) {
%2 = tail call i32 @atomic_sub_uint16_t(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
size_t ft_strlen(char const *str) {
  char const *const save = str;
  while (*str != '\0')
    ++str;
  return (str - save);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <ft_strlen+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <ft_strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret

LLVM IR (-O0):
define i64 @ft_strlen(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 = %10, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %5
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @ft_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sys_delay(int msecs) { usleep(msecs * 1000); }


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

x86 assembly (clang, -O2):
<sys_delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @sys_delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I amd %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [23 x i8] c"I amd %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [23 x i8] c"I amd %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
/* 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\n", 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 = [5 x i8] c"%ld\0A\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 ([5 x i8], [5 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 = [5 x i8] c"%ld\0A\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 ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ fsync(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int main(void) {
  int fd = open("/dev/my_misc", O_RDWR);
  ioctl(fd, 0, 0);
  fsync(fd);
  while (1)
    pause();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%edi
call   1050 <fsync@plt>
mov    $0x0,%al
call   1040 <pause@plt>
jmp    117b <main+0x3b>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %ebx,%edi
call   1050 <fsync@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <pause@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/my_misc\00"
@O_RDWR = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @ioctl(i32 %5, i32 0, i32 0)
%7 = load i32, i32* %2
%8 = call i32 @fsync(i32 %7)
br label %9
9: ; preds = %0, %9
%10 = call i32 (...) @pause()
br label %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/my_misc\00"
@O_RDWR = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @ioctl(i32 %2, i32 0, i32 0)
%4 = tail call i32 @fsync(i32 %2)
br label %5
5: ; preds = %5, %0
%6 = tail call i32 (...) @pause()
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ isnan(double);
void uninitvar_isnan(void) {
  double d;
  (void)isnan(d);
}


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

x86 assembly (clang, -O2):
<uninitvar_isnan>:
jmp    1030 <isnan@plt>

LLVM IR (-O0):
define void @uninitvar_isnan() {
%1 = alloca double
%2 = load double, double* %1
%3 = call i32 @isnan(double %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_isnan() {
%1 = tail call i32 @isnan(double undef)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
struct list *list_from_fd(int, int *);
struct list *list_from_file(FILE *f, int *haseol) {
  int fd = fileno(f);
  if (fd == -1)
    return NULL;
  return list_from_fd(fd, haseol);
}


x86 assembly (clang, -O0):
<list_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1153 <list_from_file+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1163 <list_from_file+0x43>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <list_from_fd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_from_file>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fileno@plt>
cmp    $0xffffffff,%eax
je     1139 <list_from_file+0x19>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <list_from_fd@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @list_from_file(i32* %0, i32* %1) {
%3 = alloca %struct.list*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = call i32 @fileno(i32* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store %struct.list* null, %struct.list** %3
br label %16
12: ; preds = %2
%13 = load i32, i32* %6
%14 = load i32*, i32** %5
%15 = call %struct.list* @list_from_fd(i32 %13, i32* %14)
store %struct.list* %15, %struct.list** %3
br label %16
16: ; preds = %12, %11
%17 = load %struct.list*, %struct.list** %3
ret %struct.list* %17
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @list_from_file(i32* nocapture %0, i32* %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call %struct.list* @list_from_fd(i32 %3, i32* %1)
br label %7
7: ; preds = %2, %5
%8 = phi %struct.list* [ %6, %5 ], [ null, %2 ]
ret %struct.list* %8
}
/* Variables and functions */
int getnpar(int, char *, char *, unsigned long *);
int getnparulong(int n, char *name, unsigned long *ptr) {
  return getnpar(n, name, "v", ptr);
}


x86 assembly (clang, -O0):
<getnparulong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnparulong>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <getnpar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"v\00"
define i32 @getnparulong(i32 %0, i8* %1, i64* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64* %2, i64** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64*, i64** %6
%10 = call i32 @getnpar(i32 %7, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"v\00"
define i32 @getnparulong(i32 %0, i8* %1, i64* %2) {
%4 = tail call i32 @getnpar(i32 %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test(int a[]) { printf("%d\n", (int)(sizeof(a) / sizeof(*a))); }


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

x86 assembly (clang, -O2):
<test>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @test(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
void temp_dummy() { return; }


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

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

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

LLVM IR (-O2):
define void @temp_dummy() {
ret void
}
void worker(void (*f)(int, int, int), int a, int b, int c) { f(a, b, c); }


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    *%rax

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

LLVM IR (-O2):
define void @worker(void (i32, i32, i32)* nocapture %0, i32 %1, i32 %2, i32 %3) {
tail call void %0(i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int posix_memalign(void **, size_t, size_t);
int __libc_posix_memalign(void **memptr, size_t alignment, size_t size) {
  return posix_memalign(memptr, alignment, size);
}


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

x86 assembly (clang, -O2):
<__libc_posix_memalign>:
jmp    1030 <posix_memalign@plt>

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

LLVM IR (-O2):
define i32 @__libc_posix_memalign(i8** %0, i64 %1, i64 %2) {
%4 = tail call i32 @posix_memalign(i8** %0, i64 %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ bios_printf(int, char *);
int /*<<< orphan*/ write_byte(int, int, int);
void set_diskette_current_cyl(uint8_t drive, uint8_t cyl) {
  if (drive > 1)
    bios_printf((2 | 4 | 1), "set_diskette_current_cyl: drive > 1\n");
  write_byte(0x0040, 0x0094 + drive, cyl);
}


x86 assembly (clang, -O0):
<set_diskette_current_cyl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1149 <set_diskette_current_cyl+0x29>
mov    $0x7,%edi
lea    0xebc(%rip),%rsi
call   1030 <bios_printf@plt>
mov    -0x4(%rbp),%esi
add    $0x94,%esi
mov    -0x8(%rbp),%edx
mov    $0x40,%edi
call   1040 <write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_diskette_current_cyl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    $0x2,%edi
jl     113d <set_diskette_current_cyl+0x1d>
lea    0xecd(%rip),%rsi
mov    $0x7,%edi
call   1030 <bios_printf@plt>
add    $0x94,%ebp
mov    $0x40,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <write_byte@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"set_diskette_current_cyl: drive > 1\0A\00"
define void @set_diskette_current_cyl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @bios_printf(i32 7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %3
%11 = add nsw i32 148, %10
%12 = load i32, i32* %4
%13 = call i32 @write_byte(i32 64, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"set_diskette_current_cyl: drive > 1\0A\00"
define void @set_diskette_current_cyl(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @bios_printf(i32 7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = add nsw i32 %0, 148
%8 = tail call i32 @write_byte(i32 64, i32 %7, i32 %1)
ret void
}
void av_xtea_le_init() {}


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

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

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

LLVM IR (-O2):
define void @av_xtea_le_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a, b;
  b = 2;
  a = b++ + b;
  printf("%d\n", a);
  printf("%d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb7(%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
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
int ilog2(int v) {
  int r = 0;
  while (v >>= 1)
    r++;
  return r;
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <ilog2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <ilog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ymax_bound_acc();
int /*<<< orphan*/ ymin_bound_acc();
void set_bc(void) {
  ymin_bound_acc();
  ymax_bound_acc();
  return;
}


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

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

LLVM IR (-O0):
define void @set_bc() {
%1 = call i32 (...) @ymin_bound_acc()
%2 = call i32 (...) @ymax_bound_acc()
ret void
}

LLVM IR (-O2):
define void @set_bc() {
%1 = tail call i32 (...) @ymin_bound_acc()
%2 = tail call i32 (...) @ymax_bound_acc()
ret void
}
int f() { return 0x101; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 257
}

LLVM IR (-O2):
define i32 @f() {
ret i32 257
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t bit_apply_mask(uint8_t from, uint8_t to, uint64_t val) {
  return (val & (~(~0 << (to - from + 1)) << from)) >> from;
}


x86 assembly (clang, -O0):
<bit_apply_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_apply_mask>:
sub    %edi,%esi
lea    0x1(%rsi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %edi,%ecx
shl    %cl,%eax
and    %edx,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @bit_apply_mask(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 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = shl i32 -1, %11
%13 = xor i32 %12, -1
%14 = load i32, i32* %4
%15 = shl i32 %13, %14
%16 = and i32 %7, %15
%17 = load i32, i32* %4
%18 = ashr i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @bit_apply_mask(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = shl nsw i32 -1, %5
%7 = xor i32 %6, -1
%8 = shl i32 %7, %0
%9 = and i32 %8, %2
%10 = ashr i32 %9, %0
ret i32 %10
}
short tile_get_id_by_location(int x, int y) {
  if (x > 256 || y > 256)
    return 0;
  return (x + (y * 8));
}


x86 assembly (clang, -O0):
<tile_get_id_by_location>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     1124 <tile_get_id_by_location+0x24>
cmpl   $0x100,-0xc(%rbp)
jle    112f <tile_get_id_by_location+0x2f>
movw   $0x0,-0x2(%rbp)
jmp    113e <tile_get_id_by_location+0x3e>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tile_get_id_by_location>:
xor    %ecx,%ecx
cmp    $0x101,%esi
lea    (%rdi,%rsi,8),%eax
cmovge %ecx,%eax
cmp    $0x101,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @tile_get_id_by_location(i32 %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 256
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 256
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i16 0, i16* %3
br label %18
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = mul nsw i32 %14, 8
%16 = add nsw i32 %13, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %3
br label %18
18: ; preds = %12, %11
%19 = load i16, i16* %3
ret i16 %19
}

LLVM IR (-O2):
define signext i16 @tile_get_id_by_location(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 256
%4 = icmp sgt i32 %1, 256
%5 = or i1 %3, %4
%6 = shl nsw i32 %1, 3
%7 = add nsw i32 %6, %0
%8 = trunc i32 %7 to i16
%9 = select i1 %5, i16 0, i16 %8
ret i16 %9
}
void vsub(const double *src1, const double *src2, double *dst) {
  dst[0] = src1[0] - src2[0];
  dst[1] = src1[1] - src2[1];
  dst[2] = src1[2] - src2[2];
}


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

x86 assembly (clang, -O2):
<vsub>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
subsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rdi),%xmm0
subsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

LLVM IR (-O0):
define void @vsub(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 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @vsub(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fsub double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}