xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int __android_log_write(int, char const *, char *);
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int __libc_android_log_vprint(int prio, const char *tag, const char *fmt,
                              va_list ap) {
  char buf[1024];
  vsnprintf(buf, 1024, fmt, ap);
  return __android_log_write(prio, tag, buf);
}


x86 assembly (clang, -O0):
<__libc_android_log_vprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x420(%rbp),%rdx
call   1040 <__android_log_write@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_android_log_vprint>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <__android_log_write@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__libc_android_log_vprint(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [1024 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @vsnprintf(i8* %10, i32 1024, i8* %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%17 = call i32 @__android_log_write(i32 %14, i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @__libc_android_log_vprint(i32 %0, i8* %1, i8* nocapture %2, i32 %3) {
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = call i32 @vsnprintf(i8* %6, i32 1024, i8* %2, i32 %3)
%8 = call i32 @__android_log_write(i32 %0, i8* %1, i8* %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int lstat64(const char *__file, void *__buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<lstat64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lstat64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lstat64(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun3(int num) { printf("in fun3\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"in fun3\00"
define void @fun3(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sv_get_module_color(int, int);
int vox_get_module_color(int slot, int mod_num) {
  return sv_get_module_color(slot, mod_num);
}


x86 assembly (clang, -O0):
<vox_get_module_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sv_get_module_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vox_get_module_color>:
jmp    1030 <sv_get_module_color@plt>

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

LLVM IR (-O2):
define i32 @vox_get_module_color(i32 %0, i32 %1) {
%3 = tail call i32 @sv_get_module_color(i32 %0, i32 %1)
ret i32 %3
}
int f4(int x) { return 2 * x; }


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

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

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

LLVM IR (-O2):
define i32 @f4(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void time_kill(unsigned long z) {
  unsigned long x;
  double y;
  for (x = 0; x < z; x++) {
    y = x * x * x * x / (x + 1) * (x + 1) * (x + 1) * (x + 2);
  }
}


x86 assembly (clang, -O0):
<time_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1192 <time_kill+0x92>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
imul   %rax,%rax
imul   %rcx,%rax
imul   %rcx,%rax
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x20(%rbp)
xor    %edx,%edx
div    %rsi
mov    -0x20(%rbp),%rdx
imul   %rdx,%rax
imul   %rdx,%rax
add    $0x2,%rcx
imul   %rcx,%rax
movq   %rax,%xmm0
movaps 0xe9f(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xea3(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <time_kill+0x10>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @time_kill(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
store i64 %0, i64* %2
store i64 0, i64* %3
br label %5
5: ; preds = %30, %1
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = icmp ult i64 %6, %7
br i1 %8, label %9, label %33
9: ; preds = %5
%10 = load i64, i64* %3
%11 = load i64, i64* %3
%12 = mul i64 %10, %11
%13 = load i64, i64* %3
%14 = mul i64 %12, %13
%15 = load i64, i64* %3
%16 = mul i64 %14, %15
%17 = load i64, i64* %3
%18 = add i64 %17, 1
%19 = udiv i64 %16, %18
%20 = load i64, i64* %3
%21 = add i64 %20, 1
%22 = mul i64 %19, %21
%23 = load i64, i64* %3
%24 = add i64 %23, 1
%25 = mul i64 %22, %24
%26 = load i64, i64* %3
%27 = add i64 %26, 2
%28 = mul i64 %25, %27
%29 = uitofp i64 %28 to double
store double %29, double* %4
br label %30
30: ; preds = %9
%31 = load i64, i64* %3
%32 = add i64 %31, 1
store i64 %32, i64* %3
br label %5
33: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @time_kill(i64 %0) {
ret void
}
char *dgettext(const char *domainname, const char *x) { return (char *)x; }


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

x86 assembly (clang, -O2):
<dgettext>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @dgettext(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x4d() {
  Assert_real((isdigit(77) == 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_isdigit.c",
              390, ("isdigit should be 0 for M"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x4d>:
push   %rax
mov    $0x4d,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x186,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for M\00"
define void @t_isdigit_0x4d() {
%1 = call i64 @isdigit(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for M\00"
define void @t_isdigit_0x4d() {
%1 = tail call i64 @isdigit(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void I2CMasterReadLastRequestS2(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000400;
}


x86 assembly (clang, -O0):
<I2CMasterReadLastRequestS2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffbff,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterReadLastRequestS2>:
andq   $0xfffffffffffffbff,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterReadLastRequestS2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -1025
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterReadLastRequestS2(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -1025
store volatile i64 %4, i64* %2
ret void
}
void null_set_mixer(int vol) {}


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

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

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

LLVM IR (-O2):
define void @null_set_mixer(i32 %0) {
ret void
}
int test_imm_6Euint16_mem(unsigned short *val) {
  return ((*val) & (0x6E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Euint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 110
%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_6Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 110
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void glSampleCoverage(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glSampleCoverage() {
ret void
}
/* Variables and functions */
double _pow(double, double);
double d2d(double);
double pow(double x, double y) { return d2d(_pow(d2d(x), d2d(y))); }


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <d2d@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <d2d@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
call   1030 <_pow@plt>
call   1040 <d2d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1040 <d2d@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <d2d@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <_pow@plt>
add    $0x18,%rsp
jmp    1040 <d2d@plt>

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @d2d(double %5)
%7 = load double, double* %4
%8 = call double @d2d(double %7)
%9 = call double @_pow(double %6, double %8)
%10 = call double @d2d(double %9)
ret double %10
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double @d2d(double %0)
%4 = tail call double @d2d(double %1)
%5 = tail call double @_pow(double %3, double %4)
%6 = tail call double @d2d(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ access_url(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ get_credentials(char *);
int get_friends_timeline(void) {
  char username_password[80];
  get_credentials(username_password);
  access_url(username_password, NULL, 1);
  return 0;
}


x86 assembly (clang, -O0):
<get_friends_timeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1040 <get_credentials@plt>
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <access_url@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_friends_timeline>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <get_credentials@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <access_url@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_friends_timeline() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_credentials(i8* %2)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @access_url(i8* %4, i32* null, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @get_friends_timeline() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_credentials(i8* %2)
%4 = call i32 @access_url(i8* %2, i32* null, i32 1)
ret i32 0
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] + 707305405UL) * (unsigned short)58185;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0x30dd5ac,%rax
add    $0x20ea,%rax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
cmp    %ecx,%eax
jge    114e <RandomFunc+0x4e>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1129 <RandomFunc+0x29>
movzwl -0x12(%rbp),%eax
add    $0x2a289fbd,%rax
imul   $0xe349,%rax,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
imul   $0xffffe349,%eax,%eax
add    $0x76ab,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i64
%11 = add i64 %10, 51238316
%12 = add i64 %11, 8426
%13 = trunc i64 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %6
br label %15
15: ; preds = %23, %2
%16 = load i16, i16* %6
%17 = zext i16 %16 to i32
%18 = load i16*, i16** %3
%19 = getelementptr inbounds i16, i16* %18, i64 1
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = icmp slt i32 %17, %21
br i1 %22, label %23, label %28
23: ; preds = %15
%24 = load i16, i16* %6
%25 = zext i16 %24 to i64
%26 = add i64 %25, 2
%27 = trunc i64 %26 to i16
store i16 %27, i16* %6
br label %15
28: ; preds = %15
%29 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%30 = load i16, i16* %29
%31 = zext i16 %30 to i64
%32 = add i64 %31, 707305405
%33 = mul i64 %32, 58185
%34 = trunc i64 %33 to i16
%35 = load i16*, i16** %4
%36 = getelementptr inbounds i16, i16* %35, i64 0
store i16 %34, i16* %36
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = mul i16 %3, -7351
%5 = add i16 %4, 30379
store i16 %5, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void single_handler(int signal) {
  printf("User defined signal handler (signal=%d).\n", signal);
}


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

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

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

LLVM IR (-O2):
@.str = [42 x i8] c"User defined signal handler (signal=%d).\0A\00"
define void @single_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(void) {
  char msg[] =
      "CCExample Help\nThis is a simple console input program to demonstrate "
      "the usage of the\nccargs code. There isn't much to do but you can try "
      "the following.\n\n  [Commands]\n\n      about	        Displays a "
      "version and author message about this example\n      echo [str]        "
      "Echos the given string\n      exit              Quits the program\n     "
      " help              Displays this message\n      sum [a] [b]	Adds a "
      "+ b and prints their sum\n";
  printf("%s", msg);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
lea    -0x1b0(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1af,%edx
call   1040 <memcpy@plt>
lea    -0x1b0(%rbp),%rsi
lea    0x105e(%rip),%rdi
call   1030 <printf@plt>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
sub    $0x1b0,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x1af,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
lea    0x1069(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.help.msg = [431 x i8] c"CCExample Help\0AThis is a simple console input program to demonstrate the usage of the\0Accargs code. There isn't much to do but you can try the following.\0A\0A [Commands]\0A\0A about\09 Displays a version and author message about this example\0A echo [str] Echos the given string\0A exit Quits the program\0A help Displays this message\0A sum [a] [b]\09Adds a + b and prints their sum\0A\00"
@.str = [3 x i8] c"%s\00"
define void @help() {
%1 = alloca [431 x i8]
%2 = bitcast [431 x i8]* %1 to i8*
%3 = getelementptr inbounds [431 x i8], [431 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@__const.help.msg = [431 x i8] c"CCExample Help\0AThis is a simple console input program to demonstrate the usage of the\0Accargs code. There isn't much to do but you can try the following.\0A\0A [Commands]\0A\0A about\09 Displays a version and author message about this example\0A echo [str] Echos the given string\0A exit Quits the program\0A help Displays this message\0A sum [a] [b]\09Adds a + b and prints their sum\0A\00"
@.str = [3 x i8] c"%s\00"
define void @help() {
%1 = alloca [431 x i8]
%2 = getelementptr inbounds [431 x i8], [431 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl(const uint64_t x, int k) {
  k &= 63;
  return (x << k) | (x >> (64 - k));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
and    $0x3f,%cl
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 63
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 64, %11
%13 = ashr i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = and i32 %1, 63
%4 = shl i32 %0, %3
%5 = sub nuw nsw i32 64, %3
%6 = ashr i32 %0, %5
%7 = or i32 %6, %4
ret i32 %7
}
int silly(int w) {
  int a = 7;
  switch (w) {
  case 11:
    return 22;
  case 5:
    a = 9;
  case 6:
    return a * 7;
  }
  return a;
}


x86 assembly (clang, -O0):
<silly>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x5,%eax
je     1150 <silly+0x50>
jmp    1122 <silly+0x22>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     1157 <silly+0x57>
jmp    1133 <silly+0x33>
mov    -0x10(%rbp),%eax
sub    $0xb,%eax
jne    1163 <silly+0x63>
jmp    1144 <silly+0x44>
movl   $0x16,-0x4(%rbp)
jmp    1169 <silly+0x69>
movl   $0x9,-0xc(%rbp)
imul   $0x7,-0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <silly+0x69>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<silly>:
cmp    $0xb,%edi
je     1115 <silly+0x15>
cmp    $0x6,%edi
je     111b <silly+0x1b>
cmp    $0x5,%edi
jne    1121 <silly+0x21>
mov    $0x3f,%eax
ret
mov    $0x16,%eax
ret
mov    $0x31,%eax
ret
mov    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @silly(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 7, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %11 [
i32 11, label %6
i32 5, label %7
i32 6, label %8
]
6: ; preds = %1
store i32 22, i32* %2
br label %13
7: ; preds = %1
store i32 9, i32* %4
br label %8
8: ; preds = %1, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 7
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %8, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @silly(i32 %0) {
switch i32 %0, label %5 [
i32 11, label %6
i32 5, label %2
i32 6, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 49, %1 ], [ 63, %2 ]
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %3
%7 = phi i32 [ 7, %5 ], [ %4, %3 ], [ 22, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t load32(const void *ptr) {
  uint32_t v;
  memcpy(&v, ptr, sizeof v);
  return v;
}


x86 assembly (clang, -O0):
<load32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @load32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @load32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdout;
int main(void) {
  int x;
  while ((x = getchar()) != EOF) {
    putchar(x);
    fflush(stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     1173 <main+0x43>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
je     116a <main+0x3a>
mov    0x2e8a(%rip),%rbx
xchg   %ax,%ax
mov    %eax,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %9, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int simple_link_recv(long, void *, long, long, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *, int);
int recv(long sd, void *buf, long len, long flags) {
  return (simple_link_recv(sd, buf, len, flags, NULL, NULL, 0x1004));
}


x86 assembly (clang, -O0):
<recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
movl   $0x1004,(%rsp)
call   1030 <simple_link_recv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv>:
push   %rax
movl   $0x1004,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <simple_link_recv@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @recv(i64 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i32 @simple_link_recv(i64 %9, i8* %10, i64 %11, i64 %12, i32* null, i32* null, i32 4100)
ret i32 %13
}

LLVM IR (-O2):
define i32 @recv(i64 %0, i8* %1, i64 %2, i64 %3) {
%5 = tail call i32 @simple_link_recv(i64 %0, i8* %1, i64 %2, i64 %3, i32* null, i32* null, i32 4100)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error1(char *, int);
int read(int, void *, int);
int xread(int fd, void *buffer, int size) {
  int n;
  if (size == 0)
    return 0;
  n = read(fd, buffer, size);
  if (n != size)
    error1("error reading %d bytes\n", size);
  return 0;
}


x86 assembly (clang, -O0):
<xread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1148 <xread+0x28>
movl   $0x0,-0x4(%rbp)
jmp    117c <xread+0x5c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1175 <xread+0x55>
mov    -0x14(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <error1@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xread>:
push   %rbx
test   %edx,%edx
je     113e <xread+0x1e>
mov    %edx,%ebx
call   1030 <read@plt>
cmp    %ebx,%eax
je     113e <xread+0x1e>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1040 <error1@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"error reading %d bytes\0A\00"
define i32 @xread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %24
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @read(i32 %13, i8* %14, i32 %15)
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i32, i32* %7
%22 = call i32 @error1(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %12
store i32 0, i32* %4
br label %24
24: ; preds = %23, %11
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
@.str = [24 x i8] c"error reading %d bytes\0A\00"
define i32 @xread(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%7 = icmp eq i32 %6, %2
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @error1(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %10
10: ; preds = %5, %8, %3
ret i32 0
}
/* Variables and functions */
int munmap(void *, int);
int msvd_unmap_intmem(void *intmem) { return munmap(intmem, (256 * 1024)); }


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

x86 assembly (clang, -O2):
<msvd_unmap_intmem>:
mov    $0x40000,%esi
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @msvd_unmap_intmem(i8* %0) {
%2 = tail call i32 @munmap(i8* %0, i32 262144)
ret i32 %2
}
int test_imm_ACint64_lowword_reg(long long val) {
  return ((val) & (0xAC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ACint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 172
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf(
      "usage %s [options] \n"
      "-h\t\tThis text\n"
      "-l datadir\tList stat from directory\n"
      "-e datadir\tExpire data in directory\n"
      "-r datadir\tRescan data directory\n"
      "-u datadir\tUpdate expire params from collector logging at <datadir>\n"
      "-s size\t\tmax size: scales b bytes, k kilo, m mega, g giga t tera\n"
      "-t lifetime\tmaximum life time of data: scales: w week, d day, H hour, "
      "M minute\n"
      "-w watermark\tlow water mark in %% for expire.\n",
      name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [398 x i8] c"usage %s [options] \0A-h\09\09This text\0A-l datadir\09List stat from directory\0A-e datadir\09Expire data in directory\0A-r datadir\09Rescan data directory\0A-u datadir\09Update expire params from collector logging at <datadir>\0A-s size\09\09max size: scales b bytes, k kilo, m mega, g giga t tera\0A-t lifetime\09maximum life time of data: scales: w week, d day, H hour, M minute\0A-w watermark\09low water mark in %% for expire.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([398 x i8], [398 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [398 x i8] c"usage %s [options] \0A-h\09\09This text\0A-l datadir\09List stat from directory\0A-e datadir\09Expire data in directory\0A-r datadir\09Rescan data directory\0A-u datadir\09Update expire params from collector logging at <datadir>\0A-s size\09\09max size: scales b bytes, k kilo, m mega, g giga t tera\0A-t lifetime\09maximum life time of data: scales: w week, d day, H hour, M minute\0A-w watermark\09low water mark in %% for expire.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([398 x i8], [398 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int of_alias_get_id(struct device_node *np, const char *stem) { return -38; }


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_alias_get_id(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -38
}
/* Type definitions */
struct clk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ might_sleep();
void clk_unprepare(struct clk *clk) { might_sleep(); }


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

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

LLVM IR (-O0):
%struct.clk = type { i32 }
define void @clk_unprepare(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
%3 = call i32 (...) @might_sleep()
ret void
}

LLVM IR (-O2):
%struct.clk = type { i32 }
define void @clk_unprepare(%struct.clk* nocapture readnone %0) {
%2 = tail call i32 (...) @might_sleep()
ret void
}
void nn_clock_term(struct nn_clock *self) {}


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

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

LLVM IR (-O0):
%struct.nn_clock = type opaque
define void @nn_clock_term(%struct.nn_clock* %0) {
%2 = alloca %struct.nn_clock*
store %struct.nn_clock* %0, %struct.nn_clock** %2
ret void
}

LLVM IR (-O2):
%struct.nn_clock = type opaque
define void @nn_clock_term(%struct.nn_clock* nocapture %0) {
ret void
}
int echo_wait(string, flag)
char *string[];
long *flag;
{
  *flag = 2L;
  return (1);
}


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

x86 assembly (clang, -O2):
<echo_wait>:
movq   $0x2,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @echo_wait(i8** nocapture readnone %0, i64* nocapture writeonly %1) {
store i64 2, i64* %1
ret i32 1
}
int f12(int x) {
  switch (x) {
  default:
    return 3;
  case 10 ... - 1:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f12(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
]
5: ; preds = %1
store i32 3, i32* %2
br label %7
6: ; No predecessors!
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f12(i32 %0) {
ret i32 3
}
void increment(void *closure, int c) {
  int *len = (int *)closure;
  (*len)++;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @increment(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @increment(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int strlen(char const *);
int extcmp(const char *name, const char *ext) {
  return strcasecmp(name + strlen(name) - strlen(ext), ext);
}


x86 assembly (clang, -O0):
<extcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
movslq %eax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extcmp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
movslq %eax,%rbx
add    %r15,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
sub    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @extcmp(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = sext i32 %11 to i64
%13 = sub i64 0, %12
%14 = getelementptr inbounds i8, i8* %9, i64 %13
%15 = load i8*, i8** %4
%16 = call i32 @strcasecmp(i8* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @extcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strlen(i8* %1)
%7 = sext i32 %6 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = tail call i32 @strcasecmp(i8* %9, i8* %1)
ret i32 %10
}
void glVertexAttribIPointer(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttribIPointer() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, int, char const *, int /*<<< orphan*/, int /*<<< orphan*/,
            int);
int fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag) {
  return syscall(325, fd, path, uid, gid, flag);
}


x86 assembly (clang, -O0):
<fchownat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    $0x145,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchownat>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x145,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @syscall(i32 325, i32 %11, i8* %12, i32 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @syscall(i32 325, i32 %0, i8* %1, i32 %2, i32 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n;
  int sum;
  sum = 0;
  for (n = 0; n < 10; n++) {
    sum = sum + n * n;
  }
  printf("sum: %d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1154 <main+0x44>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"sum: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 285)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ twister_genrand64_int64();
int64_t random_int64(void) { return twister_genrand64_int64(); }


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

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

LLVM IR (-O0):
define i32 @random_int64() {
%1 = call i32 (...) @twister_genrand64_int64()
ret i32 %1
}

LLVM IR (-O2):
define i32 @random_int64() {
%1 = tail call i32 (...) @twister_genrand64_int64()
ret i32 %1
}
long div_ll_X_l_rem(long long divs, long div, long *rem) {
  long dum2;
  __asm__("divl %2" : "=a"(dum2), "=d"(*rem) : "rm"(div), "A"(divs));
  return dum2;
}


x86 assembly (clang, -O0):
<div_ll_X_l_rem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,-0x28(%rbp)
divl   -0x28(%rbp)
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,-0x20(%rbp)
mov    %rdx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @div_ll_X_l_rem(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%8 = load i64*, i64** %6
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = call { i64, i64 } asm "divl $2", "={ax},={dx},rm,A,~{dirflag},~{fpsr},~{flags}"(i64 %9, i64 %10)
%12 = extractvalue { i64, i64 } %11, 0
%13 = extractvalue { i64, i64 } %11, 1
store i64 %12, i64* %7
store i64 %13, i64* %8
%14 = load i64, i64* %7
ret i64 %14
}

LLVM IR (-O2):