xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printClientFlags() {
  printf("vlmcs flags:%s\n", ""
                             " DNS_PARSER=OS");
}


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

x86 assembly (clang, -O2):
<printClientFlags>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"vlmcs flags:%s\0A\00"
@.str.1 = [15 x i8] c" DNS_PARSER=OS\00"
define void @printClientFlags() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"vlmcs flags:%s\0A\00"
@.str.1 = [15 x i8] c" DNS_PARSER=OS\00"
define void @printClientFlags() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int lowerNibble(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint8_t a = 0b10110101;
  printf("%d\n", lowerNibble(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb5,%edi
call   1040 <lowerNibble@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @lowerNibble(i32 181)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
adr0adr1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{
  (*((float *)10000000)) = (*((float *)(11111111 & ~(__alignof__(float) - 1))));
}


x86 assembly (clang, -O0):
<adr0adr1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac4,%eax
movss  (%rax),%xmm0
mov    $0x989680,%eax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1_set>:
movss  0xa98ac4,%xmm0
movss  %xmm0,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adr1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111108 to float*)
store float %16, float* inttoptr (i64 10000000 to float*)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @adr0adr1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = load float, float* inttoptr (i64 11111108 to float*)
store float %7, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
int uds_ecu_reset(int resetType) { return resetType; }


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

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

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

LLVM IR (-O2):
define i32 @uds_ecu_reset(i32 returned %0) {
ret i32 %0
}
int LZ4_sizeofState(void) { return ((1UL << 14) + 32); }


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofState() {
ret i32 16416
}

LLVM IR (-O2):
define i32 @LZ4_sizeofState() {
ret i32 16416
}
int mdrv_sd_sg_init_table(const void *buf, unsigned int buflen) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mdrv_sd_sg_init_table(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _printf_putls(unsigned int, int, int /*<<< orphan*/);
void putudec(unsigned x) { _printf_putls(x, 10, 0); }


x86 assembly (clang, -O0):
<putudec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <_printf_putls@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putudec>:
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <_printf_putls@plt>

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

LLVM IR (-O2):
define void @putudec(i32 %0) {
%2 = tail call i32 @_printf_putls(i32 %0, i32 10, i32 0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void mmu_section(unsigned int vadd, unsigned int padd, unsigned int flags) {
  uint32_t ra;
  uint32_t *rb;
  uint32_t rc;
  ra = vadd >> 20;
  rb = (uint32_t *)(0x00004000 | (ra << 2));
  rc = (padd & 0xFFF00000) | 0xC00 | flags | 2;
  *rb = rc;
}


x86 assembly (clang, -O0):
<mmu_section>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x14,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
or     $0x4000,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfff00000,%eax
or     $0xc00,%eax
or     -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmu_section>:
shr    $0x12,%edi
and    $0xfffffffc,%edi
and    $0xfff00000,%esi
or     %edx,%esi
or     $0xc02,%esi
mov    %esi,0x4000(%rdi)
ret

LLVM IR (-O0):
define void @mmu_section(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = lshr i32 %10, 20
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = shl i32 %12, 2
%14 = or i32 16384, %13
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %8
%17 = load i32, i32* %5
%18 = and i32 %17, -1048576
%19 = or i32 %18, 3072
%20 = load i32, i32* %6
%21 = or i32 %19, %20
%22 = or i32 %21, 2
store i32 %22, i32* %9
%23 = load i32, i32* %9
%24 = load i32*, i32** %8
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @mmu_section(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, 18
%5 = and i32 %4, 16380
%6 = or i32 %5, 16384
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = and i32 %1, -1048576
%10 = or i32 %9, %2
%11 = or i32 %10, 3074
store i32 %11, i32* %8
ret void
}
/* Variables and functions */
char *malloc(int);
char *my_strcp(char *str) {
  char *copy;
  int i;
  if ((copy = malloc(sizeof(char) * (i + 1))) == NULL)
    return (NULL);
  copy[i] = '\0';
  while (i--) {
    copy[i] = str[i];
  }
  return (copy);
}


x86 assembly (clang, -O0):
<my_strcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    114a <my_strcp+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    118d <my_strcp+0x7d>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1185 <my_strcp+0x75>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1156 <my_strcp+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcp>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1124 <my_strcp+0x14>
mov    (%rbx),%cl
mov    %cl,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @my_strcp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %1
store i8* null, i8** %2
br label %35
14: ; preds = %1
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
br label %19
19: ; preds = %23, %14
%20 = load i32, i32* %5
%21 = add nsw i32 %20, -1
store i32 %21, i32* %5
%22 = icmp ne i32 %20, 0
br i1 %22, label %23, label %33
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = load i8*, i8** %4
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
br label %19
33: ; preds = %19
%34 = load i8*, i8** %4
store i8* %34, i8** %2
br label %35
35: ; preds = %33, %13
%36 = load i8*, i8** %2
ret i8* %36
}

LLVM IR (-O2):
define noalias i8* @my_strcp(i8* nocapture %0) {
%2 = tail call i8* @malloc(i32 0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load i8, i8* %0
store i8 %5, i8* %2
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void c_emit(int ch) {
  fputc(ch, stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<c_emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_emit>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputc@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @c_emit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputc(i32 %3, i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @c_emit(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputc(i32 %0, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  int x = 5;
  int y = 7;
  if (y == 7) {
    if (x != 5) {
      puts("@@@@@");
    } else {
    }
    puts("#####");
    puts("$$$$$");
    puts("&&&&&");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jne    117b <main+0x6b>
cmpl   $0x5,-0x8(%rbp)
je     1152 <main+0x42>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
jmp    1157 <main+0x47>
jmp    1157 <main+0x47>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"#####\00"
@.str.2 = [6 x i8] c"$$$$$\00"
@.str.3 = [6 x i8] c"&&&&&\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
void foo324(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo324(i32 %0) {
ret void
}
/* Type definitions */
struct net_interface {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ net_interface_object(struct net_interface *);
int obus_object_set_user_data(int /*<<< orphan*/, void *);
int net_interface_set_user_data(struct net_interface *object, void *user_data) {
  return obus_object_set_user_data(net_interface_object(object), user_data);
}


x86 assembly (clang, -O0):
<net_interface_set_user_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <net_interface_object@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <obus_object_set_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_interface_set_user_data>:
push   %rbx
mov    %rsi,%rbx
call   1040 <net_interface_object@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <obus_object_set_user_data@plt>

LLVM IR (-O0):
%struct.net_interface = type { i32 }
define i32 @net_interface_set_user_data(%struct.net_interface* %0, i8* %1) {
%3 = alloca %struct.net_interface*
%4 = alloca i8*
store %struct.net_interface* %0, %struct.net_interface** %3
store i8* %1, i8** %4
%5 = load %struct.net_interface*, %struct.net_interface** %3
%6 = call i32 @net_interface_object(%struct.net_interface* %5)
%7 = load i8*, i8** %4
%8 = call i32 @obus_object_set_user_data(i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.net_interface = type { i32 }
define i32 @net_interface_set_user_data(%struct.net_interface* %0, i8* %1) {
%3 = tail call i32 @net_interface_object(%struct.net_interface* %0)
%4 = tail call i32 @obus_object_set_user_data(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
const char *bool_to_str(const bool v) { return v ? "Yes" : "No"; }


x86 assembly (clang, -O0):
<bool_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef3(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_to_str>:
test   %edi,%edi
lea    0xefb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define i8* @bool_to_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define i8* @bool_to_str(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int x_del_bword(c)
int c;
{
  x_delete(x_bword(), 0);
  return 0;
}


x86 assembly (clang, -O0):
<x_del_bword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <x_bword@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <x_delete@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_del_bword>:
push   %rax
xor    %eax,%eax
call   1030 <x_bword@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <x_delete@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @x_del_bword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @x_bword()
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @x_delete to i32 (i32, i32, ...)*)(i32 %3, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @x_del_bword(i32 %0) {
%2 = tail call i32 (...) @x_bword()
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @x_delete to i32 (i32, i32, ...)*)(i32 %2, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int main() {
  f1();
  f2();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
ret i32 0
}
void ASN1_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_dup() {
ret void
}
void INT_Excep_MTU8_TGIB8(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU8_TGIB8() {
ret void
}
int test_imm_9Duint8_mem(unsigned char *val) {
  return ((*val) & (-0x9D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -157
%7 = icmp ne i32 %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_9Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 99
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int getppid() { return syscall(32, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<getppid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getppid>:
mov    $0x20,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getppid() {
%1 = call i32 @syscall(i32 32, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getppid() {
%1 = tail call i32 @syscall(i32 32, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int);
const char *litfmt(unsigned val) {
  static char buf[40];
  if (val > 9)
    snprintf(buf, sizeof(buf), "0x%x", val);
  else
    snprintf(buf, sizeof(buf), "%d", val);
  return buf;
}


x86 assembly (clang, -O0):
<litfmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jbe    1145 <litfmt+0x35>
mov    -0x4(%rbp),%ecx
lea    0x2f11(%rip),%rdi
mov    $0x28,%esi
lea    0xec5(%rip),%rdx
call   1030 <snprintf@plt>
jmp    1160 <litfmt+0x50>
mov    -0x4(%rbp),%ecx
lea    0x2ef1(%rip),%rdi
mov    $0x28,%esi
lea    0xeaa(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ed9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@litfmt.buf = internal global [40 x i8] zeroinitializer
@.str = [5 x i8] c"0x%x\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @litfmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 9
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @litfmt.buf, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @snprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @litfmt.buf, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %5
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @litfmt.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@litfmt.buf = internal global [40 x i8] zeroinitializer
@.str = [5 x i8] c"0x%x\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @litfmt(i32 %0) {
%2 = icmp ugt i32 %0, 9
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @litfmt.buf, i64 0, i64 0), i32 40, i8* %3, i32 %0)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @litfmt.buf, i64 0, i64 0)
}
int mystrcmp(const char *a, const char *b) {
  while (*a && *a == *b) {
    a++;
    b++;
  }
  return (*a - *b);
}


x86 assembly (clang, -O0):
<mystrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <mystrcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <mystrcmp+0x47>
jmp    1164 <mystrcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <mystrcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <mystrcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <mystrcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <mystrcmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int cbmarch_iec_poll(int);
int cbm_iec_get(int HandleDevice, int Line) {
  ;
  return (cbmarch_iec_poll(HandleDevice) & Line) != 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<cbm_iec_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cbmarch_iec_poll@plt>
mov    %eax,%edx
and    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_iec_get>:
push   %rbx
mov    %esi,%ebx
call   1030 <cbmarch_iec_poll@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cbm_iec_get(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 = call i32 @cbmarch_iec_poll(i32 %5)
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @cbm_iec_get(i32 %0, i32 %1) {
%3 = tail call i32 @cbmarch_iec_poll(i32 %0)
%4 = and i32 %3, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *a, int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", a[i]);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *strncpy(char *, char const *, int);
char *strncpy_IFNAMSIZ(char *dst, const char *src) {
  return strncpy(dst, src, 16);
}


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

x86 assembly (clang, -O2):
<strncpy_IFNAMSIZ>:
mov    $0x10,%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @strncpy_IFNAMSIZ(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strncpy(i8* %5, i8* %6, i32 16)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strncpy_IFNAMSIZ(i8* %0, i8* %1) {
%3 = tail call i8* @strncpy(i8* %0, i8* %1, i32 16)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ __gettimeofday(struct timeval *, struct timezone *);
time_t time(time_t *t) {
  struct timeval tv;
  time_t result;
  if (__gettimeofday(&tv, (struct timezone *)NULL))
    result = (time_t)-1;
  else
    result = (time_t)tv.tv_sec;
  if (t != NULL)
    *t = result;
  return result;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <__gettimeofday@plt>
cmp    $0x0,%rax
je     1140 <time+0x30>
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
jmp    1148 <time+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <time+0x4e>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <__gettimeofday@plt>
neg    %rax
sbb    %rax,%rax
or     0x8(%rsp),%rax
test   %rbx,%rbx
je     1137 <time+0x27>
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64 }
%struct.timezone = type { i32 }
define i64 @time(i64* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i64 @__gettimeofday(%struct.timeval* %2, %struct.timezone* null)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 %7, i64 -1
%9 = icmp eq i64* %0, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i64 %8, i64* %0
br label %11
11: ; preds = %10, %1
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ pdump(int);
int /*<<< orphan*/ printf(char *);
extern void regular_expression(int len) {
  printf("\t\tRegex - ");
  pdump(len);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<regular_expression>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <pdump@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09\09Regex - \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @regular_expression(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @pdump(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09\09Regex - \00"
define void @regular_expression(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pdump(i32 %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
char byte_to_base(unsigned char byte, int offset) {
  int rev_offset = 3 - offset;
  unsigned char mask = 3 << (rev_offset * 2);
  int idx = (byte & mask) >> (rev_offset * 2);
  char *bases = "TCAG";
  return bases[idx];
}


x86 assembly (clang, -O0):
<byte_to_base>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x3,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
mov    $0x3,%eax
shl    %cl,%eax
mov    %al,-0xd(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_to_base>:
add    %sil,%sil
mov    $0x6,%cl
sub    %sil,%cl
mov    $0x3,%eax
shl    %cl,%eax
and    %edi,%eax
shr    %cl,%rax
lea    0xee5(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TCAG\00"
define signext i8 @byte_to_base(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8*
store i8 %0, i8* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = sub nsw i32 3, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 2
%13 = shl i32 3, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = load i32, i32* %5
%21 = mul nsw i32 %20, 2
%22 = ashr i32 %19, %21
store i32 %22, i32* %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %8
%23 = load i8*, i8** %8
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
ret i8 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"TCAG\00"
define signext i8 @byte_to_base(i8 zeroext %0, i32 %1) {
%3 = mul i32 %1, -2
%4 = add i32 %3, 6
%5 = shl i32 3, %4
%6 = zext i8 %0 to i32
%7 = and i32 %5, %6
%8 = lshr i32 %7, %4
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [5 x i8], [5 x i8]* @.str, i64 0, i64 %9
%11 = load i8, i8* %10
ret i8 %11
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t rc_nanos_since_epoch() {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  return ((uint64_t)ts.tv_sec * 1000000000) + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<rc_nanos_since_epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_nanos_since_epoch>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i32 @rc_nanos_since_epoch() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_REALTIME = global i32 0
define i32 @rc_nanos_since_epoch() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int pm8901_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8901_mpp_config_bi_dir(unsigned mpp, unsigned level, unsigned control) {
  return pm8901_mpp_config(mpp, 2, level, control);
}


x86 assembly (clang, -O0):
<pm8901_mpp_config_bi_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x2,%esi
call   1030 <pm8901_mpp_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8901_mpp_config_bi_dir>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <pm8901_mpp_config@plt>

LLVM IR (-O0):
define i32 @pm8901_mpp_config_bi_dir(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pm8901_mpp_config(i32 %7, i32 2, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pm8901_mpp_config_bi_dir(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8901_mpp_config(i32 %0, i32 2, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ wn3(int, int, int);
main() {
  int x;
  int y, h;
  y = 150;
  h = 300;
  x = 30;
  wn3((x * x) / 256 + 3 * y + h, (x * x) / 256 + 3 * y + h,
      (x * x) / 256 + 3 * y + h);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x96,-0x8(%rbp)
movl   $0x12c,-0xc(%rbp)
movl   $0x1e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
imul   $0x3,-0x8(%rbp),%eax
add    %eax,%edi
add    -0xc(%rbp),%edi
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x3,-0x8(%rbp),%eax
add    %eax,%esi
add    -0xc(%rbp),%esi
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
imul   $0x3,-0x8(%rbp),%eax
add    %eax,%edx
add    -0xc(%rbp),%edx
call   1030 <wn3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2f1,%edi
mov    $0x2f1,%esi
mov    $0x2f1,%edx
call   1030 <wn3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 150, i32* %2
store i32 300, i32* %3
store i32 30, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = mul nsw i32 %4, %5
%7 = sdiv i32 %6, 256
%8 = load i32, i32* %2
%9 = mul nsw i32 3, %8
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %1
%14 = load i32, i32* %1
%15 = mul nsw i32 %13, %14
%16 = sdiv i32 %15, 256
%17 = load i32, i32* %2
%18 = mul nsw i32 3, %17
%19 = add nsw i32 %16, %18
%20 = load i32, i32* %3
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %1
%23 = load i32, i32* %1
%24 = mul nsw i32 %22, %23
%25 = sdiv i32 %24, 256
%26 = load i32, i32* %2
%27 = mul nsw i32 3, %26
%28 = add nsw i32 %25, %27
%29 = load i32, i32* %3
%30 = add nsw i32 %28, %29
%31 = call i32 @wn3(i32 %12, i32 %21, i32 %30)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @wn3(i32 753, i32 753, i32 753)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
void uninit_fgetc(void) {
  FILE *fp;
  fgetc(fp);
}


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

x86 assembly (clang, -O2):
<uninit_fgetc>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define void @uninit_fgetc() {
%1 = tail call i32 @fgetc(i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  bar();
  bar();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    $0x0,%al
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bar()
%3 = call i32 (...) @bar()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double garan2();
int GARandomInt() { return garan2() > 0.5 ? 1 : 0; }


x86 assembly (clang, -O0):
<GARandomInt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <garan2@plt>
movsd  0xedd(%rip),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GARandomInt>:
push   %rax
xor    %eax,%eax
call   1030 <garan2@plt>
xor    %eax,%eax
ucomisd 0xede(%rip),%xmm0
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @GARandomInt() {
%1 = call double (...) @garan2()
%2 = fcmp ogt double %1, 5.000000e-01
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @GARandomInt() {
%1 = tail call double (...) @garan2()
%2 = fcmp ogt double %1, 5.000000e-01
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void HelloFunc() { printf("Hello World from HelloLib\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Hello World from HelloLib\0A\00"
define void @HelloFunc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Hello World from HelloLib\00"
define void @HelloFunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
int /*<<< orphan*/ *strchr(char *, int);
int isSeparator(int c) {
  return isspace(c) || c == '\0' || strchr(",.()+-/*=~%<>[]:;", c) != NULL;
}


x86 assembly (clang, -O0):
<isSeparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <isSeparator+0x4d>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116d <isSeparator+0x4d>
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSeparator>:
push   %rbx
mov    %edi,%ebx
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %ebx,%ebx
je     1152 <isSeparator+0x32>
test   %rcx,%rcx
jne    1152 <isSeparator+0x32>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c",.()+-/*=~%<>[]:;\00"
define i32 @isSeparator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isspace(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32* @strchr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp ne i32* %11, null
br label %13
13: ; preds = %9, %6, %1
%14 = phi i1 [ true, %6 ], [ true, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [18 x i8] c",.()+-/*=~%<>[]:;\00"
define i32 @isSeparator(i32 %0) {
%2 = tail call i64 @isspace(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32* @strchr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}