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

/* Variables and functions */
int /*<<< orphan*/ internal_warning(char *);
struct symbol *symbol_generic(int /*<<< orphan*/);
int /*<<< orphan*/ symbol_get_name(struct symbol *);
struct symbol *struct_named_field(struct symbol *sym,
                                  const struct expression *const_expr) {
  internal_warning("struct_named_field not implemented");
  return symbol_generic(symbol_get_name(sym));
}


x86 assembly (clang, -O0):
<struct_named_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1040 <internal_warning@plt>
mov    -0x8(%rbp),%rdi
call   1050 <symbol_get_name@plt>
mov    %eax,%edi
call   1030 <symbol_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<struct_named_field>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <internal_warning@plt>
mov    %rbx,%rdi
call   1050 <symbol_get_name@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <symbol_generic@plt>

LLVM IR (-O0):
%struct.symbol = type { i32 }
%struct.expression = type { i32 }
@.str = [35 x i8] c"struct_named_field not implemented\00"
define %struct.symbol* @struct_named_field(%struct.symbol* %0, %struct.expression* %1) {
%3 = alloca %struct.symbol*
%4 = alloca %struct.expression*
store %struct.symbol* %0, %struct.symbol** %3
store %struct.expression* %1, %struct.expression** %4
%5 = call i32 @internal_warning(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.symbol*, %struct.symbol** %3
%7 = call i32 @symbol_get_name(%struct.symbol* %6)
%8 = call %struct.symbol* @symbol_generic(i32 %7)
ret %struct.symbol* %8
}

LLVM IR (-O2):
%struct.symbol = type { i32 }
%struct.expression = type { i32 }
@.str = [35 x i8] c"struct_named_field not implemented\00"
define %struct.symbol* @struct_named_field(%struct.symbol* %0, %struct.expression* nocapture readnone %1) {
%3 = tail call i32 @internal_warning(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @symbol_get_name(%struct.symbol* %0)
%5 = tail call %struct.symbol* @symbol_generic(i32 %4)
ret %struct.symbol* %5
}
int longcad(char *cad) {
  char *p = cad;
  while (*p != '\0')
    p++;
  return (p - cad);
}


x86 assembly (clang, -O0):
<longcad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <longcad+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <longcad+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longcad>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <longcad+0x10>
ret

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

LLVM IR (-O2):
define i32 @longcad(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_quaddobl_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(244, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_quaddobl_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf4,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_quaddobl_start_system>:
mov    $0xf4,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @write_quaddobl_start_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 244, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ move_cursor(int, int);
void motion(int x, int y) { move_cursor(x, y); }


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

x86 assembly (clang, -O2):
<motion>:
jmp    1030 <move_cursor@plt>

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

LLVM IR (-O2):
define void @motion(i32 %0, i32 %1) {
%3 = tail call i32 @move_cursor(i32 %0, i32 %1)
ret void
}
int isnan(double d) {
  union {
    unsigned long long l;
    double d;
  } u;
  u.d = d;
  return (u.l == 0x7FF8000000000000ll || u.l == 0x7FF0000000000000ll ||
          u.l == 0xfff8000000000000ll);
}


x86 assembly (clang, -O0):
<isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x1,%al
movabs $0x7ff8000000000000,%rcx
cmp    %rcx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1159 <isnan+0x59>
mov    $0x1,%al
movabs $0x7ff0000000000000,%rcx
cmp    %rcx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1159 <isnan+0x59>
movabs $0xfff8000000000000,%rax
cmp    %rax,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan>:
movq   %xmm0,%rax
movabs $0xfff7ffffffffffff,%rcx
ff f7 ff
mov    %rax,%rdx
and    %rcx,%rdx
movabs $0x7ff0000000000000,%rsi
cmp    %rsi,%rdx
sete   %dl
add    $0x1,%rcx
cmp    %rcx,%rax
sete   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i32 @isnan(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 9221120237041090560
br i1 %8, label %17, label %9
9: ; preds = %1
%10 = bitcast %union.anon* %3 to i64*
%11 = load i64, i64* %10
%12 = icmp eq i64 %11, 9218868437227405312
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = bitcast %union.anon* %3 to i64*
%15 = load i64, i64* %14
%16 = icmp eq i64 %15, -2251799813685248
br label %17
17: ; preds = %13, %9, %1
%18 = phi i1 [ true, %9 ], [ true, %1 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isnan(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, -2251799813685249
%4 = icmp eq i64 %3, 9218868437227405312
%5 = icmp eq i64 %2, -2251799813685248
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
int test_imm_FAint8_reg(signed char val) {
  return ((val) & (0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%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_FAint8_reg>:
test   $0xfa,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FAint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%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_FAint8_reg(i8 signext %0) {
%2 = and i8 %0, -6
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void **malloc(int);
int main() {
  void **ptr = malloc(sizeof *ptr);
  free(ptr);
  ptr = malloc(sizeof *ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8** @malloc(i32 8)
%2 = tail call i32 @free(i8** %1)
%3 = tail call i8** @malloc(i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hesh(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char arr[200];
  scanf("%s", arr);
  printf("%ld", hesh(arr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1040 <hesh@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <hesh@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @hesh(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hesh(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int compare(const void *a, const void *b) {
  const int *a1 = a;
  const int *b1 = b;
  return *a1 > *b1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct aFILE {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/);
ssize_t my_getline(char **lineptr, size_t *n, struct aFILE *fp) {
  return getline(lineptr, n, _get_actual_fp(fp));
}


x86 assembly (clang, -O0):
<my_getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <getline@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getline>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <_get_actual_fp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <getline@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_getline(i8** %0, i64* %1, %struct.aFILE* %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca %struct.aFILE*
store i8** %0, i8*** %4
store i64* %1, i64** %5
store %struct.aFILE* %2, %struct.aFILE** %6
%7 = load i8**, i8*** %4
%8 = load i64*, i64** %5
%9 = load %struct.aFILE*, %struct.aFILE** %6
%10 = call i32 @_get_actual_fp(%struct.aFILE* %9)
%11 = call i32 @getline(i8** %7, i64* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_getline(i8** %0, i64* %1, %struct.aFILE* %2) {
%4 = tail call i32 @_get_actual_fp(%struct.aFILE* %2)
%5 = tail call i32 @getline(i8** %0, i64* %1, i32 %4)
ret i32 %5
}
void rq_sched_info_arrive(struct rq *rq, unsigned long long delta) {}


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

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

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

LLVM IR (-O2):
%struct.rq = type opaque
define void @rq_sched_info_arrive(%struct.rq* nocapture %0, i64 %1) {
ret void
}
int lws_role_call_alpn_negotiated(struct lws *wsi, const char *alpn) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.lws = type opaque
define i32 @lws_role_call_alpn_negotiated(%struct.lws* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ SSIBaseValid(unsigned long);
void SSIDisable(unsigned long ulBase) {
  DEBUG_ASSERT(SSIBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<SSIDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDisable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
andq   $0xfffffffffffffffd,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @SSIDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @SSIBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, -3
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SSIDisable(i64 %0) {
%2 = tail call i32 @SSIBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vga_clear();
int /*<<< orphan*/ vga_write(int, int /*<<< orphan*/, char *, int);
void kmain(void) {
  vga_clear();
  vga_write(0, 0, "Hello World!", 0b101 | 0b1000);
  vga_write(1, 0, "https://github.com/JacisNonsense/x86-Baseline", 0b101);
  return;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <vga_clear@plt>
xor    %esi,%esi
lea    0xecc(%rip),%rdx
mov    $0xd,%ecx
mov    %esi,%edi
call   1030 <vga_write@plt>
mov    $0x1,%edi
xor    %esi,%esi
lea    0xebf(%rip),%rdx
mov    $0x5,%ecx
call   1030 <vga_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1040 <vga_clear@plt>
lea    0xed1(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    $0xd,%ecx
call   1030 <vga_write@plt>
lea    0xec9(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x5,%ecx
pop    %rax
jmp    1030 <vga_write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
@.str.1 = [46 x i8] c"https://github.com/JacisNonsense/x86-Baseline\00"
define void @kmain() {
%1 = call i32 (...) @vga_clear()
%2 = call i32 @vga_write(i32 0, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = call i32 @vga_write(i32 1, i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
@.str.1 = [46 x i8] c"https://github.com/JacisNonsense/x86-Baseline\00"
define void @kmain() {
%1 = tail call i32 (...) @vga_clear()
%2 = tail call i32 @vga_write(i32 0, i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = tail call i32 @vga_write(i32 1, i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
int main() {
  char c = 0xff;
  unsigned int d = 4;
  return c >= d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0xff,-0x5(%rbp)
movl   $0x4,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
cmp    -0xc(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i8 -1, i8* %2
store i32 4, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = load i32, i32* %3
%7 = icmp uge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void version(const char *progname) {
  printf("%s "
         "1.3.4"
         "\n",
         progname);
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s 1.3.4\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
intptr_t syscall6(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t,
                  int /*<<< orphan*/, int /*<<< orphan*/);
intptr_t syscall4(int nr, uintptr_t a1, uintptr_t a2, uintptr_t a3,
                  uintptr_t a4) {
  return syscall6(nr, a1, a2, a3, a4, 0, 0);
}


x86 assembly (clang, -O0):
<syscall4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <syscall6@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall4>:
push   %rax
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <syscall6@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @syscall4(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 @syscall6(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4, i32 0, i32 0)
ret i64 %6
}
void StateMachineAlternateUnattached(void) {}


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

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

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

LLVM IR (-O2):
define void @StateMachineAlternateUnattached() {
ret void
}
void fun(int var) { var = var + 1; }


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

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

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

LLVM IR (-O2):
define void @fun(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int const);
int strlen(char *);
void string_clear(char *str) {
  if (str) {
    const int len = strlen(str);
    if (len > 0)
      memset(str, 0, len);
  }
}


x86 assembly (clang, -O0):
<string_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <string_clear+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115b <string_clear+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
jmp    1160 <string_clear+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_clear>:
push   %rbx
test   %rdi,%rdi
je     113f <string_clear+0x1f>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    113f <string_clear+0x1f>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <memset@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @string_clear(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = call i32 @memset(i8* %12, i32 0, i32 %13)
br label %15
15: ; preds = %11, %6
br label %16
16: ; preds = %15, %1
ret void
}

LLVM IR (-O2):
define void @string_clear(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @memset(i8* %0, i32 0, i32 %4)
br label %8
8: ; preds = %3, %6, %1
ret void
}
__attribute__((always_)) void pm_runtime_get_noresume(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @pm_runtime_get_noresume(%struct.device* nocapture %0) {
ret void
}
int vaild_port(int port) { return (port > 0 && port <= 65535); }


x86 assembly (clang, -O0):
<vaild_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1123 <vaild_port+0x23>
cmpl   $0xffff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vaild_port>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0xffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @vaild_port(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 65535
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @vaild_port(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 65535
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int xprintf(char *str) {
  printf("%s", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<xprintf>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @xprintf(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int timespec_is_zero(const struct timespec *ts) {
  return ts->tv_sec == 0 && ts->tv_nsec == 0;
}


x86 assembly (clang, -O0):
<timespec_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jne    112a <timespec_is_zero+0x2a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_is_zero>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
je     1109 <timespec_is_zero+0x9>
ret
xor    %eax,%eax
cmpq   $0x0,0x8(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @timespec_is_zero(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @timespec_is_zero(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
unsigned __attribute__((noclone, no)) unsigned_value(void) {
  extern int rand();
  return rand();
}


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

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

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

LLVM IR (-O2):
define i32 @unsigned_value() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
void sort(int array[], int len) {
  if (len > 1)
    qsort(array, 0, len - 1);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    113a <sort+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <qsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x2,%esi
jl     1121 <sort+0x11>
mov    %esi,%edx
add    $0xffffffff,%edx
xor    %esi,%esi
jmp    1030 <qsort@plt>
ret

LLVM IR (-O0):
define void @sort(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 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 @qsort(i32* %8, i32 0, i32 %10)
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = tail call i32 @qsort(i32* %0, i32 0, i32 %5)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int test_signal_abort(void) {
  raise(SIGABRT);
  return 0;
}


x86 assembly (clang, -O0):
<test_signal_abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_signal_abort>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGABRT = global i32 0
define i32 @test_signal_abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
ret i32 0
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define i32 @test_signal_abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ die(char *, char *, size_t);
size_t fread(char *, int, size_t, int /*<<< orphan*/ *);
void xfread(FILE *file, char *filename, char *buffer, size_t len) {
  if (fread(buffer, sizeof(char), len, file) != len)
    die("File %s: error reading %d bytes\n", filename, len);
}


x86 assembly (clang, -O0):
<xfread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    -0x20(%rbp),%rax
je     116c <xfread+0x4c>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe99(%rip),%rdi
call   1040 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfread>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rsi,%r14
mov    %rdi,%rcx
mov    %rdx,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1030 <fread@plt>
cmp    %rbx,%rax
jne    114a <xfread+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeaf(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"File %s: error reading %d bytes\0A\00"
define void @xfread(i32* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i64, i64* %8
%11 = load i32*, i32** %5
%12 = call i64 @fread(i8* %9, i32 1, i64 %10, i32* %11)
%13 = load i64, i64* %8
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = load i8*, i8** %6
%17 = load i64, i64* %8
%18 = call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %16, i64 %17)
br label %19
19: ; preds = %15, %4
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"File %s: error reading %d bytes\0A\00"
define void @xfread(i32* nocapture %0, i8* %1, i8* nocapture %2, i64 %3) {
%5 = tail call i64 @fread(i8* %2, i32 1, i64 %3, i32* %0)
%6 = icmp eq i64 %5, %3
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err_sys(char *msg) {
  fprintf(stderr, msg);
  fflush(NULL);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err_sys>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 @fflush(i32* null)
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @err_sys(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 @fflush(i32* null)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int op_add(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @op_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_standard_Laurent_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(783, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_standard_Laurent_start_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x30f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_standard_Laurent_start_system_to_container>:
mov    $0x30f,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_standard_Laurent_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 783, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
bool retro_unserialize(const void *data, size_t size) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @retro_unserialize(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned int,
                         int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
unsigned int _filesize(FILE *fd) {
  unsigned int tmp, oldpos;
  oldpos = ftell(fd);
  fseek(fd, 0, SEEK_END);
  tmp = ftell(fd);
  fseek(fd, oldpos, SEEK_SET);
  return tmp;
}


x86 assembly (clang, -O0):
<_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_filesize>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %eax,%r14d
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @_filesize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = load i32, i32* %4
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i32 %13, i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @_filesize(i32* nocapture %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i32 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i32 %2, i32 %6)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("[sys] Extract info from image file\n");
  printf("require: start end infile\n");
  printf("opt: outfile\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"[sys] Extract info from image file\0A\00"
@.str.1 = [27 x i8] c"require: start end infile\0A\00"
@.str.2 = [14 x i8] c"opt: outfile\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [35 x i8] c"[sys] Extract info from image file\00"
@str.3 = [26 x i8] c"require: start end infile\00"
@str.4 = [13 x i8] c"opt: outfile\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instructions(void) {
  printf("Enter choice:\n"
         "1 to push a value on the stack\n"
         "2 to pop a value off the stack\n"
         "3 to end program\n");
}


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

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

LLVM IR (-O0):
@.str = [94 x i8] c"Enter choice:\0A1 to push a value on the stack\0A2 to pop a value off the stack\0A3 to end program\0A\00"
define void @instructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [93 x i8] c"Enter choice:\0A1 to push a value on the stack\0A2 to pop a value off the stack\0A3 to end program\00"
define void @instructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int numbtrop_dobldobl_size(int *nbt) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(721, nbt, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_dobldobl_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d1,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_dobldobl_size>:
mov    %rdi,%rsi
mov    $0x2d1,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @numbtrop_dobldobl_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 721, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @numbtrop_dobldobl_size(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 721, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ cyclic(unsigned char **);
int /*<<< orphan*/ sprintf(char *, char *);
int f_cyclic(int mode, unsigned char **sec, float *data, unsigned int ndata,
             char *inv_out, void **local) {
  if (mode >= 0) {
    sprintf(inv_out, cyclic(sec) ? "cyclic" : "not cyclic");
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_cyclic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     117b <f_cyclic+0x5b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cyclic@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rcx
lea    0xe99(%rip),%rsi
lea    0xe96(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
call   1040 <sprintf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_cyclic>:
test   %edi,%edi
js     114e <f_cyclic+0x2e>
push   %rbx
mov    %r8,%rbx
mov    %rsi,%rdi
call   1030 <cyclic@plt>
test   %rax,%rax
lea    0xec6(%rip),%rax
lea    0xec3(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"cyclic\00"
@.str.1 = [11 x i8] c"not cyclic\00"
define i32 @f_cyclic(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%13 = load i32, i32* %7
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %6
%16 = load i8*, i8** %11
%17 = load i8**, i8*** %8
%18 = call i64 @cyclic(i8** %17)
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%22 = call i32 @sprintf(i8* %16, i8* %21)
br label %23
23: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"cyclic\00"
@.str.1 = [11 x i8] c"not cyclic\00"
define i32 @f_cyclic(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture writeonly %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %13
8: ; preds = %6
%9 = tail call i64 @cyclic(i8** %1)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) %11)
br label %13
13: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ startParagraph(char *, int);
void CmdAnd(int code) { startParagraph("author", 2); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"author\00"
define void @CmdAnd(i32 %0) {
%2 = tail call i32 @startParagraph(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}