xunge/DecIR huggingface dataset:
void STEAM_RegisterAppKeepAliveTicCallback(
    void (*fpKeepAliveTicCallBack)(char *scr_msg)) {}


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

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

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

LLVM IR (-O2):
define void @STEAM_RegisterAppKeepAliveTicCallback(void (i8*)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logx(int, char *);
int mainloop_startqw(int doonce) {
  logx(3, "mainloop_startqw started\n");
  return (0);
}


x86 assembly (clang, -O0):
<mainloop_startqw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
lea    0xed9(%rip),%rsi
call   1030 <logx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainloop_startqw>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edi
call   1030 <logx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"mainloop_startqw started\0A\00"
define i32 @mainloop_startqw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @logx(i32 3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"mainloop_startqw started\0A\00"
define i32 @mainloop_startqw(i32 %0) {
%2 = tail call i32 @logx(i32 3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned int I_NoAppServicesLobbyMgrGetCount(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesLobbyMgrGetCount() {
ret i32 0
}
long double foo(unsigned a, unsigned b) { return a + b < a; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
mov    %ecx,%eax
add    %edx,%eax
sub    %ecx,%eax
fld1
fldz
fcmovb %st(1),%st
fstp   %st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
add    %esi,%edi
setb   %al
mov    %ax,-0x2(%rsp)
filds  -0x2(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @foo(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 i32 %5, %6
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
%10 = zext i1 %9 to i32
%11 = sitofp i32 %10 to x86_fp80
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @foo(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = icmp ult i32 %3, %1
%5 = uitofp i1 %4 to x86_fp80
ret x86_fp80 %5
}
/* Type definitions */
struct loaddisplay {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ orig_updatepos(struct loaddisplay *);
int /*<<< orphan*/ refresh(struct loaddisplay *);
void ld_updatepos(struct loaddisplay *ld) {
  refresh(ld);
  orig_updatepos(ld);
}


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

x86 assembly (clang, -O2):
<ld_updatepos>:
push   %rbx
mov    %rdi,%rbx
call   1040 <refresh@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <orig_updatepos@plt>

LLVM IR (-O0):
%struct.loaddisplay = type { i32 }
define void @ld_updatepos(%struct.loaddisplay* %0) {
%2 = alloca %struct.loaddisplay*
store %struct.loaddisplay* %0, %struct.loaddisplay** %2
%3 = load %struct.loaddisplay*, %struct.loaddisplay** %2
%4 = call i32 @refresh(%struct.loaddisplay* %3)
%5 = load %struct.loaddisplay*, %struct.loaddisplay** %2
%6 = call i32 @orig_updatepos(%struct.loaddisplay* %5)
ret void
}

LLVM IR (-O2):
%struct.loaddisplay = type { i32 }
define void @ld_updatepos(%struct.loaddisplay* %0) {
%2 = tail call i32 @refresh(%struct.loaddisplay* %0)
%3 = tail call i32 @orig_updatepos(%struct.loaddisplay* %0)
ret void
}
const char *never_sampler_to_str(struct htrace_sampler *sampler) {
  return "NeverSampler";
}


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

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

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

LLVM IR (-O2):
%struct.htrace_sampler = type opaque
@.str = [13 x i8] c"NeverSampler\00"
define i8* @never_sampler_to_str(%struct.htrace_sampler* nocapture readnone %0) {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int add(int var1, int var2) { return (var1 + var2); }


x86 assembly (clang, -O0):
<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):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @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 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x, aux = 0, media = 0;
  for (x = 1; x <= 100; x++) {
    aux = aux + x;
  }
  media = aux / 100;
  printf("%d", media);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1155 <main+0x45>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x32,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 50)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gymy_main(int, char **);
int main(int argc, char **argv) {
  gymy_main(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gymy_main(i32 %0, i8** %1)
ret i32 0
}
void foo_2_2_2_2_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_2_2_1_2() {
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int is_tag_prefix(char *arg) {
  if (arg && (strstr(arg, "net:") == arg || strstr(arg, "tag:") == arg))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_tag_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1167 <is_tag_prefix+0x57>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strstr@plt>
cmp    -0x10(%rbp),%rax
je     115b <is_tag_prefix+0x4b>
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strstr@plt>
cmp    -0x10(%rbp),%rax
jne    1167 <is_tag_prefix+0x57>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_tag_prefix+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_tag_prefix>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     114d <is_tag_prefix+0x3d>
mov    %rdi,%rbx
lea    0xede(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     114f <is_tag_prefix+0x3f>
lea    0xec9(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
test   %eax,%eax
je     114f <is_tag_prefix+0x3f>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"net:\00"
@.str.1 = [5 x i8] c"tag:\00"
define i32 @is_tag_prefix(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strncmp(i8* %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %1
br label %10
10: ; preds = %3, %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ], [ 1, %3 ]
ret i32 %11
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, struct iovec const *, int, long, long);
ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt,
                    int64_t offset) {
  return syscall(296, fd, iov, iovcnt, (long)offset, (long)(offset >> 32));
}


x86 assembly (clang, -O0):
<uv__pwritev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x18(%rbp),%r8
mov    -0x18(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    -0x1c(%rbp),%ecx
movslq %eax,%r9
mov    $0x128,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__pwritev>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %edi,%esi
movslq %ecx,%r8
mov    $0x128,%edi
mov    %eax,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @uv__pwritev(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.iovec*, %struct.iovec** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = sext i32 %12 to i64
%14 = load i32, i32* %8
%15 = ashr i32 %14, 32
%16 = sext i32 %15 to i64
%17 = call i32 @syscall(i32 296, i32 %9, %struct.iovec* %10, i32 %11, i64 %13, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @uv__pwritev(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = tail call i32 @syscall(i32 296, i32 %0, %struct.iovec* %1, i32 %2, i64 %5, i64 poison)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(unsigned long long);
int main() {
  unsigned long long aLL = 1000000000000000000ULL;
  if (foo(aLL) != 19)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0xde0b6b3a7640000,%rax
b6 e0 0d
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <foo@plt>
cmp    $0x13,%eax
je     1156 <main+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0xde0b6b3a7640000,%rdi
b6 e0 0d
call   1040 <foo@plt>
cmp    $0x13,%eax
jne    1139 <main+0x19>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1000000000000000000, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @foo(i64 %3)
%5 = icmp ne i32 %4, 19
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i64 1000000000000000000)
%2 = icmp eq i32 %1, 19
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
double fabs(double);
int rd_deq0(double a, double b, double prec) { return fabs(a - b) < prec; }


x86 assembly (clang, -O0):
<rd_deq0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_deq0>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @rd_deq0(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @llvm.fabs.f64(double %9)
%11 = load double, double* %6
%12 = fcmp olt double %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @rd_deq0(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
extern void test() {
  printf("\n");
  int a = ({
    unsigned int _v;
    __asm__ volatile("mov %1, %%ebx \n"
                     "mov %2, %%eax \n"
                     "int $0x80\n"
                     "mov %%eax, %0 \n"
                     : "=a"(_v)
                     : "b"(2), "i"(4)
                     :);
    _v;
  });
  printf(" test: %x\n", a);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%ebx
mov    %ebx,%ebx
mov    $0x4,%eax
int    $0x80
mov    %eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%ebx
mov    %ebx,%ebx
mov    $0x4,%eax
int    $0x80
mov    %eax,%eax
lea    0xebe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [11 x i8] c" test: %x\0A\00"
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 asm sideeffect "mov $1, %ebx \0Amov $2, %eax \0Aint $$0x80\0Amov %eax, $0 \0A", "={ax},{bx},i,~{dirflag},~{fpsr},~{flags}"(i32 2, i32 4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = load i32, i32* %3
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c" test: %x\0A\00"
define void @test() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 asm sideeffect "mov $1, %ebx \0Amov $2, %eax \0Aint $$0x80\0Amov %eax, $0 \0A", "={ax},{bx},i,~{dirflag},~{fpsr},~{flags}"(i32 2, i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
char RunningOnBigEndian(void) {
  int fourBytes[1];
  fourBytes[0] = 128912422;
  short int *asTwoShorts = (short int *)fourBytes;
  return (asTwoShorts[0] == 1967);
}


x86 assembly (clang, -O0):
<RunningOnBigEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7af0c26,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cmp    $0x7af,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @RunningOnBigEndian() {
%1 = alloca [1 x i32]
%2 = alloca i16*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 128912422, i32* %3
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%5 = bitcast i32* %4 to i16*
store i16* %5, i16** %2
%6 = load i16*, i16** %2
%7 = getelementptr inbounds i16, i16* %6, i64 0
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = icmp eq i32 %9, 1967
%11 = zext i1 %10 to i32
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @RunningOnBigEndian() {
ret i8 0
}
void foo307(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo307(i32 %0) {
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char x;
  while ((x = getchar()) != EOF)
    printf("%c", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1163 <main+0x43>
lea    0xeab(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
je     1157 <main+0x37>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%al
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void alarm() {
  printf("ALARM\n");
  exit(100);
}


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

x86 assembly (clang, -O2):
<alarm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ALARM\0A\00"
define void @alarm() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 100)
unreachable
}

LLVM IR (-O2):
@str = [6 x i8] c"ALARM\00"
define void @alarm() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 100)
unreachable
}
int ok_umul2(unsigned x, unsigned y, unsigned *dest) {
  unsigned char byte_result;
  asm("movl %2,%%eax; mull %3; movl %%eax,%0; setae %1"
      : "=r"(*dest), "=r"(byte_result)
      : "r"(x), "r"(y)
      : "%eax");
  return (int)byte_result;
}


x86 assembly (clang, -O0):
<ok_umul2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    %edx,%eax
mul    %esi
mov    %eax,%edx
setae  %sil
mov    %sil,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %edx,(%rcx)
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok_umul2>:
mov    %edi,%eax
mul    %esi
mov    %eax,%ecx
setae  %sil
mov    %ecx,(%rdx)
movzbl %sil,%eax
ret

LLVM IR (-O0):
define i32 @ok_umul2(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call { i32, i8 } asm "movl $2,%eax; mull $3; movl %eax,$0; setae $1", "=r,=r,r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %9, i32 %10)
%12 = extractvalue { i32, i8 } %11, 0
%13 = extractvalue { i32, i8 } %11, 1
store i32 %12, i32* %8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @ok_umul2(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call { i32, i8 } asm "movl $2,%eax; mull $3; movl %eax,$0; setae $1", "=r,=r,r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
%5 = extractvalue { i32, i8 } %4, 0
%6 = extractvalue { i32, i8 } %4, 1
store i32 %5, i32* %2
%7 = zext i8 %6 to i32
ret i32 %7
}
/* Variables and functions */
int rrandom();
int coin_toss() { return (((rrandom() & 01) ? 1 : 0)); }


x86 assembly (clang, -O0):
<coin_toss>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rrandom@plt>
mov    %eax,%edx
and    $0x1,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coin_toss>:
push   %rax
xor    %eax,%eax
call   1030 <rrandom@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @coin_toss() {
%1 = call i32 (...) @rrandom()
%2 = and i32 %1, 1
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @coin_toss() {
%1 = tail call i32 (...) @rrandom()
%2 = and i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x91() {
  Assert_real((isxdigit(145) == 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_isxdigit.c",
              730, ("isxdigit should be 0 for 0x91"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x91>:
push   %rax
mov    $0x91,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2da,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x91\00"
define void @t_isxdigit_0x91() {
%1 = call i64 @isxdigit(i32 145)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 730, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x91\00"
define void @t_isxdigit_0x91() {
%1 = tail call i64 @isxdigit(i32 145)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 730, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ intro();
scalar_t__ playagain();
int /*<<< orphan*/ playhand();
int /*<<< orphan*/ printf(char *);
int main(void) {
  intro();
  do
    playhand();
  while (playagain());
  printf("Thanks for playing!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <intro@plt>
mov    $0x0,%al
call   1050 <playhand@plt>
mov    $0x0,%al
call   1060 <playagain@plt>
cmp    $0x0,%rax
jne    1166 <main+0x16>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <intro@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <playhand@plt>
xor    %eax,%eax
call   1060 <playagain@plt>
test   %rax,%rax
jne    1160 <main+0x10>
lea    0xe86(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Thanks for playing!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @intro()
br label %3
3: ; preds = %5, %0
%4 = call i32 (...) @playhand()
br label %5
5: ; preds = %3
%6 = call i64 (...) @playagain()
%7 = icmp ne i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"Thanks for playing!\00"
define i32 @main() {
%1 = tail call i32 (...) @intro()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @playhand()
%4 = tail call i64 (...) @playagain()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ reference_delete(void *);
void reference_delete_cb(void *p_void) { reference_delete(p_void); }


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

x86 assembly (clang, -O2):
<reference_delete_cb>:
jmp    1030 <reference_delete@plt>

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

LLVM IR (-O2):
define void @reference_delete_cb(i8* %0) {
%2 = tail call i32 @reference_delete(i8* %0)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *amp_default_calloc(void *dummy_allocator_context, size_t elem_count,
                         size_t bytes_per_elem, char const *filename,
                         int line) {
  (void)dummy_allocator_context;
  (void)filename;
  (void)line;
  return calloc(elem_count, bytes_per_elem);
}


x86 assembly (clang, -O0):
<amp_default_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<amp_default_calloc>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @amp_default_calloc(i8* nocapture readnone %0, i64 %1, i64 %2, i8* nocapture readnone %3, i32 %4) {
%6 = tail call i8* @calloc(i64 %1, i64 %2)
ret i8* %6
}
__attribute__((no)) int bar(int a) {
  void *l = &&error;
  if (a == 4)
    goto *l;
  return 150;
error:
  return a;
failure:
  return a + 2;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
lea    0x27(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    1129 <bar+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1140 <bar+0x40>
movl   $0x96,-0x4(%rbp)
jmp    113b <bar+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret
mov    -0x18(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<bar>:
cmp    $0x4,%edi
mov    $0x96,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* blockaddress(@bar, %10), i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %4
br label %17
9: ; preds = %1
store i32 150, i32* %2
br label %15
10: ; preds = %17
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %15
12: ; No predecessors!
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 2
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %10, %9
%16 = load i32, i32* %2
ret i32 %16
17: ; preds = %7
%18 = phi i8* [ %8, %7 ]
indirectbr i8* %18, [label %10]
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = select i1 %2, i32 4, i32 150
ret i32 %3
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
int INT_MAX;
int ethtool_validate_speed(__u32 speed) {
  return speed <= INT_MAX || speed == -1;
}


x86 assembly (clang, -O0):
<ethtool_validate_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ed5(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
jle    1128 <ethtool_validate_speed+0x28>
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethtool_validate_speed>:
mov    0x2ee1(%rip),%rax
cmp    %edi,(%rax)
setge  %al
cmp    $0xffffffff,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @ethtool_validate_speed(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = icmp sge i32 %2, %0
%4 = icmp eq i32 %0, -1
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void error() {
ERROR:
  goto ERROR;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <error+0x9>
jmp    1109 <error+0x9>

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

LLVM IR (-O0):
define void @error() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @error() {
br label %1
1: ; preds = %1, %0
br label %1
}
void initialize_tree(int *tree) {
  int i;
  for (i = 0; i < 250; i++)
    tree[i] = -1;
}


x86 assembly (clang, -O0):
<initialize_tree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xfa,-0xc(%rbp)
jge    1139 <initialize_tree+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initialize_tree+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_tree>:
push   %rax
mov    $0x3e8,%edx
mov    $0xff,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @initialize_tree(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ec_stack_overflow(int /*<<< orphan*/, int);
int /*<<< orphan*/ rb_current_execution_context();
void vm_stackoverflow(void) {
  ec_stack_overflow(rb_current_execution_context(), 1);
}


x86 assembly (clang, -O0):
<vm_stackoverflow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rb_current_execution_context@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <ec_stack_overflow@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_stackoverflow>:
push   %rax
xor    %eax,%eax
call   1030 <rb_current_execution_context@plt>
mov    %eax,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <ec_stack_overflow@plt>

LLVM IR (-O0):
define void @vm_stackoverflow() {
%1 = call i32 (...) @rb_current_execution_context()
%2 = call i32 @ec_stack_overflow(i32 %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @vm_stackoverflow() {
%1 = tail call i32 (...) @rb_current_execution_context()
%2 = tail call i32 @ec_stack_overflow(i32 %1, i32 1)
ret void
}
int reverse(int x) {
  int result = 0;
  while (x != 0) {
    int new_result = result * 10 + x % 10;
    if (new_result / 10 != result)
      return 0;
    result = new_result;
    x /= 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116b <reverse+0x6b>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0xc(%rbp),%eax
je     1152 <reverse+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1171 <reverse+0x71>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    110e <reverse+0xe>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %edi,%edi
je     115a <reverse+0x5a>
lea    (%rax,%rax,4),%ecx
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%edi
lea    (%rdi,%rcx,2),%ecx
movslq %ecx,%rsi
imul   $0x66666667,%rsi,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rsi
add    %edi,%esi
mov    %edx,%edi
cmp    %eax,%esi
mov    %ecx,%eax
je     1110 <reverse+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ %0, %1 ], [ %12, %6 ]
%4 = phi i32 [ 0, %1 ], [ %9, %6 ]
%5 = icmp eq i32 %3, 0
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = mul nsw i32 %4, 10
%8 = srem i32 %3, 10
%9 = add nsw i32 %7, %8
%10 = sdiv i32 %9, 10
%11 = icmp eq i32 %10, %4
%12 = sdiv i32 %3, 10
br i1 %11, label %2, label %13
13: ; preds = %2, %6
%14 = phi i32 [ 0, %6 ], [ %4, %2 ]
ret i32 %14
}
double promedio(int cant, int arreglo[cant]) {
  int total = 0, i = 0;
  double resp = 0;
  for (i = 0; i < cant; i++) {
    total = +arreglo[i];
  }
  resp = (double)total / (double)cant;
  return resp;
}


x86 assembly (clang, -O0):
<promedio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <promedio+0x50>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <promedio+0x28>
cvtsi2sdl -0x14(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<promedio>:
test   %edi,%edi
jle    110e <promedio+0xe>
lea    -0x1(%rdi),%eax
cvtsi2sdl (%rsi,%rax,4),%xmm0
jmp    1112 <promedio+0x12>
xorpd  %xmm0,%xmm0
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @promedio(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %3
store i32* %1, i32** %4
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
store i32 0, i32* %5
store i32 0, i32* %6
store double 0.000000e+00, double* %7
store i32 0, i32* %6
br label %10
10: ; preds = %20, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %5
br label %20
20: ; preds = %14
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %10
23: ; preds = %10
%24 = load i32, i32* %5
%25 = sitofp i32 %24 to double
%26 = load i32, i32* %3
%27 = sitofp i32 %26 to double
%28 = fdiv double %25, %27
store double %28, double* %7
%29 = load double, double* %7
ret double %29
}

LLVM IR (-O2):
define double @promedio(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
br label %10
10: ; preds = %4, %2
%11 = phi double [ %9, %4 ], [ 0.000000e+00, %2 ]
%12 = sitofp i32 %0 to double
%13 = fdiv double %11, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ display_at(char *, int, int);
void main() {
  clear_screen();
  display_at("GeekSkool", 1, 1);
  display_at("HasGeek House", 1, 6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clear_screen@plt>
lea    0xece(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <display_at@plt>
lea    0xec5(%rip),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
call   1040 <display_at@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clear_screen@plt>
lea    0xed1(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <display_at@plt>
lea    0xec5(%rip),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
pop    %rax
jmp    1040 <display_at@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"GeekSkool\00"
@.str.1 = [14 x i8] c"HasGeek House\00"
define void @main() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 @display_at(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%3 = call i32 @display_at(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"GeekSkool\00"
@.str.1 = [14 x i8] c"HasGeek House\00"
define void @main() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 @display_at(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%3 = tail call i32 @display_at(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 6)
ret void
}
void gtk_color_selection_get_has_opacity_control() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_get_has_opacity_control() {
ret void
}
/* Variables and functions */
size_t hash_func(char *key) {
  size_t h = 2166136261;
  int i;
  for (i = 0; key[i] != '\0'; ++i)
    h = (h * 16777619) ^ key[i];
  return h % 3848921;
}


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x811c9dc5,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <hash_func+0x57>
imul   $0x1000193,-0x10(%rbp),%rax
01
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <hash_func+0x18>
mov    -0x10(%rbp),%rax
mov    $0x3abad9,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
mov    (%rdi),%al
test   %al,%al
je     114b <hash_func+0x4b>
add    $0x1,%rdi
mov    $0x811c9dc5,%ecx
nop
imul   $0x1000193,%rcx,%rdx
movsbq %al,%rcx
xor    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_func+0x10>
movabs $0x22df1bf99e8e2919,%rdx
1b df 22
mov    %rcx,%rax
mul    %rdx
shr    $0x13,%rdx
imul   $0x3abad9,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
mov    $0x2e6d63,%eax
ret

LLVM IR (-O0):
define i64 @hash_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 2166136261, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %5
%14 = load i64, i64* %3
%15 = mul i64 %14, 16777619
%16 = load i8*, i8** %2
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i64
%22 = xor i64 %15, %21
store i64 %22, i64* %3
br label %23
23: ; preds = %13
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
%27 = load i64, i64* %3
%28 = urem i64 %27, 3848921
ret i64 %28
}

LLVM IR (-O2):
define i64 @hash_func(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i64 [ %10, %4 ], [ 2166136261, %1 ]
%8 = mul i64 %7, 16777619
%9 = sext i8 %6 to i64
%10 = xor i64 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = urem i64 %10, 3848921
br label %17
17: ; preds = %15, %1
%18 = phi i64 [ 3042659, %1 ], [ %16, %15 ]
ret i64 %18
}
/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
double get_time() { return (double)clock() / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_time() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_time() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}