xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
float rand_rangef(float min, float max) {
  return (rand() / (float)RAND_MAX) * (max - min) + min;
}


x86 assembly (clang, -O0):
<rand_rangef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2eb8(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_rangef>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ebe(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @rand_rangef(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float (...) @rand()
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
%9 = load float, float* %4
%10 = load float, float* %3
%11 = fsub float %9, %10
%12 = load float, float* %3
%13 = call float @llvm.fmuladd.f32(float %8, float %11, float %12)
ret float %13
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @rand_rangef(float %0, float %1) {
%3 = tail call float (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to float
%6 = fdiv float %3, %5
%7 = fsub float %1, %0
%8 = tail call float @llvm.fmuladd.f32(float %6, float %7, float %0)
ret float %8
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _list_del(struct list_head *);
int /*<<< orphan*/ list_add_tail(struct list_head *, struct list_head *);
void list_move_tail(struct list_head *entry, struct list_head *head) {
  _list_del(entry);
  list_add_tail(entry, head);
}


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

x86 assembly (clang, -O2):
<list_move_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <_list_del@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add_tail@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @_list_del(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add_tail(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_tail(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @_list_del(%struct.list_head* %0)
%4 = tail call i32 @list_add_tail(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
char *__attribute__((no)) my_mempcpy(char *d, char *s, unsigned l) {
  return __builtin_mempcpy(d, s, l);
}


x86 assembly (clang, -O0):
<my_mempcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,%edx
mov    %rdx,-0x20(%rbp)
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mempcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %edx,%r14d
mov    %r14,%rdx
call   1030 <memcpy@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_mempcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
ret i8* %11
}

LLVM IR (-O2):
define i8* @my_mempcpy(i8* writeonly %0, i8* nocapture %1, i32 %2) {
%4 = zext i32 %2 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x03() {
  Assert_real((isodigit(3) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              20, ("isodigit should be 0 for 0x03"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x03>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x14,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x03>:
push   %rax
mov    $0x3,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x14,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x03\00"
define void @t_isodigit_0x03() {
%1 = call i64 @isodigit(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x03\00"
define void @t_isodigit_0x03() {
%1 = tail call i64 @isodigit(i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned char dd2c(char d1, char d2) {
  register unsigned char digit;
  digit = (d1 >= 'A' ? ((d1 & 0xdf) - 'A') + 10 : (d1 - '0'));
  digit *= 16;
  digit += (d2 >= 'A' ? ((d2 & 0xdf) - 'A') + 10 : (d2 - '0'));
  return (digit);
}


x86 assembly (clang, -O0):
<dd2c>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1134 <dd2c+0x34>
movsbl -0x1(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <dd2c+0x3e>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1172 <dd2c+0x72>
movsbl -0x2(%rbp),%eax
and    $0xdf,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    117c <dd2c+0x7c>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
movzbl -0x3(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd2c>:
mov    %esi,%eax
and    $0xdf,%al
add    $0xc9,%al
lea    -0x30(%rsi),%ecx
cmp    $0x41,%sil
movzbl %cl,%ecx
movzbl %al,%edx
cmovl  %ecx,%edx
mov    %edi,%eax
shl    $0x4,%al
lea    -0x70(%rax),%ecx
cmp    $0x41,%dil
movzbl %al,%esi
movzbl %cl,%eax
cmovl  %esi,%eax
add    %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @dd2c(i8 signext %0, i8 signext %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
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = and i32 %11, 223
%13 = sub nsw i32 %12, 65
%14 = add nsw i32 %13, 10
br label %19
15: ; preds = %2
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
br label %19
19: ; preds = %15, %9
%20 = phi i32 [ %14, %9 ], [ %18, %15 ]
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = mul nsw i32 %23, 16
%25 = trunc i32 %24 to i8
store i8 %25, i8* %5
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp sge i32 %27, 65
br i1 %28, label %29, label %35
29: ; preds = %19
%30 = load i8, i8* %4
%31 = sext i8 %30 to i32
%32 = and i32 %31, 223
%33 = sub nsw i32 %32, 65
%34 = add nsw i32 %33, 10
br label %39
35: ; preds = %19
%36 = load i8, i8* %4
%37 = sext i8 %36 to i32
%38 = sub nsw i32 %37, 48
br label %39
39: ; preds = %35, %29
%40 = phi i32 [ %34, %29 ], [ %38, %35 ]
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = add nsw i32 %42, %40
%44 = trunc i32 %43 to i8
store i8 %44, i8* %5
%45 = load i8, i8* %5
ret i8 %45
}

LLVM IR (-O2):
define zeroext i8 @dd2c(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 64
%4 = icmp sgt i8 %1, 64
%5 = and i8 %1, -33
%6 = add i8 %5, -55
%7 = add i8 %1, -48
%8 = select i1 %4, i8 %6, i8 %7
%9 = shl i8 %0, 4
%10 = add i8 %9, -112
%11 = select i1 %3, i8 %10, i8 %9
%12 = add i8 %8, %11
ret i8 %12
}
void RTSemSpinMutexDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemSpinMutexDestroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printarrayc(char a[], int count) {
  for (int i = 0; i < count; ++i)
    printf("%c", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printarrayc>:
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    115a <printarrayc+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printarrayc+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarrayc>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printarrayc+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printarrayc+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printarrayc(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @putchar(i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void outputHelp() {
  printf(
      "\n??logon - Start logging chat session to local file.\n??logoff - Stop "
      "logging chat session to local file.\n??logclear - Delete the current "
      "logfile.\n??who - Display which users are connected.\n??list - Show all "
      "available user accounts.\n??quit - Shutdown this client.\n");
}


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

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

LLVM IR (-O0):
@.str = [264 x i8] c"\0A??logon - Start logging chat session to local file.\0A??logoff - Stop logging chat session to local file.\0A??logclear - Delete the current logfile.\0A??who - Display which users are connected.\0A??list - Show all available user accounts.\0A??quit - Shutdown this client.\0A\00"
define void @outputHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [263 x i8] c"\0A??logon - Start logging chat session to local file.\0A??logoff - Stop logging chat session to local file.\0A??logclear - Delete the current logfile.\0A??who - Display which users are connected.\0A??list - Show all available user accounts.\0A??quit - Shutdown this client.\00"
define void @outputHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([263 x i8], [263 x i8]* @str, i64 0, i64 0))
ret void
}
void foo_2_2_2_1_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srl_copy_bytes_to_index(char *, char *, size_t, int);
int /*<<< orphan*/ srl_int32_to_bytes(int, char *);
void srl_copy_int32_to_index(char *buf, int src, size_t idx) {
  char tmp[4];
  srl_int32_to_bytes(src, tmp);
  srl_copy_bytes_to_index(buf, tmp, idx, 4);
}


x86 assembly (clang, -O0):
<srl_copy_int32_to_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <srl_int32_to_bytes@plt>
mov    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <srl_copy_bytes_to_index@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srl_copy_int32_to_index>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%r15
mov    %esi,%edi
mov    %r15,%rsi
call   1040 <srl_int32_to_bytes@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x4,%ecx
call   1030 <srl_copy_bytes_to_index@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @srl_copy_int32_to_index(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca [4 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%10 = call i32 @srl_int32_to_bytes(i32 %8, i8* %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%13 = load i64, i64* %6
%14 = call i32 @srl_copy_bytes_to_index(i8* %11, i8* %12, i64 %13, i32 4)
ret void
}

LLVM IR (-O2):
define void @srl_copy_int32_to_index(i8* %0, i32 %1, i64 %2) {
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%6 = call i32 @srl_int32_to_bytes(i32 %1, i8* %5)
%7 = call i32 @srl_copy_bytes_to_index(i8* %0, i8* %5, i64 %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
size_t strxfrm(char *dest, const char *src, size_t n) {
  size_t l = strlen(src);
  if (n > l)
    strcpy(dest, src);
  return l;
}


x86 assembly (clang, -O0):
<strxfrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    115c <strxfrm+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strxfrm>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
cmp    %r12,%rax
jae    114c <strxfrm+0x2c>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @strxfrm(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg16(int, unsigned short);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, int);
void VIM_LCDIF_RsLExW(unsigned short uVal) {
  VIM_HIF_SetReg16((0x0400 + 0x01a), uVal);
  VIM_HIF_SetReg8((0x0400 + 0x018), 0x1);
}


x86 assembly (clang, -O0):
<VIM_LCDIF_RsLExW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x41a,%edi
movzwl -0x2(%rbp),%esi
call   1040 <VIM_HIF_SetReg16@plt>
mov    $0x418,%edi
mov    $0x1,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_LCDIF_RsLExW>:
push   %rax
mov    %edi,%esi
mov    $0x41a,%edi
call   1040 <VIM_HIF_SetReg16@plt>
mov    $0x418,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_LCDIF_RsLExW(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @VIM_HIF_SetReg16(i32 1050, i16 zeroext %3)
%5 = call i32 @VIM_HIF_SetReg8(i32 1048, i32 1)
ret void
}

LLVM IR (-O2):
define void @VIM_LCDIF_RsLExW(i16 zeroext %0) {
%2 = tail call i32 @VIM_HIF_SetReg16(i32 1050, i16 zeroext %0)
%3 = tail call i32 @VIM_HIF_SetReg8(i32 1048, i32 1)
ret void
}
unsigned int getIBytes(unsigned int e, int i) {
  unsigned int mask, res;
  int j = 0;
  while (i != 0 && j <= 32 - 1) {
    mask = 1u << j;
    res = e & mask;
    if (res) {
      i--;
    }
    j++;
  }
  return res;
}


x86 assembly (clang, -O0):
<getIBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
je     112a <getIBytes+0x2a>
cmpl   $0x1f,-0x14(%rbp)
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    113a <getIBytes+0x3a>
jmp    1171 <getIBytes+0x71>
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1163 <getIBytes+0x63>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1111 <getIBytes+0x11>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIBytes>:
test   %esi,%esi
je     112d <getIBytes+0x2d>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%eax
shl    %cl,%eax
xor    %edx,%edx
and    %edi,%eax
setne  %dl
sub    %edx,%esi
je     112c <getIBytes+0x2c>
lea    0x1(%rcx),%edx
cmp    $0x1f,%ecx
mov    %edx,%ecx
jb     1110 <getIBytes+0x10>
ret
ret

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

LLVM IR (-O2):
define i32 @getIBytes(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %1, %2 ]
%7 = shl nuw i32 1, %5
%8 = and i32 %7, %0
%9 = icmp ne i32 %8, 0
%10 = sext i1 %9 to i32
%11 = add nsw i32 %6, %10
%12 = add nuw nsw i32 %5, 1
%13 = icmp ne i32 %11, 0
%14 = icmp ult i32 %5, 31
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %4, label %16
16: ; preds = %4, %2
%17 = phi i32 [ undef, %2 ], [ %8, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int dummy() {
  printf("Totally called the function pointer\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Totally called the function pointer\0A\00"
define i32 @dummy() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"Totally called the function pointer\00"
define i32 @dummy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float inner_float(float value) { return value; }


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

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

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

LLVM IR (-O2):
define float @inner_float(float returned %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ device_info(int);
int device_open(int, int);
void list_devices(void) {
  int i, fd;
  for (i = 0; i < 32; i++) {
    fd = device_open(i, 1);
    if (-1 == fd)
      return;
    device_info(fd);
    close(fd);
  }
  return;
}


x86 assembly (clang, -O0):
<list_devices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    118a <list_devices+0x5a>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <device_open@plt>
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    -0x8(%rbp),%eax
jne    116c <list_devices+0x3c>
jmp    118f <list_devices+0x5f>
mov    -0x8(%rbp),%edi
call   1050 <device_info@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <list_devices+0xf>
jmp    118f <list_devices+0x5f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_devices>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <device_open@plt>
cmp    $0xffffffff,%eax
je     1169 <list_devices+0x39>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <device_info@plt>
mov    %ebp,%edi
call   1040 <close@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <list_devices+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @list_devices() {
br label %1
1: ; preds = %0, %5
%2 = phi i32 [ 0, %0 ], [ %8, %5 ]
%3 = tail call i32 @device_open(i32 %2, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = tail call i32 @device_info(i32 %3)
%7 = tail call i32 @close(i32 %3)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %1
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int *malloc(int);
void FogetFree() {
  int i;
  for (i = 0; i < 1000000; ++i) {
    int *x = malloc(1000000);
  }
}


x86 assembly (clang, -O0):
<FogetFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    1148 <FogetFree+0x38>
mov    $0xf4240,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <FogetFree+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FogetFree>:
push   %rbx
mov    $0xf4240,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xf4240,%edi
call   1030 <malloc@plt>
add    $0xffffffff,%ebx
jne    1120 <FogetFree+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @FogetFree() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32* @malloc(i32 1000000)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int func(int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int i;
  long result = 0;
  for (i = 1; i <= 100; i++) {
    result += i;
  }
  printf("result[1-100]=%ld\n", result);
  printf("result[1-250]=%d\n", func(250));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1162 <main+0x42>
movslq -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x1e>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfa,%edi
call   1040 <func@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"result[1-100]=%ld\0A\00"
@.str.1 = [18 x i8] c"result[1-250]=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5050)
%2 = tail call i32 @func(i32 250)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRAA_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRAA_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRAA_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
reg0regx1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     1138 <reg0regx1+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <reg0regx1+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0regx1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmp    %edi,(%r9,%rcx,4)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @reg0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp uge i32 %9, %0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ cread(long *);
scalar_t__ cread_alt(long *);
int main(int argc, char *argv[]) {
  long a = 0;
  assert(cread(&a) == cread_alt(&a));
  assert(cread(NULL) == cread_alt(NULL));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <cread@plt>
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <cread_alt@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <cread@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <cread_alt@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <cread@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <cread_alt@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
call   1040 <cread@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1030 <cread_alt@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%7 = call i64 @cread(i64* %6)
%8 = call i64 @cread_alt(i64* %6)
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i64 @cread(i64* null)
%13 = call i64 @cread_alt(i64* null)
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i64 @cread(i64* %3)
%6 = call i64 @cread_alt(i64* %3)
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i64 @cread(i64* null)
%11 = call i64 @cread_alt(i64* null)
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}
void X509V3_string_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_string_free() {
ret void
}
/* Variables and functions */
char tolower(char);
char *strlower(char *str) {
  char *s;
  if (str == NULL)
    return NULL;
  s = str;
  while (*s) {
    *s = tolower(*s);
    s++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strlower+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1176 <strlower+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <strlower+0x5e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113c <strlower+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <strlower+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <strlower+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlower(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
int setresuid(int, int, int);
int main(void) { return setresuid(-1, -1, -1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <setresuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <setresuid@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setresuid(i32 -1, i32 -1, i32 -1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @setresuid(i32 -1, i32 -1, i32 -1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world from userspace!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"Hello world from userspace!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct dm_hash_table {
  int dummy;
};
struct dm_hash_node {
  int dummy;
};

/* Variables and functions */
struct dm_hash_node *_next_slot(struct dm_hash_table *, int /*<<< orphan*/);
struct dm_hash_node *dm_hash_get_first(struct dm_hash_table *t) {
  return _next_slot(t, 0);
}


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

x86 assembly (clang, -O2):
<dm_hash_get_first>:
xor    %esi,%esi
jmp    1030 <_next_slot@plt>

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

LLVM IR (-O2):
%struct.dm_hash_node = type { i32 }
%struct.dm_hash_table = type { i32 }
define %struct.dm_hash_node* @dm_hash_get_first(%struct.dm_hash_table* %0) {
%2 = tail call %struct.dm_hash_node* @_next_slot(%struct.dm_hash_table* %0, i32 0)
ret %struct.dm_hash_node* %2
}
void check_options_tcp_crr(struct options *opts, struct callbacks *cb) {}


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

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

LLVM IR (-O0):
%struct.options = type opaque
%struct.callbacks = type opaque
define void @check_options_tcp_crr(%struct.options* %0, %struct.callbacks* %1) {
%3 = alloca %struct.options*
%4 = alloca %struct.callbacks*
store %struct.options* %0, %struct.options** %3
store %struct.callbacks* %1, %struct.callbacks** %4
ret void
}

LLVM IR (-O2):
%struct.options = type opaque
%struct.callbacks = type opaque
define void @check_options_tcp_crr(%struct.options* nocapture %0, %struct.callbacks* nocapture %1) {
ret void
}
__attribute__((vector_size(16))) float fa(void) {
  return (__attribute__((vector_size(16))) float){1.0, 1.0, 0.0, 0.0};
}


x86 assembly (clang, -O0):
<fa>:
push   %rbp
mov    %rsp,%rbp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,-0x10(%rbp)
movaps -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa>:
movaps 0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define <4 x float> @fa() {
%1 = alloca <4 x float>
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00>, <4 x float>* %1
%2 = load <4 x float>, <4 x float>* %1
ret <4 x float> %2
}

LLVM IR (-O2):
define <4 x float> @fa() {
ret <4 x float> <float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00>
}
/* Variables and functions */
int hash_int(int key) {
  key = ~key + (key << 15);
  key = key ^ (key >> 12);
  key = key + (key << 2);
  key = key ^ (key >> 4);
  key = key * 2057;
  key = key ^ (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<hash_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x809,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_int>:
mov    %edi,%eax
not    %eax
shl    $0xf,%edi
add    %eax,%edi
mov    %edi,%eax
sar    $0xc,%eax
xor    %edi,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x809,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = load i32, i32* %2
%6 = shl i32 %5, 15
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 12
%11 = xor i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 2
%15 = add nsw i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 4
%19 = xor i32 %16, %18
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = mul nsw i32 %20, 2057
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 16
%25 = xor i32 %22, %24
store i32 %25, i32* %2
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @hash_int(i32 %0) {
%2 = xor i32 %0, -1
%3 = shl i32 %0, 15
%4 = add nsw i32 %3, %2
%5 = ashr i32 %4, 12
%6 = xor i32 %5, %4
%7 = mul i32 %6, 5
%8 = ashr i32 %7, 4
%9 = xor i32 %8, %7
%10 = mul nsw i32 %9, 2057
%11 = ashr i32 %10, 16
%12 = xor i32 %11, %10
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR88_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR88_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR88_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void g_hook_list_marshal() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_list_marshal() {
ret void
}
void *read_byte(void *src, int *x) {
  *x = *(unsigned char *)src;
  return src + 1;
}


x86 assembly (clang, -O0):
<read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_byte>:
movzbl (%rdi),%eax
mov    %eax,(%rsi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @read_byte(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i8*, i8** %3
%10 = getelementptr i8, i8* %9, i64 1
ret i8* %10
}

LLVM IR (-O2):
define i8* @read_byte(i8* %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
store i32 %4, i32* %1
%5 = getelementptr i8, i8* %0, i64 1
ret i8* %5
}
__attribute((always_, weak)) int f() { return 3; }


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

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

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

LLVM IR (-O2):
define weak i32 @f() {
ret i32 3
}
void timer_list(void) {}


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

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

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

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