xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int *int_create(int value) {
  int *var = ((int *)malloc(sizeof(int)));
  *var = value;
  return var;
}


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

x86 assembly (clang, -O2):
<int_create>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @int_create(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 %0, i32* %3
ret i32* %3
}
/* Type definitions */
struct completion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wait_for_completion(struct completion *);
int wait_for_completion_interruptible(struct completion *x) {
  wait_for_completion(x);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.completion = type { i32 }
define i32 @wait_for_completion_interruptible(%struct.completion* %0) {
%2 = alloca %struct.completion*
store %struct.completion* %0, %struct.completion** %2
%3 = load %struct.completion*, %struct.completion** %2
%4 = call i32 @wait_for_completion(%struct.completion* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.completion = type { i32 }
define i32 @wait_for_completion_interruptible(%struct.completion* %0) {
%2 = tail call i32 @wait_for_completion(%struct.completion* %0)
ret i32 0
}
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if ((num % i) == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <check_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <check_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <check_prime+0x50>
jmp    113b <check_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ctap_assert(int, int, char *, int, char *);
int /*<<< orphan*/ ctap_bail(char *);
int /*<<< orphan*/ plan(int);
void ctap_tests(void) {
  plan(1);
  ctap_bail("bailing early");
  ctap_assert(
      !!(1 == 1), 1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/filefrog/ctap/refs/heads/master/t/bail.aux.c",
      25, "1 == 1");
}


x86 assembly (clang, -O0):
<ctap_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <plan@plt>
lea    0xebb(%rip),%rdi
call   1040 <ctap_bail@plt>
mov    $0x1,%esi
lea    0xeb8(%rip),%rdx
mov    $0x19,%ecx
lea    0xf33(%rip),%r8
mov    %esi,%edi
call   1030 <ctap_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctap_tests>:
push   %rax
mov    $0x1,%edi
call   1050 <plan@plt>
lea    0xebe(%rip),%rdi
call   1040 <ctap_bail@plt>
lea    0xec0(%rip),%rdx
lea    0xf40(%rip),%r8
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x19,%ecx
pop    %rax
jmp    1030 <ctap_assert@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"bailing early\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/filefrog/ctap/refs/heads/master/t/bail.aux.c\00"
@.str.2 = [7 x i8] c"1 == 1\00"
define void @ctap_tests() {
%1 = call i32 @plan(i32 1)
%2 = call i32 @ctap_bail(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ctap_assert(i32 1, i32 1, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"bailing early\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/filefrog/ctap/refs/heads/master/t/bail.aux.c\00"
@.str.2 = [7 x i8] c"1 == 1\00"
define void @ctap_tests() {
%1 = tail call i32 @plan(i32 1)
%2 = tail call i32 @ctap_bail(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ctap_assert(i32 1, i32 1, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bin_to_ascii(int);
int /*<<< orphan*/ printf(char *);
int main() {
  bin_to_ascii(121234567);
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x739e487,%edi
call   1040 <bin_to_ascii@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bin_to_ascii(i32 121234567)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOTTY;
int /*<<< orphan*/ errno;
char *ttyname(int fd) {
  errno = ENOTTY;
  return NULL;
}


x86 assembly (clang, -O0):
<ttyname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyname>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOTTY = global i32 0
@errno = global i32 0
define i8* @ttyname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOTTY
store i32 %3, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOTTY = global i32 0
@errno = global i32 0
define noalias i8* @ttyname(i32 %0) {
%2 = load i32, i32* @ENOTTY
store i32 %2, i32* @errno
ret i8* null
}
int Inverse(int a) {
  int x = 1;
  while ((a * x - 1) % 26 != 0) {
    x++;
  }
  return (x);
}


x86 assembly (clang, -O0):
<Inverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
sub    $0x1,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1137 <Inverse+0x37>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Inverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inverse>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
imul   $0xc4ec4ec5,%ecx,%edx
add    $0x9d89d88,%edx
ror    %edx
add    $0x1,%eax
add    %edi,%ecx
cmp    $0x9d89d88,%edx
ja     1110 <Inverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @Inverse(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = mul nsw i32 %3, %0
%5 = add nsw i32 %4, -1
%6 = srem i32 %5, 26
%7 = icmp eq i32 %6, 0
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
int test_imm_09int64_highword_reg(long long val) {
  return ((val >> 32) & (0x09 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_09int64_highword_reg>:
movabs $0x900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09int64_highword_reg(i64 %0) {
%2 = and i64 %0, 38654705664
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned short plusccsb(unsigned short a, unsigned short b) {
  unsigned short sum = a + b;
  if (sum < b)
    abort();
  return sum;
}


x86 assembly (clang, -O0):
<plusccsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    114b <plusccsb+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plusccsb>:
add    %di,%si
jb     1118 <plusccsb+0x8>
mov    %esi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define zeroext i16 @plusccsb(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
%20 = load i16, i16* %5
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @plusccsb(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %1, %0
%4 = icmp ult i16 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i16 %3
}
/* Type definitions */
struct MIDIRunloopSource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct MIDIRunloopSource *);
void MIDIRunloopSourceDestroy(struct MIDIRunloopSource *source) {
  free(source);
}


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

x86 assembly (clang, -O2):
<MIDIRunloopSourceDestroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.MIDIRunloopSource = type { i32 }
define void @MIDIRunloopSourceDestroy(%struct.MIDIRunloopSource* %0) {
%2 = alloca %struct.MIDIRunloopSource*
store %struct.MIDIRunloopSource* %0, %struct.MIDIRunloopSource** %2
%3 = load %struct.MIDIRunloopSource*, %struct.MIDIRunloopSource** %2
%4 = call i32 @free(%struct.MIDIRunloopSource* %3)
ret void
}

LLVM IR (-O2):
%struct.MIDIRunloopSource = type { i32 }
define void @MIDIRunloopSourceDestroy(%struct.MIDIRunloopSource* nocapture %0) {
%2 = tail call i32 @free(%struct.MIDIRunloopSource* %0)
ret void
}
long IS_ERR(void const *ptr) {
  long tmp;
  tmp = (ptr == 0);
  return (tmp);
}


x86 assembly (clang, -O0):
<IS_ERR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_ERR>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i64 @IS_ERR(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @IS_ERR(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
int isdigit(char);
int safe_isdigit(char c) {
  if (c & 0x80)
    return 0;
  return isdigit(c);
}


x86 assembly (clang, -O0):
<safe_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     113c <safe_isdigit+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1148 <safe_isdigit+0x38>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_isdigit>:
test   %dil,%dil
js     111e <safe_isdigit+0xe>
movsbl %dil,%edi
jmp    1030 <isdigit@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @safe_isdigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %12
9: ; preds = %1
%10 = load i8, i8* %3
%11 = call i32 @isdigit(i8 signext %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @safe_isdigit(i8 signext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @isdigit(i8 signext %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
char *strcpy(char *dest, const char *src) {
  char *hptr = dest;
  while ((*dest++ = *src++))
    ;
  return hptr;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void McASPTxBufWrite(unsigned int baseAddr, unsigned int serNum,
                     unsigned int data) {
  (*((volatile unsigned int *)(baseAddr + (0x200 + (serNum * 4))))) = data;
}


x86 assembly (clang, -O0):
<McASPTxBufWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    $0x200,%edx
add    %edx,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPTxBufWrite>:
lea    (%rdi,%rsi,4),%eax
add    $0x200,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @McASPTxBufWrite(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul i32 %9, 4
%11 = add i32 512, %10
%12 = add i32 %8, %11
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @McASPTxBufWrite(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 2
%5 = add i32 %0, 512
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
int networking_initialized(int doinit, int uninit) {
  static unsigned char flag = 0;
  if (uninit) {
    if (!flag) {
      return 1;
    }
    flag = 0;
    return 0;
  } else {
    if (flag) {
      return 1;
    }
    if (doinit) {
      flag = ~0;
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<networking_initialized>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1140 <networking_initialized+0x40>
cmpb   $0x0,0x2f06(%rip)
jne    112d <networking_initialized+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1171 <networking_initialized+0x71>
movb   $0x0,0x2eed(%rip)
movl   $0x0,-0x4(%rbp)
jmp    1171 <networking_initialized+0x71>
cmpb   $0x0,0x2eda(%rip)
je     1159 <networking_initialized+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1171 <networking_initialized+0x71>
cmpl   $0x0,-0x8(%rbp)
je     116a <networking_initialized+0x6a>
movb   $0xff,0x2eb7(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<networking_initialized>:
mov    0x2f1b(%rip),%cl
mov    $0x1,%eax
test   %esi,%esi
je     1115 <networking_initialized+0x15>
test   $0x1,%cl
jne    111e <networking_initialized+0x1e>
ret
test   $0x1,%cl
jne    1114 <networking_initialized+0x14>
test   %edi,%edi
je     1127 <networking_initialized+0x27>
test   %esi,%esi
sete   0x2efa(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@networking_initialized.flag = internal global i8 0
define i32 @networking_initialized(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8, i8* @networking_initialized.flag
%10 = icmp ne i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8
store i32 1, i32* %3
br label %22
12: ; preds = %8
store i8 0, i8* @networking_initialized.flag
store i32 0, i32* %3
br label %22
13: ; preds = %2
%14 = load i8, i8* @networking_initialized.flag
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %3
br label %22
17: ; preds = %13
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i8 -1, i8* @networking_initialized.flag
br label %21
21: ; preds = %20, %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %16, %12, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@networking_initialized.flag = internal unnamed_addr global i1 false
define i32 @networking_initialized(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i1, i1* @networking_initialized.flag
br i1 %3, label %6, label %5
5: ; preds = %2
br i1 %4, label %9, label %10
6: ; preds = %2
br i1 %4, label %10, label %7
7: ; preds = %6
%8 = icmp eq i32 %0, 0
br i1 %8, label %10, label %9
9: ; preds = %7, %5
store i1 %3, i1* @networking_initialized.flag
br label %10
10: ; preds = %9, %7, %6, %5
%11 = phi i32 [ 1, %5 ], [ 1, %6 ], [ 0, %7 ], [ 0, %9 ]
ret i32 %11
}
int anc_hs_dev_register(struct anc_hs_dev *dev, void *codec_data) { return 0; }


x86 assembly (clang, -O0):
<anc_hs_dev_register>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.anc_hs_dev = type opaque
define i32 @anc_hs_dev_register(%struct.anc_hs_dev* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *BN_bin2bn(unsigned char *, int, int /*<<< orphan*/ *);
int BN_num_bytes(int /*<<< orphan*/ *);
int /*<<< orphan*/ assert(unsigned char *);
BIGNUM *_make_bn_from_string(unsigned char *str) {
  assert(str);
  BIGNUM *tmp;
  tmp = BN_bin2bn(str, 8, NULL);
  int n = BN_num_bytes(tmp);
  if (n)
    return tmp;
  return NULL;
}


x86 assembly (clang, -O0):
<_make_bn_from_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <BN_bin2bn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <BN_num_bytes@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     117e <_make_bn_from_string+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <_make_bn_from_string+0x56>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_make_bn_from_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <assert@plt>
xor    %r14d,%r14d
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1030 <BN_bin2bn@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <BN_num_bytes@plt>
test   %eax,%eax
cmove  %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @_make_bn_from_string(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32* @BN_bin2bn(i8* %0, i32 8, i32* null)
%4 = tail call i32 @BN_num_bytes(i32* %3)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32* null, i32* %3
ret i32* %6
}
/* Variables and functions */
int glutBitmapStringWidth(void *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, double);
int glutBitmapDoubleWidth(void *fontface, double i) {
  char buf[64];
  snprintf(buf, 64, "%.2g", i);
  return glutBitmapStringWidth(fontface, buf);
}


x86 assembly (clang, -O0):
<glutBitmapDoubleWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    $0x40,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <glutBitmapStringWidth@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutBitmapDoubleWidth>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <glutBitmapStringWidth@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2g\00"
define i32 @glutBitmapDoubleWidth(i8* %0, double %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %1)
%6 = call i32 @glutBitmapStringWidth(i8* %0, i8* %4)
ret i32 %6
}
/* Type definitions */
struct t_infolist {
  int dummy;
};

/* Variables and functions */
scalar_t__ infolist_next(struct t_infolist *);
int /*<<< orphan*/ infolist_valid(struct t_infolist *);
int plugin_api_infolist_next(struct t_infolist *infolist) {
  if (!infolist || !infolist_valid(infolist))
    return 0;
  return (infolist_next(infolist)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<plugin_api_infolist_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <plugin_api_infolist_next+0x29>
mov    -0x10(%rbp),%rdi
call   1040 <infolist_valid@plt>
cmp    $0x0,%eax
jne    1155 <plugin_api_infolist_next+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1172 <plugin_api_infolist_next+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <infolist_next@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_infolist_next>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1147 <plugin_api_infolist_next+0x27>
mov    %rdi,%rbx
call   1040 <infolist_valid@plt>
test   %eax,%eax
je     1147 <plugin_api_infolist_next+0x27>
mov    %rbx,%rdi
call   1030 <infolist_next@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.t_infolist = type { i32 }
define i32 @plugin_api_infolist_next(%struct.t_infolist* %0) {
%2 = alloca i32
%3 = alloca %struct.t_infolist*
store %struct.t_infolist* %0, %struct.t_infolist** %3
%4 = load %struct.t_infolist*, %struct.t_infolist** %3
%5 = icmp ne %struct.t_infolist* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.t_infolist*, %struct.t_infolist** %3
%8 = call i32 @infolist_valid(%struct.t_infolist* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6, %1
store i32 0, i32* %2
br label %17
11: ; preds = %6
%12 = load %struct.t_infolist*, %struct.t_infolist** %3
%13 = call i64 @infolist_next(%struct.t_infolist* %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.t_infolist = type { i32 }
define i32 @plugin_api_infolist_next(%struct.t_infolist* %0) {
%2 = icmp eq %struct.t_infolist* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @infolist_valid(%struct.t_infolist* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @infolist_next(%struct.t_infolist* %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %1, %3, %6
%11 = phi i32 [ %9, %6 ], [ 0, %3 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *malloccopy(char *string) {
  char *result;
  result = malloc(strlen(string) + 1);
  if (result != NULL)
    strcpy(result, string);
  return result;
}


x86 assembly (clang, -O0):
<malloccopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <malloccopy+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloccopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <malloccopy+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @malloccopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @malloccopy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
struct C {
  int i, j;
  double d;
} h() {
  return (struct C){1, 2, 3};
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
movabs $0x4008000000000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movabs $0x200000001,%rax
movsd  0xeee(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.C = type { i32, i32, double }
define { i64, double } @h() {
%1 = alloca %struct.C
%2 = getelementptr inbounds %struct.C, %struct.C* %1, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.C, %struct.C* %1, i32 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.C, %struct.C* %1, i32 0, i32 2
store double 3.000000e+00, double* %4
%5 = bitcast %struct.C* %1 to { i64, double }*
%6 = load { i64, double }, { i64, double }* %5
ret { i64, double } %6
}

LLVM IR (-O2):
define { i64, double } @h() {
ret { i64, double } { i64 8589934593, double 3.000000e+00 }
}
profil(b, s, o, i) char *b;
{ ; }


x86 assembly (clang, -O0):
<profil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @profil(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
/* Variables and functions */
char *mstrncpy(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *mstrcpy(const char *src) {
  return (src ? mstrncpy(src, strlen(src)) : NULL);
}


x86 assembly (clang, -O0):
<mstrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <mstrcpy+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <mstrncpy@plt>
mov    %rax,-0x10(%rbp)
jmp    1167 <mstrcpy+0x47>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1167 <mstrcpy+0x47>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrcpy>:
test   %rdi,%rdi
je     1139 <mstrcpy+0x19>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <mstrncpy@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @mstrcpy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @mstrncpy(i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ handle_IO(int /*<<< orphan*/);
int gen_IO(void) {
  handle_IO(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_IO() {
%1 = call i32 @handle_IO(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_IO() {
%1 = tail call i32 @handle_IO(i32 0)
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF)
    putchar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int MarsagliaXOR(int *);
int rand_range(int n, unsigned short *seed) {
  int v = MarsagliaXOR((int *)seed) % n;
  return v;
}


x86 assembly (clang, -O0):
<rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <MarsagliaXOR@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <MarsagliaXOR@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_range(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i16*
%5 = alloca i32
store i32 %0, i32* %3
store i16* %1, i16** %4
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i32*
%8 = call i32 @MarsagliaXOR(i32* %7)
%9 = load i32, i32* %3
%10 = srem i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @rand_range(i32 %0, i16* %1) {
%3 = bitcast i16* %1 to i32*
%4 = tail call i32 @MarsagliaXOR(i32* %3)
%5 = srem i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ scalbn(double, int);
int /*<<< orphan*/ scalbnf(float, int);
int /*<<< orphan*/ scalbnl(long double, int);
void uninitvar_scalbn(void) {
  float f;
  int i1;
  (void)scalbnf(f, i1);
  double d;
  int i2;
  (void)scalbn(d, i2);
  long double ld;
  int i3;
  (void)scalbnl(ld, i3);
}


x86 assembly (clang, -O0):
<uninitvar_scalbn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <scalbnf@plt>
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1040 <scalbn@plt>
fldt   -0x30(%rbp)
mov    -0x34(%rbp),%edi
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <scalbnl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_scalbn>:
sub    $0x18,%rsp
call   1030 <scalbnf@plt>
call   1040 <scalbn@plt>
call   1050 <scalbnl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_scalbn() {
%1 = alloca float
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
%5 = alloca x86_fp80
%6 = alloca i32
%7 = load float, float* %1
%8 = load i32, i32* %2
%9 = call i32 @scalbnf(float %7, i32 %8)
%10 = load double, double* %3
%11 = load i32, i32* %4
%12 = call i32 @scalbn(double %10, i32 %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load i32, i32* %6
%15 = call i32 @scalbnl(x86_fp80 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_scalbn() {
%1 = tail call i32 @scalbnf(float undef, i32 undef)
%2 = tail call i32 @scalbn(double undef, i32 undef)
%3 = tail call i32 @scalbnl(x86_fp80 undef, i32 undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int tl1parsestream(int /*<<< orphan*/ *);
int tl1parsefile(const char *filename) {
  FILE *fs;
  int status;
  fs = fopen(filename, "r");
  if (fs == 0) {
    return -1;
  }
  status = tl1parsestream(fs);
  fclose(fs);
  return status;
}


x86 assembly (clang, -O0):
<tl1parsefile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <tl1parsefile+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <tl1parsefile+0x52>
mov    -0x18(%rbp),%rdi
call   1040 <tl1parsestream@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl1parsefile>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115d <tl1parsefile+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <tl1parsestream@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
jmp    1162 <tl1parsefile+0x32>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @tl1parsefile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i32 @tl1parsestream(i32* %12)
store i32 %13, i32* %5
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @tl1parsefile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @tl1parsestream(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
int zig_addw_int(int lhs, int rhs, int min, int max) {
  return (int)(((unsigned)lhs) + ((unsigned)rhs));
}


x86 assembly (clang, -O0):
<zig_addw_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @zig_addw_int(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %1, %0
ret i32 %5
}
void handle_trap(unsigned int mcause, unsigned int mepc, unsigned int sp) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<handle_trap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    110d <handle_trap+0xd>

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

LLVM IR (-O0):
define void @handle_trap(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %3, %7
br label %7
}

LLVM IR (-O2):
define void @handle_trap(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %4
br label %4
}
/* Variables and functions */
int hash(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int result;
  char array[200];
  scanf("%s", array);
  result = hash(array);
  printf("%d", result);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GyroSensorHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GyroSensorUpdated() { UAVObjUpdated(GyroSensorHandle()); }


x86 assembly (clang, -O0):
<GyroSensorUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GyroSensorHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyroSensorUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <GyroSensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @GyroSensorUpdated() {
%1 = call i32 (...) @GyroSensorHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GyroSensorUpdated() {
%1 = tail call i32 (...) @GyroSensorHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
char hexDigit(int h) {
  h = h & 0xf;
  return ((h >= 10) ? ('a' - 10) : '0') + h;
}


x86 assembly (clang, -O0):
<hexDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x30,%eax
mov    $0x57,%ecx
cmp    $0xa,%edx
cmovge %ecx,%eax
add    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexDigit>:
and    $0xf,%edi
lea    0x30(%rdi),%ecx
lea    0x57(%rdi),%eax
cmp    $0xa,%edi
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @hexDigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 10
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 87, i32 48
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @hexDigit(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ugt i32 %2, 9
%4 = select i1 %3, i32 87, i32 48
%5 = add nuw nsw i32 %4, %2
%6 = trunc i32 %5 to i8
ret i8 %6
}