xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, unsigned long const);
int /*<<< orphan*/ die(char *);
void *xcalloc(const unsigned long size) {
  void *ret = calloc(1, size);
  if (!ret)
    die("xcalloc");
  return ret;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xcalloc+0x35>
lea    0xeb0(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <xcalloc+0x22>
lea    0xec3(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"xcalloc\00"
define i8* @xcalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printint(int num) { printf("%d", num); }


x86 assembly (clang, -O0):
<printint>:
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):
<printint>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *private_get_extension(const char *filename) {
  const char *dot_pos = strrchr(filename, '.');
  return dot_pos == NULL ? "" : dot_pos + 1;
}


x86 assembly (clang, -O0):
<private_get_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <private_get_extension+0x39>
lea    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1155 <private_get_extension+0x45>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<private_get_extension>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xed7(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @private_get_extension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
br label %12
12: ; preds = %9, %8
%13 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %8 ], [ %11, %9 ]
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @private_get_extension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
void example01(char *led) {
  int i = 0;
  while (1) {
    if (i == 5000000) {
      i = 0;
      led[0] = ~led[0];
    } else {
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<example01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4c4b40,-0xc(%rbp)
jne    113a <example01+0x3a>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1143 <example01+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <example01+0xf>

x86 assembly (clang, -O2):
<example01>:
jmp    1112 <example01+0x12>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
notb   (%rdi)
xor    %eax,%eax
cmp    $0x4c4b40,%eax
je     1110 <example01+0x10>
add    $0x1,%eax
cmp    $0x4c4b40,%eax
jne    111b <example01+0x1b>
jmp    1110 <example01+0x10>

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

LLVM IR (-O2):
define void @example01(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i32 [ 0, %1 ], [ %11, %10 ]
%4 = icmp eq i32 %3, 5000000
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8, i8* %0
%7 = xor i8 %6, -1
store i8 %7, i8* %0
br label %10
8: ; preds = %2
%9 = add nsw i32 %3, 1
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ 0, %5 ], [ %9, %8 ]
br label %2
}
void do_k_times(int n) {
  int k = n;
  for (int i = 0; i < k; i++) {
  }
}


x86 assembly (clang, -O0):
<do_k_times>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1133 <do_k_times+0x33>
jmp    1125 <do_k_times+0x25>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <do_k_times+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_k_times(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ grptb_start();
scalar_t__ usrtb_start();
int ustar_strd(void) {
  if ((usrtb_start() < 0) || (grptb_start() < 0))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<ustar_strd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <usrtb_start@plt>
cmp    $0x0,%rax
jl     114a <ustar_strd+0x2a>
mov    $0x0,%al
call   1030 <grptb_start@plt>
cmp    $0x0,%rax
jge    1156 <ustar_strd+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <ustar_strd+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustar_strd>:
push   %rax
xor    %eax,%eax
call   1040 <usrtb_start@plt>
test   %rax,%rax
js     113a <ustar_strd+0x1a>
xor    %eax,%eax
call   1030 <grptb_start@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ustar_strd() {
%1 = alloca i32
%2 = call i64 (...) @usrtb_start()
%3 = icmp slt i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @grptb_start()
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %0
store i32 -1, i32* %1
br label %9
8: ; preds = %4
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @ustar_strd() {
%1 = tail call i64 (...) @usrtb_start()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @grptb_start()
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
int function_A(int n) { return (~0) << n; }


x86 assembly (clang, -O0):
<function_A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_A>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @function_A(i32 %0) {
%2 = shl nsw i32 -1, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
void reg8_clear_bits(volatile uint8_t *reg, uint8_t value) { *reg &= ~(value); }


x86 assembly (clang, -O0):
<reg8_clear_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg8_clear_bits>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @reg8_clear_bits(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = xor i32 %5, -1
%7 = load i32*, i32** %3
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %6
store volatile i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @reg8_clear_bits(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = xor i32 %4, -1
%6 = load volatile i32, i32* %0
%7 = and i32 %6, %5
store volatile i32 %7, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimeSoma(int valor1, int valor2) {
  printf("\n\nSoma: %d", valor1 + valor2);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"\0A\0ASoma: %d\00"
define void @imprimeSoma(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 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @elksser() {
ret void
}
int lower(int c) {
  if (c >= 'A' && c <= 'Z')
    return c + 'a' - 'A';
  else
    return c;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <lower+0x2c>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <lower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 97
%12 = sub nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void b_debug(int idx, int *cells) {
  printf("Index Pointer: %d Value at Index Pointer: %d\n", idx, cells[idx]);
}


x86 assembly (clang, -O0):
<b_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_debug>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%edx
lea    0xee3(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Index Pointer: %d Value at Index Pointer: %d\0A\00"
define void @b_debug(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 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Index Pointer: %d Value at Index Pointer: %d\0A\00"
define void @b_debug(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ create_thread(int);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  pthread_t tid;
  create_thread(0);
  sleep(1);
  tid = create_thread(1);
  pthread_join(tid, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <create_thread@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1040 <create_thread@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_join@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <create_thread@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1040 <create_thread@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <pthread_join@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @create_thread(i32 0)
%8 = call i32 @sleep(i32 1)
%9 = call i32 @create_thread(i32 1)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @pthread_join(i32 %10, i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @create_thread(i32 0)
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @create_thread(i32 1)
%6 = tail call i32 @pthread_join(i32 %5, i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ checkMalloc(char *const);
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *const, char *, int);
char *getNumberOfCharactersMenu(void) {
  char *const menu = (char *)malloc(133 * sizeof(char));
  checkMalloc(menu);
  strncpy(menu,
          "\n1. Numeric\n2. Lower/Upper Case\n"
          "3. Numeric + Lower/Upper Case\n"
          "4. Numeric + Lower/Upper Case + Symbols\n"
          "0. Back\n\n",
          133);
  return menu;
}


x86 assembly (clang, -O0):
<getNumberOfCharactersMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x85,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <checkMalloc@plt>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x85,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumberOfCharactersMenu>:
push   %rbx
mov    $0x85,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <checkMalloc@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x85,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [112 x i8] c"\0A1. Numeric\0A2. Lower/Upper Case\0A3. Numeric + Lower/Upper Case\0A4. Numeric + Lower/Upper Case + Symbols\0A0. Back\0A\0A\00"
define i8* @getNumberOfCharactersMenu() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 133)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @checkMalloc(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @strncpy(i8* %6, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i32 133)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [112 x i8] c"\0A1. Numeric\0A2. Lower/Upper Case\0A3. Numeric + Lower/Upper Case\0A4. Numeric + Lower/Upper Case + Symbols\0A0. Back\0A\0A\00"
define i8* @getNumberOfCharactersMenu() {
%1 = tail call i64 @malloc(i32 133)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @checkMalloc(i8* %2)
%4 = tail call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i32 133)
ret i8* %2
}
int test_imm_F2int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F2int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1039382085632
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gpio_input(int);
int /*<<< orphan*/ mswait(int);
void pwm_reset_all_pins() {
  gpio_input(18);
  mswait(1);
  gpio_input(13);
  mswait(1);
  gpio_input(12);
  mswait(1);
  gpio_input(19);
}


x86 assembly (clang, -O0):
<pwm_reset_all_pins>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
call   1030 <gpio_input@plt>
mov    $0x1,%edi
call   1040 <mswait@plt>
mov    $0xd,%edi
call   1030 <gpio_input@plt>
mov    $0x1,%edi
call   1040 <mswait@plt>
mov    $0xc,%edi
call   1030 <gpio_input@plt>
mov    $0x1,%edi
call   1040 <mswait@plt>
mov    $0x13,%edi
call   1030 <gpio_input@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_reset_all_pins>:
push   %rax
mov    $0x12,%edi
call   1030 <gpio_input@plt>
mov    $0x1,%edi
call   1040 <mswait@plt>
mov    $0xd,%edi
call   1030 <gpio_input@plt>
mov    $0x1,%edi
call   1040 <mswait@plt>
mov    $0xc,%edi
call   1030 <gpio_input@plt>
mov    $0x1,%edi
call   1040 <mswait@plt>
mov    $0x13,%edi
pop    %rax
jmp    1030 <gpio_input@plt>

LLVM IR (-O0):
define void @pwm_reset_all_pins() {
%1 = call i32 @gpio_input(i32 18)
%2 = call i32 @mswait(i32 1)
%3 = call i32 @gpio_input(i32 13)
%4 = call i32 @mswait(i32 1)
%5 = call i32 @gpio_input(i32 12)
%6 = call i32 @mswait(i32 1)
%7 = call i32 @gpio_input(i32 19)
ret void
}

LLVM IR (-O2):
define void @pwm_reset_all_pins() {
%1 = tail call i32 @gpio_input(i32 18)
%2 = tail call i32 @mswait(i32 1)
%3 = tail call i32 @gpio_input(i32 13)
%4 = tail call i32 @mswait(i32 1)
%5 = tail call i32 @gpio_input(i32 12)
%6 = tail call i32 @mswait(i32 1)
%7 = tail call i32 @gpio_input(i32 19)
ret void
}
int dma_buf_init_sysfs_statistics(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dma_buf_init_sysfs_statistics() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cyield();
int rand();
void sleepao(void) {
  int i = 0;
  i = rand() % 5 + 1;
  for (; i < 0; i--)
    cyield();
  return;
}


x86 assembly (clang, -O0):
<sleepao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1163 <sleepao+0x43>
mov    $0x0,%al
call   1030 <cyield@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <sleepao+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepao>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cmp    $0xfffffffe,%eax
jg     1159 <sleepao+0x39>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <cyield@plt>
jmp    1150 <sleepao+0x30>
pop    %rax
ret

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

LLVM IR (-O2):
define void @sleepao() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = icmp slt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0, %4
%5 = tail call i32 (...) @cyield()
br label %4
6: ; preds = %0
ret void
}
/* Variables and functions */
scalar_t__ __builtin_j0f(float);
int /*<<< orphan*/ link_failure_builtin_j0f();
void test_builtin_j0f(float f) {
  if (__builtin_j0f(f) != __builtin_j0f(f))
    link_failure_builtin_j0f();
}


x86 assembly (clang, -O0):
<test_builtin_j0f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_j0f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_j0f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_j0f+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_j0f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_j0f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <__builtin_j0f@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <__builtin_j0f@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_j0f+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_j0f@plt>

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

LLVM IR (-O2):
define void @test_builtin_j0f(float %0) {
%2 = tail call i64 @__builtin_j0f(float %0)
%3 = tail call i64 @__builtin_j0f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_j0f()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pointer(int *p1) {
  int m = 5, *p = &m;
  p1 = p;
  printf("p1=%d\n", *p1);
}


x86 assembly (clang, -O0):
<pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"p1=%d\0A\00"
define void @pointer(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *pseudotalloc_malloc(size_t);
void *_talloc_zero(const void *ctx, size_t size, const char *name) {
  void *p = pseudotalloc_malloc(size);
  if (!p)
    return NULL;
  memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<_talloc_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pseudotalloc_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1159 <_talloc_zero+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1170 <_talloc_zero+0x50>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_talloc_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsi,%rdi
call   1040 <pseudotalloc_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1144 <_talloc_zero+0x24>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_talloc_zero(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
%9 = load i64, i64* %6
%10 = call i8* @pseudotalloc_malloc(i64 %9)
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %3
store i8* null, i8** %4
br label %19
14: ; preds = %3
%15 = load i8*, i8** %8
%16 = load i64, i64* %6
%17 = call i32 @memset(i8* %15, i32 0, i64 %16)
%18 = load i8*, i8** %8
store i8* %18, i8** %4
br label %19
19: ; preds = %14, %13
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @_talloc_zero(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @pseudotalloc_malloc(i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %1)
br label %8
8: ; preds = %3, %6
ret i8* %4
}
int find_first_set_lsb(unsigned int value) {
  int i;
  for (i = 0; i < 32; i++) {
    if ((value & (1 << i)) != 0) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<find_first_set_lsb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1150 <find_first_set_lsb+0x50>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113d <find_first_set_lsb+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <find_first_set_lsb+0x57>
jmp    1142 <find_first_set_lsb+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <find_first_set_lsb+0xe>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first_set_lsb>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %eax,%edi
jb     114b <find_first_set_lsb+0x4b>
lea    0x1(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     1144 <find_first_set_lsb+0x44>
lea    0x2(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     1148 <find_first_set_lsb+0x48>
lea    0x3(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%edi
jb     114c <find_first_set_lsb+0x4c>
add    $0x4,%eax
cmp    $0x20,%eax
jne    1110 <find_first_set_lsb+0x10>
mov    $0xffffffff,%eax
ret
add    $0x1,%eax
ret
add    $0x2,%eax
ret
add    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @find_first_set_lsb(i32 %0) {
br label %2
2: ; preds = %22, %1
%3 = phi i32 [ 0, %1 ], [ %23, %22 ]
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %2
%8 = or i32 %3, 1
%9 = shl nuw i32 1, %8
%10 = and i32 %9, %0
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %7
%13 = or i32 %3, 2
%14 = shl nuw i32 1, %13
%15 = and i32 %14, %0
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %12
%18 = or i32 %3, 3
%19 = shl nuw i32 1, %18
%20 = and i32 %19, %0
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = add nuw nsw i32 %3, 4
%24 = icmp eq i32 %23, 32
br i1 %24, label %25, label %2
25: ; preds = %22, %17, %12, %7, %2
%26 = phi i32 [ %3, %2 ], [ %8, %7 ], [ %13, %12 ], [ %18, %17 ], [ -1, %22 ]
ret i32 %26
}
void fa194(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
p0D:
  goto p0D;
  goto a;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa194>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa194+0x4>

x86 assembly (clang, -O2):
<fa194>:
jmp    1100 <fa194>

LLVM IR (-O0):
define void @fa194() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; No predecessors!
br label %26
26: ; preds = %26, %25
br label %26
27: ; preds = %27
br label %27
}

LLVM IR (-O2):
define void @fa194() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int *malloc(int);
int *createArray(int n) {
  int *a = malloc(n * sizeof(int));
  return a;
}


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

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

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

LLVM IR (-O2):
define noalias i32* @createArray(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ printw(char *, ...);
int /*<<< orphan*/ refresh();
void bail_out(char *message) {
  move(22, 0);
  printw("*** %s", message);
  move(23, 0);
  printw("*** [Press any key to quit]");
  refresh();
  getch();
  endwin();
}


x86 assembly (clang, -O0):
<bail_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x16,%edi
xor    %esi,%esi
call   1070 <move@plt>
mov    -0x8(%rbp),%rsi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printw@plt>
mov    $0x17,%edi
xor    %esi,%esi
call   1070 <move@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bail_out>:
push   %rbx
mov    %rdi,%rbx
mov    $0x16,%edi
xor    %esi,%esi
call   1070 <move@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printw@plt>
mov    $0x17,%edi
xor    %esi,%esi
call   1070 <move@plt>
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1030 <printw@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"*** %s\00"
@.str.1 = [28 x i8] c"*** [Press any key to quit]\00"
define void @bail_out(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @move(i32 22, i32 0)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @move(i32 23, i32 0)
%7 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @getch()
%10 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"*** %s\00"
@.str.1 = [28 x i8] c"*** [Press any key to quit]\00"
define void @bail_out(i8* %0) {
%2 = tail call i32 @move(i32 22, i32 0)
%3 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @move(i32 23, i32 0)
%5 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @refresh()
%7 = tail call i32 (...) @getch()
%8 = tail call i32 (...) @endwin()
ret void
}
void HardFaultException(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<HardFaultException>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HardFaultException+0x9>
jmp    1109 <HardFaultException+0x9>

x86 assembly (clang, -O2):
<HardFaultException>:
jmp    1100 <HardFaultException>

LLVM IR (-O0):
define void @HardFaultException() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @HardFaultException() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int run_migration(char const *, int);
int migration_upgrade(const char *path) { return run_migration(path, 1); }


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

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

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

LLVM IR (-O2):
define i32 @migration_upgrade(i8* %0) {
%2 = tail call i32 @run_migration(i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ libglitch_init(int, unsigned long long);
void glitch_init(int sample_rate, unsigned long long seed) {
  libglitch_init(sample_rate, seed);
}


x86 assembly (clang, -O0):
<glitch_init>:
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 <libglitch_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glitch_init>:
jmp    1030 <libglitch_init@plt>

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

LLVM IR (-O2):
define void @glitch_init(i32 %0, i64 %1) {
%3 = tail call i32 @libglitch_init(i32 %0, i64 %1)
ret void
}
int checkreg(struct REGINFO *reginfo, char err[100]) {
  err[0] = 0;
  return 1;
}


x86 assembly (clang, -O0):
<checkreg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkreg>:
movb   $0x0,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.REGINFO = type opaque
define i32 @checkreg(%struct.REGINFO* %0, i8* %1) {
%3 = alloca %struct.REGINFO*
%4 = alloca i8*
store %struct.REGINFO* %0, %struct.REGINFO** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
ret i32 1
}

LLVM IR (-O2):
%struct.REGINFO = type opaque
define i32 @checkreg(%struct.REGINFO* nocapture readnone %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
ret i32 1
}
__attribute__((always_)) int pci_ats_queue_depth(struct pci_dev *dev) {
  return -19;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_ats_queue_depth(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret i32 -19
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_ats_queue_depth(%struct.pci_dev* nocapture readnone %0) {
ret i32 -19
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz8_set_int(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                int, int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/, int);
void mpz8_set_add(mpz_t z[8]) { mpz8_set_int(z, 0, 1, 1, 0, 0, 0, 0, 1); }


x86 assembly (clang, -O0):
<mpz8_set_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %r9d,%r9d
mov    $0x1,%ecx
mov    %r9d,%esi
mov    %ecx,%edx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x10(%rsp)
call   1030 <mpz8_set_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz8_set_add>:
push   %rax
sub    $0x8,%rsp
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x1
push   $0x0
push   $0x0
call   1030 <mpz8_set_int@plt>
add    $0x20,%rsp
pop    %rax
ret

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

LLVM IR (-O2):
define void @mpz8_set_add(i32* %0) {
%2 = tail call i32 @mpz8_set_int(i32* %0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 1)
ret void
}
lookup(s, t) char *s;
char **t;
{
  register int i;
  i = 0;
  while (*t) {
    if (scomp(s, *t) == 0)
      return (i);
    i++;
    t++;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1175 <lookup+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    $0x0,%al
call   1030 <scomp@plt>
cmp    $0x0,%eax
jne    115b <lookup+0x4b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <lookup+0x6c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <lookup+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
mov    $0xffffffff,%r14d
test   %rsi,%rsi
je     1151 <lookup+0x41>
mov    %rdi,%r15
xor    %ebp,%ebp
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <scomp@plt>
test   %eax,%eax
je     114e <lookup+0x3e>
mov    0x8(%rbx,%rbp,8),%rsi
add    $0x1,%rbp
test   %rsi,%rsi
jne    1130 <lookup+0x20>
jmp    1151 <lookup+0x41>
mov    %ebp,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @lookup(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8* [ %14, %11 ], [ %3, %2 ]
%7 = phi i32 [ %12, %11 ], [ 0, %2 ]
%8 = phi i8** [ %13, %11 ], [ %1, %2 ]
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @scomp to i32 (i8*, i8*, ...)*)(i8* %0, i8* %6)
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %5
%12 = add nuw nsw i32 %7, 1
%13 = getelementptr inbounds i8*, i8** %8, i64 1
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i32 [ -1, %2 ], [ -1, %11 ], [ %7, %5 ]
ret i32 %17
}
/* Variables and functions */
int nothing();
int /*<<< orphan*/ printf(char *);
int main() {
  int y;
  y = nothing();
  printf("hello\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (...) @nothing()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float sinf(float x) {}


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

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

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

LLVM IR (-O2):
define float @sinf(float %0) {
ret float undef
}
char *utl_strcatc(char *dst, char c) {
  int it;
  it = 0;
  while (dst[it])
    it++;
  dst[it++] = c;
  dst[it] = '\0';
  return (dst);
}


x86 assembly (clang, -O0):
<utl_strcatc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1135 <utl_strcatc+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <utl_strcatc+0x15>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_strcatc>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rax,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <utl_strcatc+0x10>
lea    -0x1(%rcx),%edx
mov    %sil,(%rax,%rdx,1)
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @utl_strcatc(i8* returned %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = add i64 %4, 1
store i8 %1, i8* %11
%13 = and i64 %12, 4294967295
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
ret i8* %0
}