xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc21(int status, void *arg) {
  printf("Executing exitfunc21 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


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

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

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

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc21 (status=%d, arg=%d)\0A\00"
define void @exitfunc21(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_5b(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x18, 0x1D, 0x16, 0x10, 0x11, 0x04, 0x1E, 0x08, 0x19, 0x0E, 0x0F,
      0x02, 0x14, 0x1C, 0x07, 0x17, 0x0D, 0x09, 0x12, 0x1A, 0x05, 0x01,
      0x0B, 0x0A, 0x13, 0x15, 0x0C, 0x00, 0x06, 0x1F, 0x03, 0x1B,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_5b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_5b>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_5b.LUT = internal global [32 x i8] c"\18\1D\16\10\11\04\1E\08\19\0E\0F\02\14\1C\07\17\0D\09\12\1A\05\01\0B\0A\13\15\0C\00\06\1F\03\1B"
define i32 @yahoo_f01_5b(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 = load i32, i32* %4
%7 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_5b.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_5b.LUT = internal global [32 x i8] c"\18\1D\16\10\11\04\1E\08\19\0E\0F\02\14\1C\07\17\0D\09\12\1A\05\01\0B\0A\13\15\0C\00\06\1F\03\1B"
define i32 @yahoo_f01_5b(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_5b.LUT, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void ProcReschedule(void) { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @ProcReschedule() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hash_f2(uint64_t t) { return 1 + (t % (8193 - 1)); }


x86 assembly (clang, -O0):
<hash_f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2000,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_f2>:
lea    0x1fff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xffffe000,%eax
neg    %eax
add    %edi,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_f2(i32 %0) {
%2 = srem i32 %0, 8192
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  float num;
  num = 1.2;
  printf("%d", sizeof(float));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x4,%esi
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    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_delete_mark() {
ret void
}
int replacetabs(char aux[], int tabpos) {
  int pos, limit;
  limit = tabpos + 4;
  for (pos = tabpos; pos < limit; ++pos)
    aux[pos] = ' ';
  return limit;
}


x86 assembly (clang, -O0):
<replacetabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1140 <replacetabs+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <replacetabs+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replacetabs>:
push   %rbx
movslq %esi,%rdx
lea    0x4(%rsi),%ebx
add    %rdx,%rdi
lea    0x1(%rdx),%eax
cmp    %eax,%ebx
cmovg  %ebx,%eax
not    %edx
add    %eax,%edx
add    $0x1,%rdx
mov    $0x20,%esi
call   1030 <memset@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @replacetabs(i8* nocapture writeonly %0, i32 %1) {
%3 = add i32 %1, 4
%4 = sext i32 %1 to i64
%5 = getelementptr i8, i8* %0, i64 %4
%6 = add i32 %1, 1
%7 = call i32 @llvm.smax.i32(i32 %3, i32 %6)
%8 = xor i32 %1, -1
%9 = add i32 %7, %8
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
ret i32 %3
}
void glue_1() {}


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

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

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

LLVM IR (-O2):
define void @glue_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printf_array(int A[], int array_size) {
  for (int i = 0; i < array_size; i++)
    printf("%-3d", A[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printf_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printf_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printf_array+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printf_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printf_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116b <printString+0x5b>
mov    -0x4(%rbp),%edi
add    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    $0xf,%edx
movsbl (%rax,%rcx,1),%ecx
call   1030 <setPixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <printString+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdx),%al
test   %al,%al
je     1150 <printString+0x40>
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%ecx
mov    %ebp,%edi
mov    %r14d,%esi
mov    $0xf,%edx
call   1030 <setPixel@plt>
movzbl (%rbx),%eax
add    $0x1,%ebp
add    $0x1,%rbx
test   %al,%al
jne    1130 <printString+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @printString(i32 %0, i32 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %12, %6 ], [ 0, %3 ]
%8 = phi i8 [ %14, %6 ], [ %4, %3 ]
%9 = trunc i64 %7 to i32
%10 = add i32 %9, %0
%11 = tail call i32 @setPixel(i32 %10, i32 %1, i32 15, i8 signext %8)
%12 = add nuw i64 %7, 1
%13 = getelementptr inbounds i8, i8* %2, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3
ret void
}
void gtk_image_menu_item_get_image() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_menu_item_get_image() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
char tolower(int);
int main(void) {
  char buf[10];
  int rc = 1;
  printf("Are you sure? [y/N] ");
  fgets(buf, sizeof buf, stdin);
  if ('y' == tolower((int)buf[0])) {
    rc = 0;
  }
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1040 <fgets@plt>
movsbl -0xe(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%ecx
mov    $0x79,%eax
cmp    %ecx,%eax
jne    1189 <main+0x59>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xe(%rsp),%rdi
mov    $0xa,%esi
call   1040 <fgets@plt>
movsbl 0xe(%rsp),%edi
call   1050 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x79,%al
setne  %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Are you sure? [y/N] \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 10, i32 %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call signext i8 @tolower(i32 %10)
%12 = sext i8 %11 to i32
%13 = icmp eq i32 121, %12
br i1 %13, label %14, label %15
14: ; preds = %0
store i32 0, i32* %3
br label %15
15: ; preds = %14, %0
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [21 x i8] c"Are you sure? [y/N] \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 10, i32 %4)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = call signext i8 @tolower(i32 %7)
%9 = icmp ne i8 %8, 121
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ create_array(int **, int);
int /*<<< orphan*/ partition(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ print_array(int *, int);
int main() {
  int *arr = NULL, size = 10;
  create_array(&arr, size);
  print_array(arr, size);
  partition(arr, 0, size - 1);
  print_array(arr, size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <create_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <print_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <partition@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1050 <create_array@plt>
mov    (%rsp),%rdi
mov    $0xa,%esi
call   1040 <print_array@plt>
mov    (%rsp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <partition@plt>
mov    (%rsp),%rdi
mov    $0xa,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
store i32* null, i32** %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @create_array(i32** %1, i32 %3)
%5 = load i32*, i32** %1
%6 = load i32, i32* %2
%7 = call i32 @print_array(i32* %5, i32 %6)
%8 = load i32*, i32** %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = call i32 @partition(i32* %8, i32 0, i32 %10)
%12 = load i32*, i32** %1
%13 = load i32, i32* %2
%14 = call i32 @print_array(i32* %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%3 = call i32 @create_array(i32** %1, i32 10)
%4 = load i32*, i32** %1
%5 = call i32 @print_array(i32* %4, i32 10)
%6 = load i32*, i32** %1
%7 = call i32 @partition(i32* %6, i32 0, i32 9)
%8 = load i32*, i32** %1
%9 = call i32 @print_array(i32* %8, i32 10)
ret i32 0
}
char *hmac384base64(bitstr, bitcnt, key, keylen)
unsigned char *bitstr;
unsigned long bitcnt;
unsigned char *key;
unsigned int keylen;
{ return ((char *)hmaccomp(384, 3, bitstr, bitcnt, key, keylen)); }


x86 assembly (clang, -O0):
<hmac384base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x180,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <hmaccomp@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac384base64>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x180,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <hmaccomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hmac384base64(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 384, i32 3, i8* %9, i64 %10, i8* %11, i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @hmac384base64(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 384, i32 3, i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void brainfuck_put(char c) { putchar(c); }


x86 assembly (clang, -O0):
<brainfuck_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brainfuck_put>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @brainfuck_put(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Variables and functions */
int hvc_read_nguests(int *);
int hyp_read_nguests(unsigned int *nguests) {
  int sysregs[12];
  int ret;
  ret = hvc_read_nguests(sysregs);
  *nguests = *((unsigned int *)&sysregs[0]);
  return ret;
}


x86 assembly (clang, -O0):
<hyp_read_nguests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <hvc_read_nguests@plt>
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x44(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hyp_read_nguests>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <hvc_read_nguests@plt>
mov    (%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hyp_read_nguests(i32* %0) {
%2 = alloca i32*
%3 = alloca [12 x i32]
%4 = alloca i32
store i32* %0, i32** %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 @hvc_read_nguests(i32* %5)
store i32 %6, i32* %4
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
store i32 %8, i32* %9
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @hyp_read_nguests(i32* nocapture writeonly %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 @hvc_read_nguests(i32* %4)
%6 = load i32, i32* %4
store i32 %6, i32* %0
ret i32 %5
}
int count_ch(const char *str, int ch) {
  int count = 0;
  for (; str && *str; ++str)
    if (*str == ch)
      ++count;
  return count;
}


x86 assembly (clang, -O0):
<count_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1132 <count_ch+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1142 <count_ch+0x42>
jmp    1171 <count_ch+0x71>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    115b <count_ch+0x5b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <count_ch+0x60>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <count_ch+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ch>:
xor    %eax,%eax
test   %rdi,%rdi
je     1137 <count_ch+0x37>
mov    (%rdi),%cl
test   %cl,%cl
je     1137 <count_ch+0x37>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %cl,%ecx
xor    %edx,%edx
cmp    %esi,%ecx
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <count_ch+0x20>
ret

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

LLVM IR (-O2):
define i32 @count_ch(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %16, %7 ], [ %5, %4 ]
%9 = phi i8* [ %15, %7 ], [ %0, %4 ]
%10 = phi i32 [ %14, %7 ], [ 0, %4 ]
%11 = sext i8 %8 to i32
%12 = icmp eq i32 %11, %1
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %10, %13
%15 = getelementptr inbounds i8, i8* %9, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %7, %4, %2
%19 = phi i32 [ 0, %2 ], [ 0, %4 ], [ %14, %7 ]
ret i32 %19
}
/* Variables and functions */
long long calculate_digit(int, int);
long long calculate_cnpj_digit(int radix, int filial) {
  return (long long)radix * 1000000 + filial * 100 +
         calculate_digit(radix, filial);
}


x86 assembly (clang, -O0):
<calculate_cnpj_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
imul   $0xf4240,%rax,%rax
imul   $0x64,-0x8(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calculate_digit@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_cnpj_digit>:
push   %rbx
movslq %edi,%rdi
imul   $0xf4240,%rdi,%rax
imul   $0x64,%esi,%ecx
movslq %ecx,%rbx
add    %rax,%rbx
call   1030 <calculate_digit@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @calculate_cnpj_digit(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 = sext i32 %5 to i64
%7 = mul nsw i64 %6, 1000000
%8 = load i32, i32* %4
%9 = mul nsw i32 %8, 100
%10 = sext i32 %9 to i64
%11 = add nsw i64 %7, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i64 @calculate_digit(i32 %12, i32 %13)
%15 = add nsw i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @calculate_cnpj_digit(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = mul nsw i64 %3, 1000000
%5 = mul nsw i32 %1, 100
%6 = sext i32 %5 to i64
%7 = add nsw i64 %4, %6
%8 = tail call i64 @calculate_digit(i32 %0, i32 %1)
%9 = add nsw i64 %7, %8
ret i64 %9
}
/* Type definitions */
struct tstat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *);
char *procprt_RUNDELAY_e(struct tstat *curstat, int avgval, int nsecs) {
  static char buf[10];
  snprintf(buf, sizeof buf, "     -");
  return buf;
}


x86 assembly (clang, -O0):
<procprt_RUNDELAY_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0x2f00(%rip),%rdi
mov    $0xa,%esi
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ee8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_RUNDELAY_e>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tstat = type { i32 }
@procprt_RUNDELAY_e.buf = internal global [10 x i8] zeroinitializer
@.str = [7 x i8] c" -\00"
define i8* @procprt_RUNDELAY_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @procprt_RUNDELAY_e.buf, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @procprt_RUNDELAY_e.buf, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type { i32 }
@procprt_RUNDELAY_e.buf = internal global [10 x i8] zeroinitializer
@.str = [7 x i8] c" -\00"
define i8* @procprt_RUNDELAY_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @procprt_RUNDELAY_e.buf, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @procprt_RUNDELAY_e.buf, i64 0, i64 0)
}
char *mp_encode_nil(char *data) {
  *data = 0xc0;
  return data + 1;
}


x86 assembly (clang, -O0):
<mp_encode_nil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xc0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_encode_nil>:
movb   $0xc0,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @mp_encode_nil(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 -64, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}

LLVM IR (-O2):
define i8* @mp_encode_nil(i8* writeonly %0) {
store i8 -64, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Variables and functions */
int ext2fs_clear_bit(unsigned int nr, void *addr) {
  int mask, retval;
  unsigned char *ADDR = (unsigned char *)addr;
  ADDR += nr >> 3;
  mask = 1 << (nr & 0x07);
  retval = mask & *ADDR;
  *ADDR &= ~mask;
  return retval;
}


x86 assembly (clang, -O0):
<ext2fs_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_clear_bit>:
mov    %edi,%ecx
mov    %edi,%edx
shr    $0x3,%rdx
and    $0x7,%cl
mov    $0x1,%edi
shl    %cl,%edi
movzbl (%rsi,%rdx,1),%ecx
mov    %ecx,%eax
and    %edi,%eax
not    %dil
and    %cl,%dil
mov    %dil,(%rsi,%rdx,1)
ret

LLVM IR (-O0):
define i32 @ext2fs_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i32, i32* %3
%10 = lshr i32 %9, 3
%11 = load i8*, i8** %7
%12 = zext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8* %13, i8** %7
%14 = load i32, i32* %3
%15 = and i32 %14, 7
%16 = shl i32 1, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %17, %20
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = xor i32 %22, -1
%24 = load i8*, i8** %7
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = and i32 %26, %23
%28 = trunc i32 %27 to i8
store i8 %28, i8* %24
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @ext2fs_clear_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = trunc i32 %7 to i8
%12 = xor i8 %11, -1
%13 = and i8 %8, %12
store i8 %13, i8* %5
ret i32 %10
}
void RTIISR() {}


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

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

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

LLVM IR (-O2):
define void @RTIISR() {
ret void
}
void *thread_function(void *arg) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
ret i8* undef
}
int RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash,
                 int age) {
  return -1;
}


x86 assembly (clang, -O0):
<RTMP_HashSWF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @RTMP_HashSWF(i8* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
void RTAvloGCPhysDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloGCPhysDestroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_set_defaults();
void config_load(void) {
  { config_set_defaults(); }
}


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

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

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

LLVM IR (-O2):
define void @config_load() {
%1 = tail call i32 (...) @config_set_defaults()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void invalid_opcode_fault(void) {
  panic("exception(fault): invalid opcode / instruction");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"exception(fault): invalid opcode / instruction\00"
define void @invalid_opcode_fault() {
%1 = call i32 @panic(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"exception(fault): invalid opcode / instruction\00"
define void @invalid_opcode_fault() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_3Cint16_reg(short val) {
  return ((val) & (0x3C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Cint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Cint16_reg>:
test   $0x3c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Cint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 60
%6 = icmp ne i32 %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_3Cint16_reg(i16 signext %0) {
%2 = and i16 %0, 60
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ linkname_from_minor(char *, int);
int register_path(char *, char const *);
int register_minor(int minor, const char *path) {
  char linkname[PATH_MAX];
  linkname_from_minor(linkname, minor);
  return register_path(linkname, path);
}


x86 assembly (clang, -O0):
<register_minor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%esi
call   1030 <linkname_from_minor@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <register_path@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_minor>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%esi
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <linkname_from_minor@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <register_path@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i32 @register_minor(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* @PATH_MAX
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %3
%12 = call i32 @linkname_from_minor(i8* %10, i32 %11)
%13 = load i8*, i8** %4
%14 = call i32 @register_path(i8* %10, i8* %13)
%15 = load i8*, i8** %5
ret i32 %14
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define i32 @register_minor(i32 %0, i8* %1) {
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @linkname_from_minor(i8* %5, i32 %0)
%7 = call i32 @register_path(i8* %5, i8* %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ DymosimError(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *, double,
                           double);
double diverr(const char *xexpr, double x, const char *yexpr, double y) {
  char buf[1000];
  sprintf(
      buf,
      "\nModel error - division by zero: (%.400s) / (%.400s) = (%g) / (%g)\n",
      xexpr, yexpr, x, y);
  DymosimError(buf);
  return 1.0;
}


x86 assembly (clang, -O0):
<diverr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <DymosimError@plt>
movsd  0xe8a(%rip),%xmm0
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diverr>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xed3(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <DymosimError@plt>
movsd  0xeb0(%rip),%xmm0
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [68 x i8] c"\0AModel error - division by zero: (%.400s) / (%.400s) = (%g) / (%g)\0A\00"
define double @diverr(i8* %0, double %1, i8* %2, double %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca i8*
%8 = alloca double
%9 = alloca [1000 x i8]
store i8* %0, i8** %5
store double %1, double* %6
store i8* %2, i8** %7
store double %3, double* %8
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = load double, double* %6
%14 = load double, double* %8
%15 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, double %13, double %14)
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%17 = call i32 @DymosimError(i8* %16)
ret double 1.000000e+00
}

LLVM IR (-O2):
@.str = [68 x i8] c"\0AModel error - division by zero: (%.400s) / (%.400s) = (%g) / (%g)\0A\00"
define double @diverr(i8* %0, double %1, i8* %2, double %3) {
%5 = alloca [1000 x i8]
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2, double %1, double %3)
%8 = call i32 @DymosimError(i8* %6)
ret double 1.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *intostr(int i) {
  static char num[16];
  snprintf(num, sizeof(num), "%d", i);
  return num;
}


x86 assembly (clang, -O0):
<intostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x10,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intostr>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@intostr.num = internal global [16 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @intostr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @intostr.num, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @intostr.num, i64 0, i64 0)
}

LLVM IR (-O2):
@intostr.num = internal global [16 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @intostr(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @intostr.num, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @intostr.num, i64 0, i64 0)
}
int intcmp(const void *key, const void *array) {
  int k = *(int *)key;
  int a = *(int *)array;
  if (k > a)
    return 1;
  else if (k < a)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <intcmp+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <intcmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <intcmp+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <intcmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void __svgalib_rendition_outcrtc(int i, int d) {}


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

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

LLVM IR (-O0):
define void @__svgalib_rendition_outcrtc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @__svgalib_rendition_outcrtc(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(int array[], int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", array[i]);
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int foo() {
  int i, res;
  for (i = 0, res = 0; i < 50; i++)
    res += i;
  return res;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1133 <foo+0x33>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <foo+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 1225
}