xunge/DecIR huggingface dataset:
void i915_debugfs_describe_obj(struct seq_file *m,
                               struct drm_i915_gem_object *obj) {}


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

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

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

LLVM IR (-O2):
%struct.seq_file = type opaque
%struct.drm_i915_gem_object = type opaque
define void @i915_debugfs_describe_obj(%struct.seq_file* nocapture %0, %struct.drm_i915_gem_object* nocapture %1) {
ret void
}
int vect_pow2(int x) {
  int i, res = 1;
  for (i = 0; i < x; i++)
    res *= 2;
  return res;
}


x86 assembly (clang, -O0):
<vect_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <vect_pow2+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <vect_pow2+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vect_pow2>:
test   %edi,%edi
jle    1118 <vect_pow2+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <vect_pow2+0x1e>
mov    $0x1,%eax
jmp    1138 <vect_pow2+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <vect_pow2+0x30>
test   %ecx,%ecx
je     1147 <vect_pow2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <vect_pow2+0x40>
ret

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

LLVM IR (-O2):
define i32 @vect_pow2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
void logic32(void) {}


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

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

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

LLVM IR (-O2):
define void @logic32() {
ret void
}
int xg_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xg_init() {
ret i32 0
}
int f(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRSELECTPALETTE_print(const char *contents) {
  core3_print("U_EMRSELECTPALETTE", "ihPal:", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSELECTPALETTE_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <core3_print@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"U_EMRSELECTPALETTE\00"
@.str.1 = [7 x i8] c"ihPal:\00"
define void @U_EMRSELECTPALETTE_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core3_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"U_EMRSELECTPALETTE\00"
@.str.1 = [7 x i8] c"ihPal:\00"
define void @U_EMRSELECTPALETTE_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ rozofs_get_service_port_geomgr_diag();
uint16_t rozofs_get_service_port_geocli_diag(int idx) {
  return rozofs_get_service_port_geomgr_diag() + 1 + (3 * idx);
}


x86 assembly (clang, -O0):
<rozofs_get_service_port_geocli_diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rozofs_get_service_port_geomgr_diag@plt>
add    $0x1,%rax
imul   $0x3,-0x4(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rozofs_get_service_port_geocli_diag>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rozofs_get_service_port_geomgr_diag@plt>
lea    (%rbx,%rbx,2),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rozofs_get_service_port_geocli_diag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @rozofs_get_service_port_geomgr_diag()
%4 = add nsw i64 %3, 1
%5 = load i32, i32* %2
%6 = mul nsw i32 3, %5
%7 = sext i32 %6 to i64
%8 = add nsw i64 %4, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @rozofs_get_service_port_geocli_diag(i32 %0) {
%2 = tail call i64 (...) @rozofs_get_service_port_geomgr_diag()
%3 = mul nsw i32 %0, 3
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, 1
%6 = add i64 %5, %2
ret i64 %6
}
void slab_Assert(const char *file, int line) {
  file = file;
  line = line;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<slab_Assert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <slab_Assert+0x19>

x86 assembly (clang, -O2):
<slab_Assert>:
jmp    1100 <slab_Assert>

LLVM IR (-O0):
define void @slab_Assert(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
store i8* %5, i8** %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
br label %7
7: ; preds = %2, %7
br label %7
}

LLVM IR (-O2):
define void @slab_Assert(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ isarrow();
int /*<<< orphan*/ printf(char *);
int main() {
  while (1) {
    printf("@> ");
    isarrow();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <isarrow@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <isarrow@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"@> \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @isarrow()
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"@> \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @isarrow()
br label %1
}
char byteline(int start, int end) {
  return (0xff << start) & ~(0xff << (end + 1));
}


x86 assembly (clang, -O0):
<byteline>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xff,%eax
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0xff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteline>:
mov    %edi,%ecx
mov    $0xff,%eax
mov    $0xff,%edx
shl    %cl,%edx
lea    0x1(%rsi),%ecx
shl    %cl,%eax
not    %eax
and    %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @byteline(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 = shl i32 255, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = shl i32 255, %8
%10 = xor i32 %9, -1
%11 = and i32 %6, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @byteline(i32 %0, i32 %1) {
%3 = shl i32 255, %0
%4 = add nsw i32 %1, 1
%5 = shl i32 255, %4
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
void caller_1_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_2_1_1_1() {
ret void
}
/* Variables and functions */
char *strncpy(char *, char *, int);
char *t14(char *x) { return strncpy(x, "foo", 3); }


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

x86 assembly (clang, -O2):
<t14>:
lea    0xee9(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @t14(i8* %0) {
%2 = tail call i8* @strncpy(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i8* %2
}
int eachResult(char *out, struct sockaddr_in *addr) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.sockaddr_in = type opaque
define i32 @eachResult(i8* nocapture readnone %0, %struct.sockaddr_in* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printarr(int *arr, int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printarr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printarr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printarr+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printarr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printarr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printarr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  char a[1000];
  double b, c;
  gets(a);
  scanf("%lf %lf", &b, &c);
  printf("TOTAL = R$ %.2lf\n", b + .15 * c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1040 <gets@plt>
lea    0xeb3(%rip),%rdi
lea    -0x3f8(%rbp),%rsi
lea    -0x400(%rbp),%rdx
call   1050 <scanf@plt>
movsd  -0x3f8(%rbp),%xmm1
ff
movsd  -0x400(%rbp),%xmm0
ff
movsd  0xe80(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x3f8,%rsp
lea    0x10(%rsp),%rdi
call   1040 <gets@plt>
lea    0xec0(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xe9e(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f8,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [18 x i8] c"TOTAL = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %3, double* %4)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call double @llvm.fmuladd.f64(double 1.500000e-01, double %9, double %8)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [18 x i8] c"TOTAL = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca double
%3 = alloca double
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @gets(i8* %4)
%8 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %10, double 1.500000e-01, double %9)
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}
/* Type definitions */
struct btf_type {
  int /*<<< orphan*/ info;
};

/* Variables and functions */
int BTF_INFO_KFLAG(int /*<<< orphan*/);
bool btf_kflag(const struct btf_type *t) { return BTF_INFO_KFLAG(t->info); }


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

x86 assembly (clang, -O2):
<btf_kflag>:
mov    (%rdi),%edi
jmp    1030 <BTF_INFO_KFLAG@plt>

LLVM IR (-O0):
%struct.btf_type = type { i32 }
define i32 @btf_kflag(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @BTF_INFO_KFLAG(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
define i32 @btf_kflag(%struct.btf_type* nocapture %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @BTF_INFO_KFLAG(i32 %3)
ret i32 %4
}
int expire_bounces(long old) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @expire_bounces(i64 %0) {
ret i32 0
}
void BN_mod_inverse(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_inverse() {
ret void
}
void gp_log_data(const char *domain, const char *data, unsigned int size,
                 const char *format, ...) {}


x86 assembly (clang, -O0):
<gp_log_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gp_log_data(i8* %0, i8* %1, i32 %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @gp_log_data(i8* nocapture %0, i8* nocapture %1, i32 %2, i8* nocapture %3, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
void killed(int signum) {
  cleanup();
  exit(1);
}


x86 assembly (clang, -O0):
<killed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cleanup@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
define void @killed(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ addmac();
void dodefine(void) { addmac(); }


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

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

LLVM IR (-O0):
define void @dodefine() {
%1 = call i32 (...) @addmac()
ret void
}

LLVM IR (-O2):
define void @dodefine() {
%1 = tail call i32 (...) @addmac()
ret void
}
void simple_overflow_Bad() { auto x = (85 * 0xFFFFFFFF / 100); }


x86 assembly (clang, -O0):
<simple_overflow_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x28f5c28,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @simple_overflow_Bad() {
%1 = alloca i32
store i32 42949672, i32* %1
ret void
}

LLVM IR (-O2):
define void @simple_overflow_Bad() {
ret void
}
main() {
  int x, y, d;
  while (x > 0 && y > 0 && d > 0) {
    _Bool c = nondet_bool();
    if (c) {
      x = x - 1;
      d = nondet_int();
    } else {
      x = nondet_int();
      y = y - 1;
      d = d - 1;
    }
  }
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jle    1167 <main+0x37>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x12(%rbp)
jle    1167 <main+0x37>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1177 <main+0x47>
jmp    11cc <main+0x9c>
mov    $0x0,%al
call   1050 <nondet_bool@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x11(%rbp)
testb  $0x1,-0x11(%rbp)
je     11ab <main+0x7b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x10(%rbp)
jmp    11c7 <main+0x97>
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <main+0xf>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
br label %6
6: ; preds = %33, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br label %15
15: ; preds = %12, %9, %6
%16 = phi i1 [ false, %9 ], [ false, %6 ], [ %14, %12 ]
br i1 %16, label %17, label %34
17: ; preds = %15
%18 = call i32 (...) @nondet_bool()
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i8
store i8 %20, i8* %5
%21 = load i8, i8* %5
%22 = trunc i8 %21 to i1
br i1 %22, label %23, label %27
23: ; preds = %17
%24 = load i32, i32* %2
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %2
%26 = call i32 (...) @nondet_int()
store i32 %26, i32* %4
br label %33
27: ; preds = %17
%28 = call i32 (...) @nondet_int()
store i32 %28, i32* %2
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 1
store i32 %30, i32* %3
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 1
store i32 %32, i32* %4
br label %33
33: ; preds = %27, %23
br label %6
34: ; preds = %15
%35 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("usage: putscom [-c|--chip chip-id] addr value\n");
  printf("       putscom -v|--version\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"usage: putscom [-c|--chip chip-id] addr value\0A\00"
@.str.1 = [29 x i8] c" putscom -v|--version\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"usage: putscom [-c|--chip chip-id] addr value\00"
@str.2 = [28 x i8] c" putscom -v|--version\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x05() {
  Assert_real((islower(5) == 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_islower.c",
              30, ("islower should be 0 for 0x05"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x05>:
push   %rax
mov    $0x5,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e,%edx
pop    %rax
jmp    1040 <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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x05\00"
define void @t_islower_0x05() {
%1 = call i64 @islower(i32 5)
%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 30, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x05\00"
define void @t_islower_0x05() {
%1 = tail call i64 @islower(i32 5)
%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 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char **gloob(void *t[], ...) {
  int k = 0;
  k %= (k *= (k += (k++)));
  k <<= k--;
  k |= k--;
  k -= --k << 1 ? 3 : 2;
}


x86 assembly (clang, -O0):
<gloob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
imul   %eax,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
and    $0x7fffffff,%ecx
mov    -0x14(%rbp),%eax
sub    $0x1,%ecx
adc    $0xffffffff,%eax
add    $0xfffffffe,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8** @gloob(i8** %0, ...) {
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 0, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, %5
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, %8
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = srem i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = shl i32 %15, %13
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = or i32 %19, %17
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = add nsw i32 %21, -1
store i32 %22, i32* %4
%23 = shl i32 %22, 1
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 3, i32 2
%27 = load i32, i32* %4
%28 = sub nsw i32 %27, %26
store i32 %28, i32* %4
%29 = load i8**, i8*** %2
ret i8** %29
}

LLVM IR (-O2):
define noalias i8** @gloob(i8** nocapture readnone %0, ...) {
ret i8** undef
}
/* Variables and functions */
int /*<<< orphan*/ f3(int, int, int, int, int);
void f4(void) { f3(1, 1, 2, 3, 4); }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %esi,%edi
call   1030 <f3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
jmp    1030 <f3@plt>

LLVM IR (-O0):
define void @f4() {
%1 = call i32 @f3(i32 1, i32 1, i32 2, i32 3, i32 4)
ret void
}

LLVM IR (-O2):
define void @f4() {
%1 = tail call i32 @f3(i32 1, i32 1, i32 2, i32 3, i32 4)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int store_new_hyperplane_sections(int m, int k, int n, double *c) {
  int a[3], *b, fail;
  a[0] = m;
  a[1] = k;
  a[2] = n;
  fail = _ada_use_c2phc4c(60, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<store_new_hyperplane_sections>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x24(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x3c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_new_hyperplane_sections>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x3c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @store_new_hyperplane_sections(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca [3 x i32]
%10 = alloca i32*
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%19 = load i32*, i32** %10
%20 = load double*, double** %8
%21 = call i32 @_ada_use_c2phc4c(i32 60, i32* %18, i32* %19, double* %20, i32 0)
store i32 %21, i32* %11
%22 = load i32, i32* %11
ret i32 %22
}

LLVM IR (-O2):
define i32 @store_new_hyperplane_sections(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc4c(i32 60, i32* %7, i32* undef, double* %3, i32 0)
ret i32 %10
}
void test(char c) { ; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @test(i8 signext %0) {
ret void
}
void test_sizeof() {
  int arr[10];
  sizeof arr[0];
  sizeof(arr[0]);
  sizeof(arr)[0];
}


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

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

LLVM IR (-O0):
define void @test_sizeof() {
%1 = alloca [10 x i32]
ret void
}

LLVM IR (-O2):
define void @test_sizeof() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(float, int);
int /*<<< orphan*/ t();
int f(float a) {
  t();
  if (a++ > 0)
    g(a, 3);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <t@plt>
movss  -0x8(%rbp),%xmm0
movss  0xebf(%rip),%xmm2
movaps %xmm0,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,-0x8(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1168 <f+0x48>
movss  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1040 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <t@plt>
xorps  %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1151 <f+0x31>
movaps %xmm1,%xmm0
addss  0xeb9(%rip),%xmm0
mov    $0x3,%edi
call   1040 <g@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = call i32 (...) @t()
%5 = load float, float* %3
%6 = fadd float %5, 1.000000e+00
store float %6, float* %3
%7 = fcmp ogt float %5, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = call i32 @g(float %9, i32 3)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(float %0) {
%2 = tail call i32 (...) @t()
%3 = fcmp ogt float %0, 0.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = fadd float %0, 1.000000e+00
%6 = tail call i32 @g(float %5, i32 3)
br label %7
7: ; preds = %4, %1
ret i32 undef
}
void gdk_color_equal() {}


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

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

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

LLVM IR (-O2):
define void @gdk_color_equal() {
ret void
}
int with_conditional(int *p) {
  return ({
    int x = 1;
    p ? *p + x : x;
  });
}


x86 assembly (clang, -O0):
<with_conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112b <with_conditional+0x2b>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <with_conditional+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<with_conditional>:
test   %rdi,%rdi
je     110b <with_conditional+0xb>
mov    (%rdi),%eax
add    $0x1,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @with_conditional(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 1
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
int clamp_int(const int a, const int min, const int max) {
  return (a < min) ? min : (a > max) ? max : a;
}


x86 assembly (clang, -O0):
<clamp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp_int+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp_int+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clamp_int+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp_int+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @clamp_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((visibility("hidden"))) void zcfree(void *opaque, void *ptr) {
  (void)opaque;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<zcfree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define hidden void @zcfree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freep(void **mem) {
  if (mem && *mem) {
    free(*mem);
    *mem = NULL;
  }
}


x86 assembly (clang, -O0):
<freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <freep+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <freep+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freep>:
push   %rbx
test   %rdi,%rdi
je     112d <freep+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <freep+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @freep(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M530_f(char *s) {
  debug("M530_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M530_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M530_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M530_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M530_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M530_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M530_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void free_list() {}


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

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

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

LLVM IR (-O2):
define void @free_list() {
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_varchardoublefunc(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_varchardoublefunc() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_varchardoublefunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printProgramIdentification();
void processVersionOption(const char *const option __attribute__((unused)),
                          const char *const parameter __attribute__((unused))) {
  printProgramIdentification();
  exit(0);
}


x86 assembly (clang, -O0):
<processVersionOption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <printProgramIdentification@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @processVersionOption(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @printProgramIdentification()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @processVersionOption(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @printProgramIdentification()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ card_count(int, char *);
int /*<<< orphan*/ change_count(int, int);
int /*<<< orphan*/ get_card_name(char *, char *);
int main() {
  char card_name[3];
  int count = 0;
  do {
    get_card_name("Enter the card name: ", card_name);
    int val = 0;
    card_count(val, card_name);
    change_count(val, count);
  } while (card_name[0] != 'X');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x7(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1050 <get_card_name@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x7(%rbp),%rsi
call   1030 <card_count@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <change_count@plt>
movsbl -0x7(%rbp),%eax
cmp    $0x58,%eax
jne    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0x5(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <get_card_name@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <card_count@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <change_count@plt>
cmpb   $0x58,0x5(%rsp)
jne    1140 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the card name: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %14, %0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%7 = call i32 @get_card_name(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 0, i32* %4
%8 = load i32, i32* %4
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%10 = call i32 @card_count(i32 %8, i8* %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = call i32 @change_count(i32 %11, i32 %12)
br label %14
14: ; preds = %5
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 88
br i1 %18, label %5, label %19
19: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter the card name: \00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @get_card_name(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @card_count(i32 0, i8* %2)
%6 = call i32 @change_count(i32 0, i32 0)
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 88
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t soft_timer_s_to_ticks(int32_t s) { return (s * 32768); }


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

x86 assembly (clang, -O2):
<soft_timer_s_to_ticks>:
mov    %edi,%eax
shl    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @soft_timer_s_to_ticks(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 32768
ret i32 %4
}

LLVM IR (-O2):
define i32 @soft_timer_s_to_ticks(i32 %0) {
%2 = shl nsw i32 %0, 15
ret i32 %2
}