xunge/DecIR huggingface dataset:
/* Type definitions */
struct lvalue {
  int dummy;
};

/* Variables and functions */
scalar_t__ dbltest(struct lvalue *, struct lvalue *);
int /*<<< orphan*/ gen_pop();
int /*<<< orphan*/ output_line(char *);
void gen_add(struct lvalue *lval, struct lvalue *lval2) {
  gen_pop();
  if (dbltest(lval2, lval))
    output_line("add hl,de");
  output_line("add hl,de");
}


x86 assembly (clang, -O0):
<gen_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <gen_pop@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <dbltest@plt>
cmp    $0x0,%rax
je     116a <gen_add+0x3a>
lea    0xe9b(%rip),%rdi
call   1040 <output_line@plt>
lea    0xe8f(%rip),%rdi
call   1040 <output_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <gen_pop@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <dbltest@plt>
test   %rax,%rax
je     115d <gen_add+0x2d>
lea    0xea8(%rip),%rdi
call   1040 <output_line@plt>
lea    0xe9c(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_line@plt>

LLVM IR (-O0):
%struct.lvalue = type { i32 }
@.str = [10 x i8] c"add hl,de\00"
define void @gen_add(%struct.lvalue* %0, %struct.lvalue* %1) {
%3 = alloca %struct.lvalue*
%4 = alloca %struct.lvalue*
store %struct.lvalue* %0, %struct.lvalue** %3
store %struct.lvalue* %1, %struct.lvalue** %4
%5 = call i32 (...) @gen_pop()
%6 = load %struct.lvalue*, %struct.lvalue** %4
%7 = load %struct.lvalue*, %struct.lvalue** %3
%8 = call i64 @dbltest(%struct.lvalue* %6, %struct.lvalue* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.lvalue = type { i32 }
@.str = [10 x i8] c"add hl,de\00"
define void @gen_add(%struct.lvalue* %0, %struct.lvalue* %1) {
%3 = tail call i32 (...) @gen_pop()
%4 = tail call i64 @dbltest(%struct.lvalue* %1, %struct.lvalue* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float sqrt(float x) { return (float)sqrt((double)x); }


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1110 <sqrt+0x10>
ret
nopl   0x0(%rax)
jmp    1110 <sqrt+0x10>

LLVM IR (-O0):
define float @sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fptrunc double %4 to float
%6 = call float @sqrt(float %5)
ret float %6
}

LLVM IR (-O2):
define float @sqrt(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret float undef
}
int main(void) {
  int i;
  char *p = (char *)0x10000;
  for (i = 0; i < 1000000; i++) {
    *p++ = 0;
  }
  for (i = 0; i < 1000000; i++) {
    ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x10000,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1148 <main+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <main+0x1b>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    116f <main+0x6f>
jmp    1161 <main+0x61>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x4f>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double latenthtvap(double tcair) {
  double lv;
  lv = (2.501 - 0.00237 * tcair) * 1.0e6;
  return (lv);
}


x86 assembly (clang, -O0):
<latenthtvap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeee(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<latenthtvap>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @latenthtvap(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double -2.370000e-03, double %4, double 2.501000e+00)
%6 = fmul double %5, 1.000000e+06
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @latenthtvap(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double -2.370000e-03, double 2.501000e+00)
%3 = fmul double %2, 1.000000e+06
ret double %3
}
int main(int argc, char *argv[]) {
  int i;
  int j;
  switch (i) {
  case 1:
    j = 1;
    break;
  case 2:
    j = 2;
    break;
  default:
    j = 0;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     1137 <main+0x37>
jmp    1126 <main+0x26>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     1143 <main+0x43>
jmp    114f <main+0x4f>
movl   $0x1,-0x18(%rbp)
jmp    1156 <main+0x56>
movl   $0x2,-0x18(%rbp)
jmp    1156 <main+0x56>
movl   $0x0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int ObjCMain(int, char **);
int main(int argc, char *argv[]) { return ObjCMain(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ObjCMain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ObjCMain@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @ObjCMain(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ObjCMain(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned elapsed_msec(unsigned t0) {
  struct timeval t1;
  unsigned msec;
  gettimeofday(&t1, 0);
  msec = t1.tv_sec * 1000 + t1.tv_usec / 1000;
  msec -= t0;
  if (msec < 1)
    msec = 1;
  return msec;
}


x86 assembly (clang, -O0):
<elapsed_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jae    1161 <elapsed_msec+0x51>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_msec>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%ecx
movslq 0xc(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
sub    %ebx,%ecx
add    %eax,%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @elapsed_msec(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = sub i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = icmp ult i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %1
store i32 1, i32* %4
br label %19
19: ; preds = %18, %1
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @elapsed_msec(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sub i32 %7, %0
%12 = add i32 %11, %10
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 1, i32 %12
ret i32 %14
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int isdir(char *filename) {
  static struct stat stats;
  return (stat(filename, &stats) == true) && (S_ISDIR(stats.st_mode));
}


x86 assembly (clang, -O0):
<isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2efd(%rip),%rsi
call   1040 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
jne    1161 <isdir+0x41>
mov    0x2ee2(%rip),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdir>:
push   %rax
lea    0x2f0c(%rip),%rsi
call   1040 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    114c <isdir+0x2c>
mov    0x2ef8(%rip),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@isdir.stats = internal global %struct.stat zeroinitializer
define i32 @isdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @stat(i8* %3, %struct.stat* @isdir.stats)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* getelementptr inbounds (%struct.stat, %struct.stat* @isdir.stats, i32 0, i32 0)
%8 = call i64 @S_ISDIR(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@isdir.stats = internal global %struct.stat zeroinitializer
define i32 @isdir(i8* nocapture %0) {
%2 = tail call i32 @stat(i8* %0, %struct.stat* @isdir.stats)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* getelementptr inbounds (%struct.stat, %struct.stat* @isdir.stats, i64 0, i32 0)
%6 = tail call i64 @S_ISDIR(i32 %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printValue(char *value) { printf("\n%s\n\n", value); }


x86 assembly (clang, -O0):
<printValue>:
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):
<printValue>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%s\0A\0A\00"
define void @printValue(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned char I_CleanChar(unsigned char in) {
  if (in == 146)
    return 39;
  return in;
}


x86 assembly (clang, -O0):
<I_CleanChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x92,%eax
jne    1122 <I_CleanChar+0x22>
movb   $0x27,-0x1(%rbp)
jmp    1128 <I_CleanChar+0x28>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I_CleanChar>:
cmp    $0x92,%dil
mov    $0x27,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @I_CleanChar(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 146
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 39, i8* %2
br label %10
8: ; preds = %1
%9 = load i8, i8* %3
store i8 %9, i8* %2
br label %10
10: ; preds = %8, %7
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @I_CleanChar(i8 zeroext %0) {
%2 = icmp eq i8 %0, -110
%3 = select i1 %2, i8 39, i8 %0
ret i8 %3
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR5F_get(void) { return U_WMRCORENONE_get("U_WMR5F"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR5F\00"
define i32 @U_WMR5F_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void caller_2_2_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_1_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ goo(int);
int /*<<< orphan*/ xxx(int);
int main() {
  xxx(27);
  goo(27);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <xxx@plt>
mov    $0x1b,%edi
call   1040 <goo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @xxx(i32 27)
%2 = call i32 @goo(i32 27)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @xxx(i32 27)
%2 = tail call i32 @goo(i32 27)
ret i32 0
}
int nxny7() {
  int x;
  int y;
  x = 0;
  y = 1;
  x += y;
  return 42;
}


x86 assembly (clang, -O0):
<nxny7>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nxny7() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %1
ret i32 42
}

LLVM IR (-O2):
define i32 @nxny7() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ NDFC_WRITE_REG_INT(int);
void NFC_RbIntEnable(void) { NDFC_WRITE_REG_INT((1 << 0)); }


x86 assembly (clang, -O0):
<NFC_RbIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <NDFC_WRITE_REG_INT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NFC_RbIntEnable>:
mov    $0x1,%edi
jmp    1030 <NDFC_WRITE_REG_INT@plt>

LLVM IR (-O0):
define void @NFC_RbIntEnable() {
%1 = call i32 @NDFC_WRITE_REG_INT(i32 1)
ret void
}

LLVM IR (-O2):
define void @NFC_RbIntEnable() {
%1 = tail call i32 @NDFC_WRITE_REG_INT(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldsa(int n) { lgen("%s\tax,offset %c%d", "mov", n); }


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

x86 assembly (clang, -O2):
<cgldsa>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s\09ax,offset %c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldsa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s\09ax,offset %c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldsa(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
int f2(int (*f_p)(), int *var2) {
  int rez = 0;
  printf("in f2 var2 = %d;\n", var2);
  rez = f_p(&var2);
  printf("int f2 after f_p rez = %d;\n", rez);
  return 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsi,0x8(%rsp)
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   *%rbx
lea    0xed7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"in f2 var2 = %d;\0A\00"
@.str.1 = [28 x i8] c"int f2 after f_p rez = %d;\0A\00"
define i32 @f2(i32 (...)* %0, i32* %1) {
%3 = alloca i32 (...)*
%4 = alloca i32*
%5 = alloca i32
store i32 (...)* %0, i32 (...)** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i32*, i32** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32 (...)*, i32 (...)** %3
%9 = bitcast i32 (...)* %8 to i32 (i32**, ...)*
%10 = call i32 (i32**, ...) %9(i32** %4)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"in f2 var2 = %d;\0A\00"
@.str.1 = [28 x i8] c"int f2 after f_p rez = %d;\0A\00"
define i32 @f2(i32 (...)* nocapture %0, i32* %1) {
%3 = alloca i32*
store i32* %1, i32** %3
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast i32 (...)* %0 to i32 (i32**, ...)*
%6 = call i32 (i32**, ...) %5(i32** %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int);
void textcolor(FILE *stream, int attr, int fg, int bg) {
  fprintf(stream, "\033[%d;%d;%dm", attr, fg + 30, bg + 40);
}


x86 assembly (clang, -O0):
<textcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
add    $0x1e,%ecx
mov    -0x14(%rbp),%r8d
add    $0x28,%r8d
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textcolor>:
mov    %esi,%r9d
lea    0x1e(%rdx),%eax
lea    0x28(%rcx),%r8d
lea    0xedf(%rip),%rsi
mov    %r9d,%edx
mov    %eax,%ecx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[%d;%d;%dm\00"
define void @textcolor(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 30
%13 = load i32, i32* %8
%14 = add nsw i32 %13, 40
%15 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[%d;%d;%dm\00"
define void @textcolor(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 30
%6 = add nsw i32 %3, 40
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %5, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, size_t, int /*<<< orphan*/ *);
void write_file(unsigned char *buf, size_t len, FILE *fp) {
  fwrite(buf, 1, len, fp);
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define void @write_file(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32*, i32** %6
%10 = call i32 @fwrite(i8* %7, i32 1, i64 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @write_file(i8* nocapture %0, i64 %1, i32* nocapture %2) {
%4 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i32* %2)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int32_t fib_recursive(int n) {
  if (n < 2)
    return 1;
  int32_t ret = fib_recursive(n - 1) + fib_recursive(n - 2);
  assert(ret > 1);
  return ret;
}


x86 assembly (clang, -O0):
<fib_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1141 <fib_recursive+0x21>
movl   $0x1,-0x4(%rbp)
jmp    117b <fib_recursive+0x5b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fib_recursive@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1040 <fib_recursive@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_recursive>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
cmp    $0x1,%edi
jle    1158 <fib_recursive+0x38>
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1040 <fib_recursive@plt>
mov    %eax,%r14d
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1040 <fib_recursive@plt>
mov    %eax,%ebp
add    %r14d,%ebp
xor    %edi,%edi
cmp    $0x2,%ebp
setge  %dil
call   1030 <assert@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib_recursive(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @fib_recursive(i32 %6)
%8 = add nsw i32 %0, -2
%9 = tail call i32 @fib_recursive(i32 %8)
%10 = add nsw i32 %9, %7
%11 = icmp sgt i32 %10, 1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
br label %3
}
char *nsap_human(struct rr *rrv) { return "..."; }


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

x86 assembly (clang, -O2):
<nsap_human>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.rr = type opaque
@.str = [4 x i8] c"...\00"
define i8* @nsap_human(%struct.rr* %0) {
%2 = alloca %struct.rr*
store %struct.rr* %0, %struct.rr** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.rr = type opaque
@.str = [4 x i8] c"...\00"
define i8* @nsap_human(%struct.rr* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct ufat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ufat_sync(struct ufat *);
void ufat_close(struct ufat *uf) { ufat_sync(uf); }


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

x86 assembly (clang, -O2):
<ufat_close>:
jmp    1030 <ufat_sync@plt>

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

LLVM IR (-O2):
%struct.ufat = type { i32 }
define void @ufat_close(%struct.ufat* %0) {
%2 = tail call i32 @ufat_sync(%struct.ufat* %0)
ret void
}
int test_imm_84uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x84 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_84uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 132
%7 = icmp ne i64 %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_84uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 566935683072
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test_preprocessor();
int main(void) {
  {}
  test_preprocessor();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_preprocessor()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ eat(int);
int /*<<< orphan*/ think(int);
int /*<<< orphan*/ toSleep(int);
void *philosopher(void *i) {
  int nPhilosopher = (int)i;
  int right = nPhilosopher;
  int left = (nPhilosopher - 1 == -1) ? 5 - 1 : (nPhilosopher - 1);
  while (1) {
    think(nPhilosopher);
    eat(nPhilosopher);
    toSleep(nPhilosopher);
  }
}


x86 assembly (clang, -O0):
<philosopher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cmp    $0xffffffff,%eax
jne    1165 <philosopher+0x35>
mov    $0x4,%eax
mov    %eax,-0x18(%rbp)
jmp    116e <philosopher+0x3e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <think@plt>
mov    -0xc(%rbp),%edi
call   1030 <eat@plt>
mov    -0xc(%rbp),%edi
call   1050 <toSleep@plt>
jmp    1174 <philosopher+0x44>

x86 assembly (clang, -O2):
<philosopher>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
call   1040 <think@plt>
mov    %ebx,%edi
call   1030 <eat@plt>
mov    %ebx,%edi
call   1050 <toSleep@plt>
jmp    1140 <philosopher+0x10>

LLVM IR (-O0):
define i8* @philosopher(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
br label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
br label %16
16: ; preds = %13, %12
%17 = phi i32 [ 4, %12 ], [ %15, %13 ]
store i32 %17, i32* %5
br label %18
18: ; preds = %16, %18
%19 = load i32, i32* %3
%20 = call i32 @think(i32 %19)
%21 = load i32, i32* %3
%22 = call i32 @eat(i32 %21)
%23 = load i32, i32* %3
%24 = call i32 @toSleep(i32 %23)
br label %18
}

LLVM IR (-O2):
define noalias i8* @philosopher(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @think(i32 %3)
%6 = tail call i32 @eat(i32 %3)
%7 = tail call i32 @toSleep(i32 %3)
br label %4
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct clause_list_link {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link_prev(struct genlist_link const *);
struct clause_list_link *
clause_list_link_prev(const struct clause_list_link *plink) {
  return ((struct clause_list_link *)genlist_link_prev(
      (const struct genlist_link *)plink));
}


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

x86 assembly (clang, -O2):
<clause_list_link_prev>:
jmp    1030 <genlist_link_prev@plt>

LLVM IR (-O0):
%struct.clause_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.clause_list_link* @clause_list_link_prev(%struct.clause_list_link* %0) {
%2 = alloca %struct.clause_list_link*
store %struct.clause_list_link* %0, %struct.clause_list_link** %2
%3 = load %struct.clause_list_link*, %struct.clause_list_link** %2
%4 = bitcast %struct.clause_list_link* %3 to %struct.genlist_link*
%5 = call i64 @genlist_link_prev(%struct.genlist_link* %4)
%6 = inttoptr i64 %5 to %struct.clause_list_link*
ret %struct.clause_list_link* %6
}

LLVM IR (-O2):
%struct.clause_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.clause_list_link* @clause_list_link_prev(%struct.clause_list_link* %0) {
%2 = bitcast %struct.clause_list_link* %0 to %struct.genlist_link*
%3 = tail call i64 @genlist_link_prev(%struct.genlist_link* %2)
%4 = inttoptr i64 %3 to %struct.clause_list_link*
ret %struct.clause_list_link* %4
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tinyrl_printf(struct tinyrl *, char *);
void tinyrl_vt100_cursor_home(struct tinyrl *this) {
  tinyrl_printf(this, "\x1b[H");
}


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

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

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
@.str = [4 x i8] c"\1B[H\00"
define void @tinyrl_vt100_cursor_home(%struct.tinyrl* %0) {
%2 = alloca %struct.tinyrl*
store %struct.tinyrl* %0, %struct.tinyrl** %2
%3 = load %struct.tinyrl*, %struct.tinyrl** %2
%4 = call i32 @tinyrl_printf(%struct.tinyrl* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
@.str = [4 x i8] c"\1B[H\00"
define void @tinyrl_vt100_cursor_home(%struct.tinyrl* %0) {
%2 = tail call i32 @tinyrl_printf(%struct.tinyrl* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *plugin_api_info_dogechat_site_download_cb(void *data,
                                                      const char *info_name,
                                                      const char *arguments) {
  (void)data;
  (void)info_name;
  (void)arguments;
  return "https://dogechat.org/download";
}


x86 assembly (clang, -O0):
<plugin_api_info_dogechat_site_download_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_dogechat_site_download_cb>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"https://dogechat.org/download\00"
define i8* @plugin_api_info_dogechat_site_download_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [30 x i8] c"https://dogechat.org/download\00"
define i8* @plugin_api_info_dogechat_site_download_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
char *clean_fn(char *fn) {
  if (strncmp(fn, "./", 2) == 0)
    return fn + 2;
  else if (strncmp(fn, "//", 2) == 0)
    return fn + 1;
  else
    return fn;
}


x86 assembly (clang, -O0):
<clean_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    114c <clean_fn+0x3c>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <clean_fn+0x74>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    117c <clean_fn+0x6c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <clean_fn+0x74>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_fn>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1148 <clean_fn+0x38>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
jmp    114d <clean_fn+0x3d>
mov    $0x2,%ecx
add    %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
@.str.1 = [3 x i8] c"//\00"
define i8* @clean_fn(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i64
br label %8
8: ; preds = %1, %4
%9 = phi i64 [ %7, %4 ], [ 2, %1 ]
%10 = getelementptr i8, i8* %0, i64 %9
ret i8* %10
}
/* Variables and functions */
unsigned char rand();
unsigned char _ucGetRand(void) { return (rand()); }


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

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

LLVM IR (-O0):
define zeroext i8 @_ucGetRand() {
%1 = call zeroext i8 (...) @rand()
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @_ucGetRand() {
%1 = tail call zeroext i8 (...) @rand()
ret i8 %1
}
void foo080() {}


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

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

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

LLVM IR (-O2):
define void @foo080() {
ret void
}
void swap(char *a[], int i, int j) {
  char *t = a[i];
  a[i] = a[j];
  a[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i8**, i8*** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
store i8* %17, i8** %21
%22 = load i8*, i8** %7
%23 = load i8**, i8*** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
store i8* %22, i8** %26
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
void m145_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  chr8setBank0((val >> 7) << 13);
}


x86 assembly (clang, -O0):
<m145_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sar    $0x7,%edi
shl    $0xd,%edi
call   1030 <chr8setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m145_setParams>:
mov    %esi,%edi
and    $0xffffff80,%edi
shl    $0x6,%edi
jmp    1030 <chr8setBank0@plt>

LLVM IR (-O0):
define void @m145_setParams(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 = ashr i32 %6, 7
%8 = shl i32 %7, 13
%9 = call i32 @chr8setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m145_setParams(i32 %0, i32 %1) {
%3 = shl i32 %1, 6
%4 = and i32 %3, -8192
%5 = tail call i32 @chr8setBank0(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ watchdog_lock_clk_src();
int /*<<< orphan*/ watchdog_lock_clk_src_power();
int /*<<< orphan*/ watchdog_lock_enable();
int /*<<< orphan*/ watchdog_lock_timer_val();
void watchdog_lock_full(void) {
  watchdog_lock_enable();
  watchdog_lock_timer_val();
  watchdog_lock_clk_src_power();
  watchdog_lock_clk_src();
}


x86 assembly (clang, -O0):
<watchdog_lock_full>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <watchdog_lock_enable@plt>
mov    $0x0,%al
call   1030 <watchdog_lock_timer_val@plt>
mov    $0x0,%al
call   1060 <watchdog_lock_clk_src_power@plt>
mov    $0x0,%al
call   1040 <watchdog_lock_clk_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<watchdog_lock_full>:
push   %rax
xor    %eax,%eax
call   1050 <watchdog_lock_enable@plt>
xor    %eax,%eax
call   1030 <watchdog_lock_timer_val@plt>
xor    %eax,%eax
call   1060 <watchdog_lock_clk_src_power@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <watchdog_lock_clk_src@plt>

LLVM IR (-O0):
define void @watchdog_lock_full() {
%1 = call i32 (...) @watchdog_lock_enable()
%2 = call i32 (...) @watchdog_lock_timer_val()
%3 = call i32 (...) @watchdog_lock_clk_src_power()
%4 = call i32 (...) @watchdog_lock_clk_src()
ret void
}

LLVM IR (-O2):
define void @watchdog_lock_full() {
%1 = tail call i32 (...) @watchdog_lock_enable()
%2 = tail call i32 (...) @watchdog_lock_timer_val()
%3 = tail call i32 (...) @watchdog_lock_clk_src_power()
%4 = tail call i32 (...) @watchdog_lock_clk_src()
ret void
}
int add() { return 0; }


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

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

LLVM IR (-O0):
define i32 @add() {
ret i32 0
}

LLVM IR (-O2):
define i32 @add() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
void randomSeed(int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<randomSeed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @randomSeed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int nl_sendgetaddr_do(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/, int);
int nl_sendgetaddrs4(int fd, uint32_t seq) {
  return nl_sendgetaddr_do(fd, seq, 0, 0, AF_INET, 1);
}


x86 assembly (clang, -O0):
<nl_sendgetaddrs4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ebd(%rip),%rax
mov    (%rax),%r8d
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %ecx,%edx
call   1030 <nl_sendgetaddr_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl_sendgetaddrs4>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%r8d
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r9d
jmp    1030 <nl_sendgetaddr_do@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @nl_sendgetaddrs4(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 = load i32, i32* @AF_INET
%8 = call i32 @nl_sendgetaddr_do(i32 %5, i32 %6, i32 0, i32 0, i32 %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @nl_sendgetaddrs4(i32 %0, i32 %1) {
%3 = load i32, i32* @AF_INET
%4 = tail call i32 @nl_sendgetaddr_do(i32 %0, i32 %1, i32 0, i32 0, i32 %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(int /*<<< orphan*/);
int /*<<< orphan*/ lua_getstring(int /*<<< orphan*/);
int /*<<< orphan*/ lua_lua2C(int);
void luaI_error(void) { lua_error(lua_getstring(lua_lua2C(1))); }


x86 assembly (clang, -O0):
<luaI_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1030 <lua_getstring@plt>
mov    %eax,%edi
call   1040 <lua_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_error>:
push   %rax
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1030 <lua_getstring@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_error@plt>

LLVM IR (-O0):
define void @luaI_error() {
%1 = call i32 @lua_lua2C(i32 1)
%2 = call i32 @lua_getstring(i32 %1)
%3 = call i32 @lua_error(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luaI_error() {
%1 = tail call i32 @lua_lua2C(i32 1)
%2 = tail call i32 @lua_getstring(i32 %1)
%3 = tail call i32 @lua_error(i32 %2)
ret void
}