xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char *, char);
char *stripbaseext(char *path) {
  char *ext = strrchr(path, '.');
  if (ext == NULL || ext == path) {
    return path;
  }
  ext[0] = '\0';
  return path;
}


x86 assembly (clang, -O0):
<stripbaseext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <stripbaseext+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1154 <stripbaseext+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <stripbaseext+0x53>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripbaseext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     112b <stripbaseext+0x1b>
cmp    %rbx,%rax
je     112b <stripbaseext+0x1b>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @stripbaseext(i8* returned %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 0, i8* %2
br label %7
7: ; preds = %1, %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void panic(char *reason) {
  printf("\n%s\n", reason);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
define void @panic(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double double_mul(double, double);
int int_add(int, int);
int /*<<< orphan*/ printf(char *, double);
main() {
  printf("%d\n", int_add(5, 4));
  printf("%g\n", double_mul(3.14, 2.0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x4,%esi
call   1040 <int_add@plt>
cvtsi2sd %eax,%xmm0
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea5(%rip),%xmm0
movsd  0xea5(%rip),%xmm1
call   1050 <double_mul@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x4,%esi
call   1040 <int_add@plt>
cvtsi2sd %eax,%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea8(%rip),%xmm0
movsd  0xea8(%rip),%xmm1
call   1050 <double_mul@plt>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = call i32 @int_add(i32 5, i32 4)
%2 = sitofp i32 %1 to double
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @double_mul(double 3.140000e+00, double 2.000000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = tail call i32 @int_add(i32 5, i32 4)
%2 = sitofp i32 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call double @double_mul(double 3.140000e+00, double 2.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t toRep16(uint16_t x) { return x; }


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

x86 assembly (clang, -O2):
<toRep16>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @toRep16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ isdigit(char const);
int foo(const char *s) {
  int success = 1;
  const char *p = s + 2;
  if (!isdigit(*p))
    success = 0;
  while (isdigit(*p))
    ++p;
  return success;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    114c <foo+0x3c>
movl   $0x0,-0xc(%rbp)
jmp    1151 <foo+0x41>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1178 <foo+0x68>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <foo+0x41>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl 0x2(%rdi),%edi
add    $0x2,%rbx
call   1030 <isdigit@plt>
mov    %rax,%r14
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <foo+0x20>
xor    %eax,%eax
test   %r14,%r14
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @foo(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = tail call i64 @isdigit(i8 signext %3)
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %2, %1 ], [ %10, %5 ]
%7 = load i8, i8* %6
%8 = tail call i64 @isdigit(i8 signext %7)
%9 = icmp eq i64 %8, 0
%10 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %9, label %11, label %5
11: ; preds = %5
%12 = icmp ne i64 %4, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
int _min(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @_min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ pr_mask(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char const *);
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
void pr_procmask(char const *tip) {
  sigset_t mask;
  if (sigprocmask(0, NULL, &mask) < 0)
    printf("sigprocmask failed, errno %d", errno);
  else {
    puts(tip);
    pr_mask(&mask);
  }
}


x86 assembly (clang, -O0):
<pr_procmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
jge    117f <pr_procmask+0x3f>
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
lea    0xe8b(%rip),%rdi
call   1060 <printf@plt>
jmp    1191 <pr_procmask+0x51>
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
lea    -0xc(%rbp),%rdi
call   1050 <pr_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_procmask>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <sigprocmask@plt>
test   %rax,%rax
js     116f <pr_procmask+0x2f>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rdi
call   1050 <pr_mask@plt>
jmp    1184 <pr_procmask+0x44>
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
lea    0xe81(%rip),%rdi
call   1060 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"sigprocmask failed, errno %d\00"
@errno = global i32 0
define void @pr_procmask(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i64 @sigprocmask(i32 0, i32* null, i32* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @puts(i8* %10)
%12 = call i32 @pr_mask(i32* %3)
br label %13
13: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"sigprocmask failed, errno %d\00"
@errno = global i32 0
define void @pr_procmask(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @sigprocmask(i32 0, i32* null, i32* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %1
%10 = call i32 @puts(i8* dereferenceable(1) %0)
%11 = call i32 @pr_mask(i32* %2)
br label %12
12: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_key_valid() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_key_valid"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_proplist_key_valid\00"
define i32 @pa_proplist_key_valid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ enter(char *);
char nextsymbol();
int /*<<< orphan*/ out();
int /*<<< orphan*/ pT();
int /*<<< orphan*/ pplus();
pE() {
  enter("pE");
  pT();
  while (nextsymbol() == '+') {
    pplus();
    pT();
  }
  out();
}


x86 assembly (clang, -O0):
<pE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1050 <enter@plt>
mov    $0x0,%al
call   1040 <pT@plt>
mov    $0x0,%al
call   1030 <nextsymbol@plt>
movsbl %al,%eax
cmp    $0x2b,%eax
jne    1191 <pE+0x41>
mov    $0x0,%al
call   1060 <pplus@plt>
mov    $0x0,%al
call   1040 <pT@plt>
jmp    116b <pE+0x1b>
mov    $0x0,%al
call   1070 <out@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pE>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <enter@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <pT@plt>
xor    %eax,%eax
call   1030 <nextsymbol@plt>
cmp    $0x2b,%al
jne    117b <pE+0x2b>
xor    %eax,%eax
call   1060 <pplus@plt>
jmp    1160 <pE+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1070 <out@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"pE\00"
define i32 @pE() {
%1 = alloca i32
%2 = call i32 @enter(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @pT()
br label %4
4: ; preds = %8, %0
%5 = call signext i8 (...) @nextsymbol()
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 43
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = call i32 (...) @pplus()
%10 = call i32 (...) @pT()
br label %4
11: ; preds = %4
%12 = call i32 (...) @out()
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"pE\00"
define i32 @pE() {
%1 = tail call i32 @enter(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @pT()
%3 = tail call signext i8 (...) @nextsymbol()
%4 = icmp eq i8 %3, 43
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = tail call i32 (...) @pplus()
%7 = tail call i32 (...) @pT()
%8 = tail call signext i8 (...) @nextsymbol()
%9 = icmp eq i8 %8, 43
br i1 %9, label %5, label %10
10: ; preds = %5, %0
%11 = tail call i32 (...) @out()
ret i32 undef
}
int isspace(int c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ smm_free(void *);
int csc_cli_qopt_close(void *ropt) {
  smm_free(ropt);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @csc_cli_qopt_close(i8* %0) {
%2 = tail call i32 @smm_free(i8* %0)
ret i32 0
}
int main(int argc, char *argv[]) {
  int k = 1;
#pragma omp parallel private(k)
  {
    k = 1;
#pragma omp parallel firstprivate(k)
    { k = 2; }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x14(%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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 1, i32* %6
store i32 2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ foo();
int main() {
  alarm(60);
  while (1)
    foo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3c,%edi
call   1030 <alarm@plt>
mov    $0x0,%al
call   1040 <foo@plt>
jmp    1139 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3c,%edi
call   1030 <alarm@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <foo@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alarm(i32 60)
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @foo()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @alarm(i32 60)
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @foo()
br label %2
}
void sem_post() {}


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

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

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

LLVM IR (-O2):
define void @sem_post() {
ret void
}
int isBetween(int value, int endPointOne, int endPointTwo) {
  if (endPointOne < value && value < endPointTwo)
    return 1;
  if (endPointTwo < value && value < endPointOne)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isBetween>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1131 <isBetween+0x31>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1131 <isBetween+0x31>
movl   $0x1,-0x4(%rbp)
jmp    115c <isBetween+0x5c>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1155 <isBetween+0x55>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <isBetween+0x55>
movl   $0x1,-0x4(%rbp)
jmp    115c <isBetween+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBetween>:
cmp    %edi,%esi
setl   %al
cmp    %edx,%edi
setl   %cl
and    %al,%cl
cmp    %edi,%edx
setl   %al
cmp    %esi,%edi
setl   %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @isBetween(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp slt i32 %0, %2
%6 = and i1 %4, %5
%7 = icmp slt i32 %2, %0
%8 = icmp slt i32 %0, %1
%9 = and i1 %8, %7
%10 = or i1 %6, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long atoll(char *);
int main() {
  if (atoll("3463456234575463723") != 3463456234575463723L) {
    abort();
  }
  if (atoll("8903427589123480") != 8903427589123480L) {
    abort();
  }
  if (atoll("9012783012740234983") != 9012783012740234983L) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <atoll@plt>
movabs $0x3010ab185cfb852b,%rcx
ab 10 30
cmp    %rcx,%rax
je     114a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xec3(%rip),%rdi
call   1040 <atoll@plt>
movabs $0x1fa19ec6bbad98,%rcx
cmp    %rcx,%rax
je     1170 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xeae(%rip),%rdi
call   1040 <atoll@plt>
movabs $0x7d13d665f80e7ee7,%rcx
d6 13 7d
cmp    %rcx,%rax
je     1196 <main+0x76>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"3463456234575463723\00"
@.str.1 = [17 x i8] c"8903427589123480\00"
@.str.2 = [20 x i8] c"9012783012740234983\00"
define i32 @main() {
%1 = call i64 @atoll(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 3463456234575463723
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = call i64 @atoll(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 8903427589123480
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = call i64 @atoll(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp ne i64 %11, 9012783012740234983
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void Delay(int nCnt) {
  int volatile loop;
  for (loop = 0; loop < nCnt * 10; loop++)
    ;
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0xa,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1130 <Delay+0x30>
jmp    1122 <Delay+0x22>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Delay+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
movl   $0x0,-0x4(%rsp)
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
nopl   (%rax)
mov    -0x4(%rsp),%ecx
cmp    %eax,%ecx
jge    111f <Delay+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <Delay+0x10>
ret

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

LLVM IR (-O2):
define void @Delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = mul nsw i32 %0, 10
%5 = load volatile i32, i32* %2
%6 = icmp slt i32 %5, %4
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %2
%10 = load volatile i32, i32* %2
%11 = icmp slt i32 %10, %4
br i1 %11, label %7, label %12
12: ; preds = %7, %1
ret void
}
int complet(const char *k, const char *str) {
  while (*k) {
    if (*k != *str)
      return (*k > *str ? 1 : -1);
    k++, str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<complet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1171 <complet+0x71>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1154 <complet+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <complet+0x78>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <complet+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complet>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <complet+0x22>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
jne    1125 <complet+0x25>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <complet+0x10>
xor    %eax,%eax
ret
setg   %al
movzbl %al,%eax
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @complet(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %28, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %33
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %13, %16
br i1 %17, label %18, label %28
18: ; preds = %10
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %5
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp sgt i32 %21, %24
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 1, i32 -1
store i32 %27, i32* %3
br label %34
28: ; preds = %10
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %4
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %5
br label %6
33: ; preds = %6
store i32 0, i32* %3
br label %34
34: ; preds = %33, %18
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @complet(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %14
%6 = phi i8 [ %17, %14 ], [ %3, %2 ]
%7 = phi i8* [ %16, %14 ], [ %1, %2 ]
%8 = phi i8* [ %15, %14 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = icmp sgt i8 %6, %9
%13 = select i1 %12, i32 1, i32 -1
br label %19
14: ; preds = %5
%15 = getelementptr inbounds i8, i8* %8, i64 1
%16 = getelementptr inbounds i8, i8* %7, i64 1
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %14, %2, %11
%20 = phi i32 [ %13, %11 ], [ 0, %2 ], [ 0, %14 ]
ret i32 %20
}
int cpusupport_x86_sse2_detect_CPUSUPPORT_X86_SSE2(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @cpusupport_x86_sse2_detect_CPUSUPPORT_X86_SSE2() {
ret i32 0
}
int get_distance(int p1, int p2) {
  return (p2 - p1 > 0) ? (p2 - p1) : (p1 - p2);
}


x86 assembly (clang, -O0):
<get_distance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
jle    1127 <get_distance+0x27>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <get_distance+0x30>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_distance>:
sub    %edi,%esi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_distance(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 false)
ret i32 %4
}
void defaultFatalErrorFunc(void) {}


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

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

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

LLVM IR (-O2):
define void @defaultFatalErrorFunc() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void AESDMADisable(uint32_t ui32Base, uint32_t ui32Flags) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000084))) &= ~ui32Flags;
}


x86 assembly (clang, -O0):
<AESDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x84(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x84(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESDMADisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x84(%rcx)
ret

LLVM IR (-O0):
define void @AESDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 132
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @AESDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 132
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x9f() {
  Assert_real((isgraph(159) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              800, ("isgraph should be 0 for 0x9f"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x9f\00"
define void @t_isgraph_0x9f() {
%1 = tail call i64 @isgraph(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __IO_disable_interrupts() {}


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

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

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

LLVM IR (-O2):
define void @__IO_disable_interrupts() {
ret void
}
/* Variables and functions */
int atoi(char *);
int get_value(char *card_name) {
  switch (card_name[0]) {
  case 'K':
  case 'Q':
  case 'J':
    return 10;
  case 'A':
    return 11;
  case 'X':
    return -1;
  default:
    return atoi(card_name);
  }
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x17,%eax
ja     116d <get_value+0x5d>
mov    -0x18(%rbp),%rax
lea    0xec0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    1179 <get_value+0x69>
movl   $0xb,-0x4(%rbp)
jmp    1179 <get_value+0x69>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <get_value+0x69>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
movsbl (%rdi),%ecx
add    $0xffffffbf,%ecx
cmp    $0x17,%ecx
ja     1137 <get_value+0x27>
mov    $0xa,%eax
lea    0xed9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
mov    $0xb,%eax
ret
jmp    1030 <atoi@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_value(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %11 [
i32 75, label %8
i32 81, label %8
i32 74, label %8
i32 65, label %9
i32 88, label %10
]
8: ; preds = %1, %1, %1
store i32 10, i32* %2
br label %14
9: ; preds = %1
store i32 11, i32* %2
br label %14
10: ; preds = %1
store i32 -1, i32* %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10, %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_value(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %6 [
i32 75, label %8
i32 81, label %8
i32 74, label %8
i32 65, label %4
i32 88, label %5
]
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = tail call i32 @atoi(i8* %0)
br label %8
8: ; preds = %1, %1, %1, %6, %5, %4
%9 = phi i32 [ %7, %6 ], [ -1, %5 ], [ 11, %4 ], [ 10, %1 ], [ 10, %1 ], [ 10, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ RAND_bytes(int /*<<< orphan*/ *, size_t);
int random_bytes_generate(uint8_t *id, size_t len) {
  if (!RAND_bytes(id, len)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<random_bytes_generate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <RAND_bytes@plt>
cmp    $0x0,%eax
jne    1142 <random_bytes_generate+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <random_bytes_generate+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bytes_generate>:
push   %rax
call   1030 <RAND_bytes@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @random_bytes_generate(i32* %0, i64 %1) {
%3 = tail call i32 @RAND_bytes(i32* %0, i64 %1)
%4 = icmp eq i32 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void do_usage_if(int b, int line) {
  const static char *eeprog_usage =
      "I2C-24C32(4096 bytes) Read/Write Program, ONLY FOR TEST!\n"
      "RONGXIN HUICO Tech Co.,Ltd\n";
  if (!b)
    return;
  fprintf(stderr, "%s\n[line %d]\n", eeprog_usage, line);
  exit(1);
}


x86 assembly (clang, -O0):
<do_usage_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113e <do_usage_if+0x1e>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2ee2(%rip),%rdx
mov    -0x8(%rbp),%ecx
lea    0xefd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_usage_if>:
test   %edi,%edi
jne    1125 <do_usage_if+0x5>
ret
push   %rax
mov    %esi,%ecx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xf1d(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@do_usage_if.eeprog_usage = internal global i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i32 0, i32 0)
@.str = [85 x i8] c"I2C-24C32(4096 bytes) Read/Write Program, ONLY FOR TEST!\0ARONGXIN HUICO Tech Co.,Ltd\0A\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"%s\0A[line %d]\0A\00"
define void @do_usage_if(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 ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** @do_usage_if.eeprog_usage
%11 = load i32, i32* %4
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [85 x i8] c"I2C-24C32(4096 bytes) Read/Write Program, ONLY FOR TEST!\0ARONGXIN HUICO Tech Co.,Ltd\0A\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"%s\0A[line %d]\0A\00"
define void @do_usage_if(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ gif_stuff(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ plintf(char *, int);
void add_ani_gif(Window win, FILE *fp, int count) {
  plintf("Frame %d \n", count);
  if (count == 0)
    gif_stuff(win, fp, 3);
  else
    gif_stuff(win, fp, 4);
}


x86 assembly (clang, -O0):
<add_ani_gif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1040 <plintf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1161 <add_ani_gif+0x41>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <gif_stuff@plt>
jmp    1172 <add_ani_gif+0x52>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <gif_stuff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_ani_gif>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xece(%rip),%rdi
mov    %edx,%esi
call   1040 <plintf@plt>
cmp    $0x1,%ebx
mov    $0x4,%edx
sbb    $0x0,%edx
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <gif_stuff@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Frame %d \0A\00"
define void @add_ani_gif(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* %6
%8 = call i32 @plintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32*, i32** %5
%14 = call i32 @gif_stuff(i32 %12, i32* %13, i32 3)
br label %19
15: ; preds = %3
%16 = load i32, i32* %4
%17 = load i32*, i32** %5
%18 = call i32 @gif_stuff(i32 %16, i32* %17, i32 4)
br label %19
19: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Frame %d \0A\00"
define void @add_ani_gif(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @plintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i32 3, i32 4
%7 = tail call i32 @gif_stuff(i32 %0, i32* %1, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_fibonacci_loop(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int fab() {
  int i = 0;
  for (i = 0; i < 100; i++) {
    printf("%d: %lld\n", i, get_fibonacci_loop(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<fab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    116d <fab+0x4d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_fibonacci_loop@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <fab+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fab>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <get_fibonacci_loop@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1130 <fab+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d: %lld\0A\00"
define i32 @fab() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @get_fibonacci_loop(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CyclicBitBuffer_resetRead();
int /*<<< orphan*/ CyclicBitBuffer_resetWrite();
void CyclicBitBuffer_reset(void) {
  CyclicBitBuffer_resetRead();
  CyclicBitBuffer_resetWrite();
}


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

x86 assembly (clang, -O2):
<CyclicBitBuffer_reset>:
push   %rax
xor    %eax,%eax
call   1040 <CyclicBitBuffer_resetRead@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CyclicBitBuffer_resetWrite@plt>

LLVM IR (-O0):
define void @CyclicBitBuffer_reset() {
%1 = call i32 (...) @CyclicBitBuffer_resetRead()
%2 = call i32 (...) @CyclicBitBuffer_resetWrite()
ret void
}

LLVM IR (-O2):
define void @CyclicBitBuffer_reset() {
%1 = tail call i32 (...) @CyclicBitBuffer_resetRead()
%2 = tail call i32 (...) @CyclicBitBuffer_resetWrite()
ret void
}
/* Variables and functions */
int hoare_partition(int *, int, int);
void quicksort(int A[], int p, int r) {
  if (p < r - 1) {
    int q = hoare_partition(A, p, r);
    quicksort(A, p, q + 1);
    quicksort(A, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1179 <quicksort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <hoare_partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1030 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
lea    -0x1(%r14),%r12d
cmp    %esi,%r12d
jle    1165 <quicksort+0x45>
mov    %esi,%ebx
mov    %rdi,%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1040 <hoare_partition@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <quicksort@plt>
mov    %ebp,%ebx
cmp    %ebp,%r12d
jg     1140 <quicksort+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %1, %3 ]
%8 = tail call i32 @hoare_partition(i32* %0, i32 %7, i32 %2)
%9 = add nsw i32 %8, 1
tail call void @quicksort(i32* %0, i32 %7, i32 %9)
%10 = icmp sgt i32 %4, %9
br i1 %10, label %6, label %11
11: ; preds = %6, %3
ret void
}
int test_imm_FAint32_mem(int *val) {
  return ((*val) & (0xFA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FAint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 250
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void aes_reset(void) {}


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

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

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

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