xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ escape(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[] = "abc\tdef\tghi\njkl\tmno\tpqr\n";
  char t[1000];
  escape(s, t);
  printf("%s\n", t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1040 <escape@plt>
lea    -0x410(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
movups 0xeda(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <escape@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [25 x i8] c"abc\09def\09ghi\0Ajkl\09mno\09pqr\0A\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = alloca [1000 x i8]
%3 = bitcast [25 x i8]* %1 to i8*
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @escape(i8* %4, i8* %5)
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [25 x i8] c"abc\09def\09ghi\0Ajkl\09mno\09pqr\0A\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @escape(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
void quadd_task_sched_out(struct task_struct *prev, struct task_struct *next) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @quadd_task_sched_out(%struct.task_struct* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_y1l();
scalar_t__ y1l(long double);
void test_y1l(long double ld) {
  if (y1l(ld) != y1l(ld))
    link_failure_y1l();
}


x86 assembly (clang, -O0):
<test_y1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <y1l@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <y1l@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_y1l+0x43>
mov    $0x0,%al
call   1030 <link_failure_y1l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_y1l>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <y1l@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <y1l@plt>
cmp    %rax,%rbx
jne    1151 <test_y1l+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_y1l@plt>

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

LLVM IR (-O2):
define void @test_y1l(x86_fp80 %0) {
%2 = tail call i64 @y1l(x86_fp80 %0)
%3 = tail call i64 @y1l(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_y1l()
br label %7
7: ; preds = %5, %1
ret void
}
int mod_with_sub(int a, int b) {
  while (a > 0)
    a -= b;
  return a ? a + b : 0;
}


x86 assembly (clang, -O0):
<mod_with_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1124 <mod_with_sub+0x24>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    110a <mod_with_sub+0xa>
cmpl   $0x0,-0x4(%rbp)
je     113c <mod_with_sub+0x3c>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <mod_with_sub+0x46>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <mod_with_sub+0x46>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_with_sub>:
lea    (%rsi,%rdi,1),%ecx
lea    (%rdi,%rsi,2),%eax
cs nopw 0x0(%rax,%rax,1)
sub    %esi,%ecx
sub    %esi,%eax
test   %ecx,%ecx
jg     1110 <mod_with_sub+0x10>
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod_with_sub(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = icmp sgt i32 %4, 0
%6 = sub nsw i32 %4, %1
br i1 %5, label %3, label %7
7: ; preds = %3
%8 = icmp eq i32 %4, 0
%9 = add nsw i32 %4, %1
%10 = select i1 %8, i32 0, i32 %9
ret i32 %10
}
OP(op, ef) { RST(0x28); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x28,%edi
mov    $0x0,%al
call   1030 <RST@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
mov    $0x28,%edi
xor    %eax,%eax
jmp    1030 <RST@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 40)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 40)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
  int tm_min;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
main() {
  struct tm *fh;
  time_t segundos;
  time(&segundos);
  fh = localtime(&segundos);
  printf("%d horas, %d minutos\n", fh->tm_hour, fh->tm_min);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@.str = [22 x i8] c"%d horas, %d minutos\0A\00"
define i32 @main() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %1
%5 = load %struct.tm*, %struct.tm** %1
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.tm*, %struct.tm** %1
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
@.str = [22 x i8] c"%d horas, %d minutos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CTAI_Util_IQSort2(int *, int *, int /*<<< orphan*/, int);
void CTA_Util_IQSort2(int *list, int *indx, int n) {
  CTAI_Util_IQSort2(list, indx, 0, n - 1);
}


x86 assembly (clang, -O0):
<CTA_Util_IQSort2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <CTAI_Util_IQSort2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTA_Util_IQSort2>:
lea    -0x1(%rdx),%ecx
xor    %edx,%edx
jmp    1030 <CTAI_Util_IQSort2@plt>

LLVM IR (-O0):
define void @CTA_Util_IQSort2(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = call i32 @CTAI_Util_IQSort2(i32* %7, i32* %8, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @CTA_Util_IQSort2(i32* %0, i32* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @CTAI_Util_IQSort2(i32* %0, i32* %1, i32 0, i32 %4)
ret void
}
/* Variables and functions */
float glm_clamp(float, float, float);
__attribute((always_)) float glm_clamp_zo(float val) {
  return glm_clamp(val, 0.0f, 1.0f);
}


x86 assembly (clang, -O0):
<glm_clamp_zo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
movss  0xed3(%rip),%xmm2
call   1030 <glm_clamp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_clamp_zo>:
movss  0xee8(%rip),%xmm2
xorps  %xmm1,%xmm1
jmp    1030 <glm_clamp@plt>

LLVM IR (-O0):
define float @glm_clamp_zo(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @glm_clamp(float %3, float 0.000000e+00, float 1.000000e+00)
ret float %4
}

LLVM IR (-O2):
define float @glm_clamp_zo(float %0) {
%2 = tail call float @glm_clamp(float %0, float 0.000000e+00, float 1.000000e+00)
ret float %2
}
int indirect(int *x) {
  int v = 8;
  *x = v;
  return v;
}


x86 assembly (clang, -O0):
<indirect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect>:
movl   $0x8,(%rdi)
mov    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @indirect(i32* nocapture writeonly %0) {
store i32 8, i32* %0
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
__attribute__((visibility("default"))) __attribute__((no)) void crash() {
  char src[128];
  char dst[2];
  memcpy(src, dst, 8192);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x82(%rbp),%rsi
mov    $0x2000,%edx
call   1030 <memcpy@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash>:
sub    $0x98,%rsp
lea    0x10(%rsp),%rdi
lea    0xe(%rsp),%rsi
mov    $0x2000,%edx
call   1030 <memcpy@plt>
add    $0x98,%rsp
ret

LLVM IR (-O0):
define void @crash() {
%1 = alloca [128 x i8]
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 8192)
ret void
}

LLVM IR (-O2):
define void @crash() {
%1 = alloca [128 x i8]
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 8192)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fexists(char *f) {
  FILE *checkfile;
  checkfile = fopen(f, "r");
  if (checkfile) {
    fclose(checkfile);
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<fexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <fexists+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <fexists+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fexists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fexists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pr8641() {
  printf("%#x\n", 10);
  printf("%#X\n", 10);
}


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

x86 assembly (clang, -O2):
<pr8641>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0xa,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%#x\0A\00"
@.str.1 = [5 x i8] c"%#X\0A\00"
define void @pr8641() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
bool ia_bit64(uint64_t word, int i) { return (word & ((uint64_t)1 << i)) != 0; }


x86 assembly (clang, -O0):
<ia_bit64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ia_bit64>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ia_bit64(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ia_bit64(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int time_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t get_midnight_ut_ms(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((tv.tv_sec % 86400) * 1000 + tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<get_midnight_ut_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_midnight_ut_ms>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xffffffffc22e4507,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x10,%ecx
add    %edx,%ecx
imul   $0x15180,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_midnight_ut_ms() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = srem i32 %4, 86400
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_midnight_ut_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = srem i32 %5, 86400
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
__attribute__((always_)) int64_t clamp_int64_t(int64_t a, int64_t b,
                                               int64_t c) {
  return a < b ? b : a > c ? c : a;
}


x86 assembly (clang, -O0):
<clamp_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <clamp_int64_t+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp_int64_t+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1146 <clamp_int64_t+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp_int64_t+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_int64_t>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @clamp_int64_t(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %22
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i64, i64* %6
br label %20
18: ; preds = %12
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i64 [ %11, %10 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @clamp_int64_t(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_slice_buffer_slice_peek() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_slice_buffer_slice_peek>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_slice_buffer_slice_peek>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_slice_peek() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_slice_buffer_slice_peek() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int printer(int x, void *h) {
  printf((char *)h, x);
  printf("\n");
  return x * 2;
}


x86 assembly (clang, -O0):
<printer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printer>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @printer(i32 %0, i8* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %1, i32 %0)
%4 = tail call i32 @putchar(i32 10)
%5 = shl nsw i32 %0, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ps2_8042_send_command(int);
void ps2_8042_cpu_reset() { ps2_8042_send_command(0xFE); }


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

x86 assembly (clang, -O2):
<ps2_8042_cpu_reset>:
mov    $0xfe,%edi
jmp    1030 <ps2_8042_send_command@plt>

LLVM IR (-O0):
define void @ps2_8042_cpu_reset() {
%1 = call i32 @ps2_8042_send_command(i32 254)
ret void
}

LLVM IR (-O2):
define void @ps2_8042_cpu_reset() {
%1 = tail call i32 @ps2_8042_send_command(i32 254)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
void ck_do_nothing(void) {
  assert(0);
  exit(1);
}


x86 assembly (clang, -O0):
<ck_do_nothing>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ck_do_nothing>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @ck_do_nothing() {
%1 = call i32 @assert(i32 0)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @ck_do_nothing() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @exit(i32 1)
unreachable
}
void MOUSE_HideCursor(void) {}


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

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

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

LLVM IR (-O2):
define void @MOUSE_HideCursor() {
ret void
}
int isschar(char input_char) {
  if (input_char == 33)
    return 1;
  if (input_char == 35)
    return 1;
  if (input_char == 36)
    return 1;
  if (input_char == 63)
    return 1;
  if (input_char == 64)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isschar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x21,%eax
jne    1123 <isschar+0x23>
movl   $0x1,-0x4(%rbp)
jmp    118e <isschar+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x23,%eax
jne    113c <isschar+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    118e <isschar+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x24,%eax
jne    1155 <isschar+0x55>
movl   $0x1,-0x4(%rbp)
jmp    118e <isschar+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x3f,%eax
jne    116e <isschar+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    118e <isschar+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x40,%eax
jne    1187 <isschar+0x87>
movl   $0x1,-0x4(%rbp)
jmp    118e <isschar+0x8e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isschar>:
add    $0xdf,%dil
cmp    $0x1f,%dil
ja     111f <isschar+0x1f>
mov    $0x1,%eax
movzbl %dil,%ecx
mov    $0xc000000d,%edx
bt     %rcx,%rdx
jae    111f <isschar+0x1f>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isschar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 33
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %29
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 35
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %29
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 36
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %29
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 63
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %2
br label %29
23: ; preds = %18
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 64
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @isschar(i8 signext %0) {
switch i8 %0, label %2 [
i8 33, label %3
i8 35, label %3
i8 36, label %3
i8 63, label %3
i8 64, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n");
  printf("\tfsec-print file - disassemble seccomp filter\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [47 x i8] c"\09fsec-print file - disassemble seccomp filter\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [46 x i8] c"\09fsec-print file - disassemble seccomp filter\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret void
}
int ltcjack_connected(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ltcjack_connected() {
ret i32 0
}
void ADC_SAR_Seq_SAR_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_SAR_Seq_SAR_RestoreConfig() {
ret void
}
char *stpcpy(char *dst, const char *src) {
  while (*src != 0)
    *dst++ = *src++;
  *dst = 0;
  return dst;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <stpcpy+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <stpcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <stpcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <stpcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
int ret(a) {
  if (a == 2)
    return 1;
  if (a == 3)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<ret>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    111d <ret+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113a <ret+0x3a>
cmpl   $0x3,-0x8(%rbp)
jne    1133 <ret+0x33>
movl   $0x2,-0x4(%rbp)
jmp    113a <ret+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret>:
xor    %ecx,%ecx
cmp    $0x3,%edi
sete   %cl
add    %ecx,%ecx
cmp    $0x2,%edi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ret(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = select i1 %2, i32 2, i32 0
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ExtSelect(char *, char *, int /*<<< orphan*/);
void ExttZoneImportSelect(void) {
  ExtSelect("tZoneImport",
            "tZoneImport.uZone,tZoneImport.cZone,tZoneImport.uNSSet,"
            "tZoneImport.cHostmaster,tZoneImport.uSerial,tZoneImport.uExpire,"
            "tZoneImport.uRefresh,tZoneImport.uTTL,tZoneImport.uRetry,"
            "tZoneImport.uZoneTTL,tZoneImport.uMailServers,tZoneImport.uView,"
            "tZoneImport.cMainAddress,tZoneImport.uRegistrar,tZoneImport."
            "uSecondaryOnly,tZoneImport.cAllowTransfer,tZoneImport.cOptions,"
            "tZoneImport.uOwner,tZoneImport.uCreatedBy,tZoneImport."
            "uCreatedDate,tZoneImport.uModBy,tZoneImport.uModDate",
            0);
}


x86 assembly (clang, -O0):
<ExttZoneImportSelect>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
xor    %edx,%edx
call   1030 <ExtSelect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttZoneImportSelect>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ExtSelect@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"tZoneImport\00"
@.str.1 = [470 x i8] c"tZoneImport.uZone,tZoneImport.cZone,tZoneImport.uNSSet,tZoneImport.cHostmaster,tZoneImport.uSerial,tZoneImport.uExpire,tZoneImport.uRefresh,tZoneImport.uTTL,tZoneImport.uRetry,tZoneImport.uZoneTTL,tZoneImport.uMailServers,tZoneImport.uView,tZoneImport.cMainAddress,tZoneImport.uRegistrar,tZoneImport.uSecondaryOnly,tZoneImport.cAllowTransfer,tZoneImport.cOptions,tZoneImport.uOwner,tZoneImport.uCreatedBy,tZoneImport.uCreatedDate,tZoneImport.uModBy,tZoneImport.uModDate\00"
define void @ExttZoneImportSelect() {
%1 = call i32 @ExtSelect(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([470 x i8], [470 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"tZoneImport\00"
@.str.1 = [470 x i8] c"tZoneImport.uZone,tZoneImport.cZone,tZoneImport.uNSSet,tZoneImport.cHostmaster,tZoneImport.uSerial,tZoneImport.uExpire,tZoneImport.uRefresh,tZoneImport.uTTL,tZoneImport.uRetry,tZoneImport.uZoneTTL,tZoneImport.uMailServers,tZoneImport.uView,tZoneImport.cMainAddress,tZoneImport.uRegistrar,tZoneImport.uSecondaryOnly,tZoneImport.cAllowTransfer,tZoneImport.cOptions,tZoneImport.uOwner,tZoneImport.uCreatedBy,tZoneImport.uCreatedDate,tZoneImport.uModBy,tZoneImport.uModDate\00"
define void @ExttZoneImportSelect() {
%1 = tail call i32 @ExtSelect(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([470 x i8], [470 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
double tml_dr_vMinExt(double const *, int, int *);
double tml_dr_vMin(const double *vec, int n) {
  int index;
  return tml_dr_vMinExt(vec, n, &index);
}


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

x86 assembly (clang, -O2):
<tml_dr_vMin>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <tml_dr_vMinExt@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @tml_dr_vMin(double* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call double @tml_dr_vMinExt(double* %0, i32 %1, i32* %3)
ret double %5
}
int lcg_next(int seed, int range) {
  static int last;
  if (seed >= 0)
    last = seed;
  last = ((1277 * last) + 0) % 131072;
  return (last % range);
}


x86 assembly (clang, -O0):
<lcg_next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111d <lcg_next+0x1d>
mov    -0x4(%rbp),%eax
mov    %eax,0x2f07(%rip)
imul   $0x4fd,0x2efd(%rip),%eax
add    $0x0,%eax
mov    $0x20000,%ecx
cltd
idiv   %ecx
mov    %edx,0x2eec(%rip)
mov    0x2ee6(%rip),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg_next>:
test   %edi,%edi
jns    110a <lcg_next+0xa>
mov    0x2f1a(%rip),%edi
imul   $0x4fd,%edi,%eax
lea    0x1ffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffe0000,%ecx
sub    %ecx,%eax
mov    %eax,0x2efb(%rip)
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
@lcg_next.last = internal global i32 0
define i32 @lcg_next(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
store i32 %8, i32* @lcg_next.last
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* @lcg_next.last
%11 = mul nsw i32 1277, %10
%12 = add nsw i32 %11, 0
%13 = srem i32 %12, 131072
store i32 %13, i32* @lcg_next.last
%14 = load i32, i32* @lcg_next.last
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@lcg_next.last = internal unnamed_addr global i32 0
define i32 @lcg_next(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = load i32, i32* @lcg_next.last
%5 = select i1 %3, i32 %0, i32 %4
%6 = mul nsw i32 %5, 1277
%7 = srem i32 %6, 131072
store i32 %7, i32* @lcg_next.last
%8 = srem i32 %7, %1
ret i32 %8
}
void nseel_asm_2pdds_end(void) {}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @dumpck() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @dumpck() {
ret i32 undef
}
void test_non_identifiers() {
  int i, x;
#pragma omp target parallel for;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target parallel for private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target parallel for, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void use_with_delay(char **commands, int *delay, int number_of_command) {
  printf("asdasd\n");
  sleep(*delay);
  execvp(commands[0], commands + 1);
}


x86 assembly (clang, -O0):
<use_with_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
call   1040 <execvp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_with_delay>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%edi
call   1050 <sleep@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <execvp@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"asdasd\0A\00"
define void @use_with_delay(i8** %0, i32* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 @sleep(i32 %9)
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = call i32 @execvp(i8* %13, i8** %15)
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"asdasd\00"
define void @use_with_delay(i8** %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = tail call i32 @sleep(i32 %5)
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8*, i8** %0, i64 1
%9 = tail call i32 @execvp(i8* %7, i8** %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_stacktrace();
int /*<<< orphan*/ stderr;
void sighandle_sigsegv(int signo) {
  fprintf(stderr, "Segmentation fault in child:\n");
  print_stacktrace();
}


x86 assembly (clang, -O0):
<sighandle_sigsegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <print_stacktrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandle_sigsegv>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_stacktrace@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Segmentation fault in child:\0A\00"
define void @sighandle_sigsegv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @print_stacktrace()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Segmentation fault in child:\0A\00"
define void @sighandle_sigsegv(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @print_stacktrace()
ret void
}
void av_opt_eval_int64() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_eval_int64() {
ret void
}
/* Type definitions */
struct crypto_ablkcipher {
  int dummy;
};
struct chcr_context {
  int dummy;
};

/* Variables and functions */
struct chcr_context *crypto_ablkcipher_ctx(struct crypto_ablkcipher *);
struct chcr_context *c_ctx(struct crypto_ablkcipher *tfm) {
  return crypto_ablkcipher_ctx(tfm);
}


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

x86 assembly (clang, -O2):
<c_ctx>:
jmp    1030 <crypto_ablkcipher_ctx@plt>

LLVM IR (-O0):
%struct.chcr_context = type { i32 }
%struct.crypto_ablkcipher = type { i32 }
define %struct.chcr_context* @c_ctx(%struct.crypto_ablkcipher* %0) {
%2 = alloca %struct.crypto_ablkcipher*
store %struct.crypto_ablkcipher* %0, %struct.crypto_ablkcipher** %2
%3 = load %struct.crypto_ablkcipher*, %struct.crypto_ablkcipher** %2
%4 = call %struct.chcr_context* @crypto_ablkcipher_ctx(%struct.crypto_ablkcipher* %3)
ret %struct.chcr_context* %4
}

LLVM IR (-O2):
%struct.chcr_context = type { i32 }
%struct.crypto_ablkcipher = type { i32 }
define %struct.chcr_context* @c_ctx(%struct.crypto_ablkcipher* %0) {
%2 = tail call %struct.chcr_context* @crypto_ablkcipher_ctx(%struct.crypto_ablkcipher* %0)
ret %struct.chcr_context* %2
}
int log_destroy_func(const struct cmd_info *ci) { return 1; }


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

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

LLVM IR (-O0):
%struct.cmd_info = type opaque
define i32 @log_destroy_func(%struct.cmd_info* %0) {
%2 = alloca %struct.cmd_info*
store %struct.cmd_info* %0, %struct.cmd_info** %2
ret i32 1
}

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @log_destroy_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
int f(unsigned int cmd) {
  switch (cmd) {
  case (1UL | (unsigned long)4):
  ERROR:
    goto ERROR;
    break;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
jne    1122 <f+0x22>
jmp    1118 <f+0x18>
jmp    111d <f+0x1d>
jmp    111d <f+0x1d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x5,%edi
jne    1112 <f+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <f+0x10>
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 undef
}