xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void concat_char(char *str, char *x, char *sep) {
  char buf[50] = {0};
  sprintf(buf, "%s%s", sep, x);
  strcat(str, buf);
}


x86 assembly (clang, -O0):
<concat_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1030 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe99(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_char>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
lea    0xeb4(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define void @concat_char(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [50 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast [50 x i8]* %7 to i8*
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%15 = call i32 @strcat(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define void @concat_char(i8* %0, i8* %1, i8* %2) {
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1)
%7 = call i32 @strcat(i8* %0, i8* %5)
ret void
}
char *__strcpy(char *dst, const char *src) {
  int d0, d1, d2;
  asm volatile("1: lodsb;"
               "stosb;"
               "testb %%al, %%al;"
               "jne 1b;"
               : "=&S"(d0), "=&D"(d1), "=&a"(d2)
               : "0"(src), "1"(dst)
               : "memory");
  return dst;
}


x86 assembly (clang, -O0):
<__strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1114 <__strcpy+0x14>
mov    %esi,%ecx
mov    %ecx,-0x14(%rbp)
mov    %edi,%ecx
mov    %ecx,-0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strcpy>:
mov    %rdi,%rcx
lods   %ds:(%rsi),%al
stos   %al,%es:(%rdi)
test   %al,%al
jne    1103 <__strcpy+0x3>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @__strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call { i8*, i8*, i32 } asm sideeffect "1: lodsb;stosb;testb %al, %al;jne 1b;", "=&{si},=&{di},=&{ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i8*, i8*, i32 } %10, 0
%12 = extractvalue { i8*, i8*, i32 } %10, 1
%13 = extractvalue { i8*, i8*, i32 } %10, 2
%14 = ptrtoint i8* %11 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %12 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
store i32 %13, i32* %7
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @__strcpy(i8* returned %0, i8* %1) {
%3 = tail call { i8*, i8*, i32 } asm sideeffect "1: lodsb;stosb;testb %al, %al;jne 1b;", "=&{si},=&{di},=&{ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sayHello() { printf("Hello there world.\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello there world.\00"
define void @sayHello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
long long orig_L40_set(long long L40_var1) {
  long long L40_var_out;
  L40_var_out = L40_var1 & 0x000000ffffffffffLL;
  if (L40_var1 & 0x8000000000LL)
    L40_var_out = L40_var_out | 0xffffff0000000000LL;
  return (L40_var_out);
}


x86 assembly (clang, -O0):
<orig_L40_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffffff,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movabs $0x8000000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1144 <orig_L40_set+0x44>
movabs $0xffffff0000000000,%rax
ff ff ff
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<orig_L40_set>:
movabs $0xffffffffff,%rcx
and    %rdi,%rcx
shl    $0x18,%rdi
sar    $0x3f,%rdi
movabs $0xffffff0000000000,%rax
ff ff ff
and    %rdi,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @orig_L40_set(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 1099511627775
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = and i64 %6, 549755813888
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %3
%11 = or i64 %10, -1099511627776
store i64 %11, i64* %3
br label %12
12: ; preds = %9, %1
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @orig_L40_set(i64 %0) {
%2 = and i64 %0, 1099511627775
%3 = and i64 %0, 549755813888
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i64 0, i64 -1099511627776
%6 = or i64 %5, %2
ret i64 %6
}
/* Variables and functions */
double lgamma(double);
double log(double);
double log2fac(int n) {
  double y, x;
  x = (double)(n + 1);
  y = lgamma(x);
  return (y / log(2.0));
}


x86 assembly (clang, -O0):
<log2fac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <lgamma@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea5(%rip),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2fac>:
push   %rax
add    $0x1,%edi
cvtsi2sd %edi,%xmm0
call   1030 <lgamma@plt>
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log2fac(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
%9 = call double @lgamma(double %8)
store double %9, double* %3
%10 = load double, double* %3
%11 = call double @log(double 2.000000e+00)
%12 = fdiv double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @log2fac(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sitofp i32 %2 to double
%4 = tail call double @lgamma(double %3)
%5 = fdiv double %4, 0x3FE62E42FEFA39EF
ret double %5
}
void ftree_file_expand() {}


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

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

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

LLVM IR (-O2):
define void @ftree_file_expand() {
ret void
}
/* Type definitions */
struct stat {
  unsigned int st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int k_stat_size(const char *path, unsigned int *size) {
  struct stat sb;
  int rc = stat(path, &sb);
  if (rc)
    return rc;
  *size = sb.st_size;
  return 0;
}


x86 assembly (clang, -O0):
<k_stat_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1145 <k_stat_size+0x35>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <k_stat_size+0x45>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_stat_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %eax,%eax
jne    112c <k_stat_size+0x1c>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @k_stat_size(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
ret i32 %5
}
/* Variables and functions */
unsigned int get_bit(int, int);
unsigned int get_msb(int reg) {
  unsigned int output;
  output = get_bit(reg, 31);
  return output;
}


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

x86 assembly (clang, -O2):
<get_msb>:
mov    $0x1f,%esi
jmp    1030 <get_bit@plt>

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

LLVM IR (-O2):
define i32 @get_msb(i32 %0) {
%2 = tail call i32 @get_bit(i32 %0, i32 31)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void recurse(int count) {
  printf("%d\n", count);
  recurse(count + 1);
}


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

x86 assembly (clang, -O2):
<recurse>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <recurse+0x10>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @recurse(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nsw i32 %3, 1
br label %2
}
unsigned xrop3_21_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_21_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_21_0_0>:
mov    %edi,%eax
and    %esi,%eax
not    %eax
shl    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_21_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_21_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %1, %0
%4 = zext i8 %3 to i32
%5 = xor i32 %4, -1
%6 = shl nsw i32 %5, 8
ret i32 %6
}
void *alloc_page(size) { return (malloc(size)); }


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

x86 assembly (clang, -O2):
<alloc_page>:
movslq %edi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @alloc_page(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = call i8* @malloc(i64 %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @alloc_page(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
ret i8* %3
}
int test_imm_F7uint16_mem(unsigned short *val) {
  return ((*val) & (0xF7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F7uint16_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, 247
%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_F7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 247
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void scanGenericCommand(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               119, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<scanGenericCommand>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x77,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanGenericCommand>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x77,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.scanGenericCommand = [19 x i8] c"scanGenericCommand\00"
define void @scanGenericCommand() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.scanGenericCommand, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.scanGenericCommand = [19 x i8] c"scanGenericCommand\00"
define void @scanGenericCommand() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.scanGenericCommand, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ signal(int, int /*<<< orphan*/);
void ignoreSignal(int sig) {
  if (signal(sig, SIG_IGN) == SIG_ERR) {
    printf("Failed to install signal handler for signal %d\n", sig);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<ignoreSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
jne    1175 <ignoreSignal+0x45>
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoreSignal>:
push   %rbx
mov    %edi,%ebx
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
je     114f <ignoreSignal+0x1f>
pop    %rbx
ret
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [48 x i8] c"Failed to install signal handler for signal %d\0A\00"
define void @ignoreSignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i64 @signal(i32 %3, i32 %4)
%6 = load i64, i64* @SIG_ERR
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [48 x i8] c"Failed to install signal handler for signal %d\0A\00"
define void @ignoreSignal(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i64 @signal(i32 %0, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestAllocOversizeArrays();
int /*<<< orphan*/ TestZeroFillARRAYofARRAY8();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) {
  TestAllocOversizeArrays();
  TestZeroFillARRAYofARRAY8();
  exit(0);
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @TestAllocOversizeArrays()
%7 = call i32 (...) @TestZeroFillARRAYofARRAY8()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TestAllocOversizeArrays()
%4 = tail call i32 (...) @TestZeroFillARRAYofARRAY8()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ putc(int);
void puti(int i) {
  if (i < 0) {
    putc('-');
    i = -i;
  }
  if (i >= 10) {
    int k = i / 10;
    puti(k);
  }
  putc(i % 10 + '0');
}


x86 assembly (clang, -O0):
<puti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <puti+0x27>
mov    $0x2d,%edi
call   1030 <putc@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1167 <puti+0x47>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <puti@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puti>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <puti+0x16>
mov    $0x2d,%edi
call   1030 <putc@plt>
neg    %ebx
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <puti+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <puti@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @puti(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @putc(i32 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = icmp ugt i32 %7, 9
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = udiv i32 %7, 10
tail call void @puti(i32 %10)
br label %11
11: ; preds = %9, %6
%12 = urem i32 %7, 10
%13 = or i32 %12, 48
%14 = tail call i32 @putc(i32 %13)
ret void
}
/* Variables and functions */
void *(Memento_dropRef)(void *a) { return a; }


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

x86 assembly (clang, -O2):
<Memento_dropRef>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @Memento_dropRef(i8* readnone returned %0) {
ret i8* %0
}
unsigned char inb(unsigned int base, unsigned int offset) {
  return (*(unsigned volatile char *)(base + offset * 1));
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x0,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
add    %esi,%edi
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(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 = mul i32 %6, 1
%8 = add i32 %5, %7
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ discard_until(char *);
void cm_ignore_line(void) { discard_until("\n"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @cm_ignore_line() {
%1 = call i32 @discard_until(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @cm_ignore_line() {
%1 = tail call i32 @discard_until(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int foo(int *);
int rand();
int main(int argc, char **argv) {
  int x = rand();
  return foo(&x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @rand()
store i32 %7, i32* %6
%8 = call i32 @foo(i32* %6)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @rand()
store i32 %5, i32* %3
%6 = call i32 @foo(i32* %3)
ret i32 %6
}
/* Variables and functions */
int fabs(double);
int feq(double a, double b) { return fabs(a - b) < 1e-9; }


x86 assembly (clang, -O0):
<feq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feq>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @feq(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 = load double, double* %4
%7 = fsub double %5, %6
%8 = call i32 @fabs(double %7)
%9 = sitofp i32 %8 to double
%10 = fcmp olt double %9, 1.000000e-09
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @feq(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __chown(const char *file, uid_t owner, gid_t group) {
  if (file == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__chown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <__chown+0x37>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <__chown+0x4c>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__chown>:
push   %rax
test   %rdi,%rdi
jne    111f <__chown+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <__chown+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__chown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* @EINVAL
%12 = call i32 @__set_errno(i32 %11)
store i32 -1, i32* %4
br label %16
13: ; preds = %3
%14 = load i32, i32* @ENOSYS
%15 = call i32 @__set_errno(i32 %14)
store i32 -1, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__chown(i8* readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = load i32, i32* @EINVAL
%6 = load i32, i32* @ENOSYS
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @__set_errno(i32 %7)
ret i32 -1
}
double foo(int x) { return (double)(float)((x & -16) | (int)0xf0000000); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffff0,%eax
or     $0xf0000000,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
and    $0xffffff0,%edi
or     $0xf0000000,%edi
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16
%5 = or i32 %4, -268435456
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
ret double %7
}

LLVM IR (-O2):
define double @foo(i32 %0) {
%2 = and i32 %0, 268435440
%3 = or i32 %2, -268435456
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ Console_Flush();
int Platform_ReadBuf(long long, void *, long long, long long *);
void Console_Read(unsigned char *ch) {
  long long n;
  int error;
  Console_Flush();
  error =
      Platform_ReadBuf(((long long)(0)), (void *)&*ch, ((long long)(1)), &n);
  if (n != 1) {
    *ch = 0x00;
  }
}


x86 assembly (clang, -O0):
<Console_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Console_Flush@plt>
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%edx
lea    -0x10(%rbp),%rcx
call   1040 <Platform_ReadBuf@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x1,-0x10(%rbp)
je     115e <Console_Read+0x3e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Console_Read>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Console_Flush@plt>
lea    0x8(%rsp),%rcx
mov    $0x1,%edx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <Platform_ReadBuf@plt>
cmpq   $0x1,0x8(%rsp)
je     114e <Console_Read+0x2e>
movb   $0x0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Console_Read(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = tail call i32 (...) @Console_Flush()
%5 = call i32 @Platform_ReadBuf(i64 0, i8* %0, i64 1, i64* %2)
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1
br i1 %7, label %9, label %8
8: ; preds = %1
store i8 0, i8* %0
br label %9
9: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  long long x;
  int n;
  if (sizeof(long long) < 64)
    exit(0);
  n = 9;
  x = (((long long)n) << 55) / 0xff;
  if (x == 0)
    abort();
  x = (((long long)9) << 55) / 0xff;
  if (x == 0)
    abort();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int rom_present(char *);
int gd5429_available() { return rom_present("5429.vbi"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"5429.vbi\00"
define i32 @gd5429_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"5429.vbi\00"
define i32 @gd5429_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, char const *);
int phLineSetFollowMe(int vlid, const char *uri) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "FOLLOWME VLID=%d TO=%s", vlid, uri);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phLineSetFollowMe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x3e8,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phLineSetFollowMe>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"FOLLOWME VLID=%d TO=%s\00"
define i32 @phLineSetFollowMe(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [1000 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 1000, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"FOLLOWME VLID=%d TO=%s\00"
define i32 @phLineSetFollowMe(i32 %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1000, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
void memset2(unsigned char *dest, unsigned char val, int ndata) {
  int n;
  for (n = 0; n < ndata; n++)
    dest[n] = val;
}


x86 assembly (clang, -O0):
<memset2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1140 <memset2+0x40>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <memset2+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset2>:
test   %edx,%edx
jle    1124 <memset2+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @memset2(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void clear_eol() { printf("%c[K", 0x1B); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%c[K\00"
define void @clear_eol() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}
unsigned char f40(unsigned char x, long int y) {
  return (x >> y) | (x << (8 - y));
}


x86 assembly (clang, -O0):
<f40>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f40>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f40(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 8, %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f40(i8 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_putstr2(char *);
void error_kill(int killthis) {
  if (killthis == -1) {
    my_putstr2("\nError : Your kill doesn't work and return -1 ");
    my_putstr2("This is why the program have stopped of himself\n\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<error_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1157 <error_kill+0x37>
lea    0xec4(%rip),%rdi
call   1030 <my_putstr2@plt>
lea    0xee7(%rip),%rdi
call   1030 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_kill>:
cmp    $0xffffffff,%edi
je     1126 <error_kill+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <my_putstr2@plt>
lea    0xef5(%rip),%rdi
call   1030 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\0AError : Your kill doesn't work and return -1 \00"
@.str.1 = [50 x i8] c"This is why the program have stopped of himself\0A\0A\00"
define void @error_kill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @my_putstr2(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @my_putstr2(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0AError : Your kill doesn't work and return -1 \00"
@.str.1 = [50 x i8] c"This is why the program have stopped of himself\0A\0A\00"
define void @error_kill(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void test2(int a, int b, long long value, int after) {
  if (a != 1 || b != 2 || value != 0x123456789abcdefLL || after != 0x55)
    abort();
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1157 <test2+0x47>
cmpl   $0x2,-0x8(%rbp)
jne    1157 <test2+0x47>
movabs $0x123456789abcdef,%rax
45 23 01
cmp    %rax,-0x10(%rbp)
jne    1157 <test2+0x47>
cmpl   $0x55,-0x14(%rbp)
je     115e <test2+0x4e>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
cmp    $0x1,%edi
jne    112f <test2+0x1f>
cmp    $0x2,%esi
jne    112f <test2+0x1f>
movabs $0x123456789abcdef,%rax
45 23 01
cmp    %rax,%rdx
jne    112f <test2+0x1f>
cmp    $0x55,%ecx
jne    112f <test2+0x1f>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test2(i32 %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 1
br i1 %10, label %20, label %11
11: ; preds = %4
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 2
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i64, i64* %7
%16 = icmp ne i64 %15, 81985529216486895
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %8
%19 = icmp ne i32 %18, 85
br i1 %19, label %20, label %22
20: ; preds = %17, %14, %11, %4
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @test2(i32 %0, i32 %1, i64 %2, i32 %3) {
%5 = icmp ne i32 %0, 1
%6 = icmp ne i32 %1, 2
%7 = or i1 %5, %6
%8 = icmp ne i64 %2, 81985529216486895
%9 = or i1 %7, %8
%10 = icmp ne i32 %3, 85
%11 = or i1 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c() { printf("c\n"); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gdk_keyval_to_lower() {
ret void
}
void unset_bit(int *n, int b) { *n &= ~(1 << b); }


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

x86 assembly (clang, -O2):
<unset_bit>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @unset_bit(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 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @unset_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}