xunge/DecIR huggingface dataset:
/* Variables and functions */
int CHAR_BIT;
unsigned long set_blocks(long len) {
  long blocks = 1L;
  if (len > 0)
    blocks = ((long)len - 1) / (sizeof(long) * CHAR_BIT) + 2;
  return blocks;
}


x86 assembly (clang, -O0):
<set_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    113e <set_blocks+0x3e>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    0x2eb6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
xor    %edx,%edx
div    %rcx
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_blocks>:
test   %rdi,%rdi
jle    1130 <set_blocks+0x30>
add    $0xffffffffffffffff,%rdi
mov    0x2ed0(%rip),%rax
movslq (%rax),%rcx
shl    $0x3,%rcx
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1136 <set_blocks+0x36>
mov    %rdi,%rax
xor    %edx,%edx
div    %rcx
add    $0x2,%rax
ret
mov    $0x1,%eax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
add    $0x2,%rax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i64 @set_blocks(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 1
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = udiv i64 %8, %11
%13 = add i64 %12, 2
store i64 %13, i64* %3
br label %14
14: ; preds = %6, %1
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i64 @set_blocks(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = add nsw i64 %0, -1
%5 = load i32, i32* @CHAR_BIT
%6 = sext i32 %5 to i64
%7 = shl nsw i64 %6, 3
%8 = udiv i64 %4, %7
%9 = add nuw i64 %8, 2
br label %10
10: ; preds = %3, %1
%11 = phi i64 [ %9, %3 ], [ 1, %1 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ native_io_delay();
void io_wait() { native_io_delay(); }


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

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

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

LLVM IR (-O2):
define void @io_wait() {
%1 = tail call i32 (...) @native_io_delay()
ret void
}
int StopNetworkDiscoveryService() {}


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

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

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

LLVM IR (-O2):
define i32 @StopNetworkDiscoveryService() {
ret i32 undef
}
/* Variables and functions */
size_t strlen(const char *s) {
  int len = 0;
  while (*(s++))
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = zext i32 %8 to i64
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 0, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;
typedef int int16_t;

/* Variables and functions */
uint32_t bgez(int32_t reg1, int16_t kte, uint32_t *pc) {
  int32_t ktebuffer;
  if (reg1 >= 0) {
    ktebuffer = kte << 2;
    *pc = *pc + ktebuffer;
    return *pc;
  } else {
    return *pc;
  }
}


x86 assembly (clang, -O0):
<bgez>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1148 <bgez+0x48>
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <bgez+0x53>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgez>:
test   %rdi,%rdi
js     1112 <bgez+0x12>
shl    $0x2,%esi
movslq %esi,%rax
add    (%rdx),%rax
mov    %rax,(%rdx)
ret
mov    (%rdx),%rax
ret

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

LLVM IR (-O2):
define i64 @bgez(i64 %0, i32 %1, i64* nocapture %2) {
%4 = icmp sgt i64 %0, -1
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = shl i32 %1, 2
%7 = sext i32 %6 to i64
%8 = load i64, i64* %2
%9 = add nsw i64 %8, %7
store i64 %9, i64* %2
br label %12
10: ; preds = %3
%11 = load i64, i64* %2
br label %12
12: ; preds = %10, %5
%13 = phi i64 [ %9, %5 ], [ %11, %10 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stub1();
int main() {
  printf("crashexec\n");
  void (*fp)() = (void (*)())0x51515151;
  (*fp)();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x51515151,%eax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"crashexec\0A\00"
define i32 @main() {
%1 = alloca void (...)*
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store void (...)* inttoptr (i64 1364283729 to void (...)*), void (...)** %1
%3 = load void (...)*, void (...)** %1
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"crashexec\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
tail call void (...) inttoptr (i64 1364283729 to void (...)*)()
ret i32 0
}
/* Variables and functions */
scalar_t__ clr_bol;
int /*<<< orphan*/ min_putp(scalar_t__);
int min_clrbol(void) {
  if (clr_bol) {
    min_putp(clr_bol);
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<min_clrbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
cmpq   $0x0,(%rax)
je     1144 <min_clrbol+0x34>
mov    0x2eb8(%rip),%rax
mov    (%rax),%rdi
call   1030 <min_putp@plt>
movl   $0x0,-0x4(%rbp)
jmp    114b <min_clrbol+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_clrbol>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     1129 <min_clrbol+0x19>
call   1030 <min_putp@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@clr_bol = global i64 0
define i32 @min_clrbol() {
%1 = alloca i32
%2 = load i64, i64* @clr_bol
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i64, i64* @clr_bol
%6 = call i32 @min_putp(i64 %5)
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@clr_bol = global i64 0
define i32 @min_clrbol() {
%1 = load i64, i64* @clr_bol
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @min_putp(i64 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %6
}
/* Variables and functions */
char *strchr(char const *, char);
const char *gethost(const char *hname) {
  const char *p = strchr(hname, '@');
  return p ? ++p : hname;
}


x86 assembly (clang, -O0):
<gethost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <gethost+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
jmp    1156 <gethost+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethost>:
push   %rbx
mov    %rdi,%rbx
mov    $0x40,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @gethost(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 64)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @gethost(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strlen(char const *);
int /*<<< orphan*/ trap_PureModel(char const *);
void G_PureModel(const char *model) {
  assert(model && model[0] && strlen(model) < 64);
  trap_PureModel(model);
}


x86 assembly (clang, -O0):
<G_PureModel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1173 <G_PureModel+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1173 <G_PureModel+0x43>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x40,%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <trap_PureModel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_PureModel>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
je     1151 <G_PureModel+0x21>
cmpb   $0x0,(%rbx)
je     1151 <G_PureModel+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x40,%eax
setl   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <trap_PureModel@plt>

LLVM IR (-O0):
define void @G_PureModel(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 %15
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = icmp slt i32 %13, 64
br label %15
15: ; preds = %11, %5, %1
%16 = phi i1 [ false, %5 ], [ false, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %2
%20 = call i32 @trap_PureModel(i8* %19)
ret void
}

LLVM IR (-O2):
define void @G_PureModel(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp slt i32 %7, 64
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %9, %6 ]
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @trap_PureModel(i8* %0)
ret void
}
void glGetString(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetString() {
ret void
}
/* Variables and functions */
long __infer_nondet_long_int();
long int lround(double x) { return __infer_nondet_long_int(); }


x86 assembly (clang, -O0):
<lround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_long_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @lround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 (...) @__infer_nondet_long_int()
ret i64 %3
}

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = tail call i64 (...) @__infer_nondet_long_int()
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_get_tid(void *e,
                                                            pid_t *tid) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_event_get_tid>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_get_tid(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_get_tid(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gendep__deldep(char const *);
void gendep__register_unlink(char const *fn) { gendep__deldep(fn); }


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

x86 assembly (clang, -O2):
<gendep__register_unlink>:
jmp    1030 <gendep__deldep@plt>

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

LLVM IR (-O2):
define void @gendep__register_unlink(i8* %0) {
%2 = tail call i32 @gendep__deldep(i8* %0)
ret void
}
/* Variables and functions */
void *token_new_copy(void *);
void *token_copy_cb(void *p_void) { return (token_new_copy(p_void)); }


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

x86 assembly (clang, -O2):
<token_copy_cb>:
jmp    1030 <token_new_copy@plt>

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

LLVM IR (-O2):
define i8* @token_copy_cb(i8* %0) {
%2 = tail call i8* @token_new_copy(i8* %0)
ret i8* %2
}
unsigned int bits(unsigned int n) {
  unsigned int b = 0;
  while (n) {
    b++;
    n >>= 1;
  }
  return b;
}


x86 assembly (clang, -O0):
<bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bits+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bits+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @bits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
int string_para_inteiro(char *c) {
  int i;
  int acumulador;
  i = 0;
  acumulador = 0;
  while (c[i] != '\0') {
    acumulador *= 10;
    acumulador += (c[i] - '0');
    i++;
  }
  return acumulador;
}


x86 assembly (clang, -O0):
<string_para_inteiro>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1155 <string_para_inteiro+0x55>
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <string_para_inteiro+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_para_inteiro>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <string_para_inteiro+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_para_inteiro+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @string_para_inteiro(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%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 %27
13: ; preds = %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 10
store i32 %15, i32* %4
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 48
%23 = load i32, i32* %4
%24 = add nsw i32 %23, %22
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @string_para_inteiro(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = mul nsw i32 %7, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_ptr;

/* Variables and functions */
int /*<<< orphan*/ mpz_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
scalar_t__ mpz_odd_p(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_tdiv_q_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int);
void gmp_halve(mpz_ptr value, mpz_ptr order) {
  if (mpz_odd_p(value)) {
    mpz_add(value, value, order);
    mpz_tdiv_q_2exp(value, value, 1);
  } else {
    mpz_tdiv_q_2exp(value, value, 1);
  }
}


x86 assembly (clang, -O0):
<gmp_halve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mpz_odd_p@plt>
cmp    $0x0,%rax
je     1173 <gmp_halve+0x43>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <mpz_add@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1050 <mpz_tdiv_q_2exp@plt>
jmp    1183 <gmp_halve+0x53>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1050 <mpz_tdiv_q_2exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmp_halve>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <mpz_odd_p@plt>
test   %rax,%rax
je     114c <gmp_halve+0x1c>
mov    %ebx,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <mpz_add@plt>
mov    %ebx,%edi
mov    %ebx,%esi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mpz_tdiv_q_2exp@plt>

LLVM IR (-O0):
define void @gmp_halve(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 = call i64 @mpz_odd_p(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @mpz_add(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @mpz_tdiv_q_2exp(i32 %13, i32 %14, i32 1)
br label %20
16: ; preds = %2
%17 = load i32, i32* %3
%18 = load i32, i32* %3
%19 = call i32 @mpz_tdiv_q_2exp(i32 %17, i32 %18, i32 1)
br label %20
20: ; preds = %16, %8
ret void
}

LLVM IR (-O2):
define void @gmp_halve(i32 %0, i32 %1) {
%3 = tail call i64 @mpz_odd_p(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @mpz_add(i32 %0, i32 %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = tail call i32 @mpz_tdiv_q_2exp(i32 %0, i32 %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data();
int /*<<< orphan*/ ufu();
int main() {
  ufu();
  data();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ufu()
%3 = call i32 (...) @data()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ufu()
%2 = tail call i32 (...) @data()
ret i32 0
}
int request_uri_is_valid_char(unsigned char c) {
  if (c <= 32)
    return 0;
  if (c == 127)
    return 0;
  if (c == 255)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<request_uri_is_valid_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jg     1123 <request_uri_is_valid_char+0x23>
movl   $0x0,-0x4(%rbp)
jmp    115e <request_uri_is_valid_char+0x5e>
movzbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
jne    113c <request_uri_is_valid_char+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115e <request_uri_is_valid_char+0x5e>
movzbl -0x5(%rbp),%eax
cmp    $0xff,%eax
jne    1157 <request_uri_is_valid_char+0x57>
movl   $0x0,-0x4(%rbp)
jmp    115e <request_uri_is_valid_char+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_uri_is_valid_char>:
cmp    $0x21,%dil
setae  %al
not    %dil
test   $0x7f,%dil
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @request_uri_is_valid_char(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sle i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 127
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 255
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %2
br label %19
18: ; preds = %13
store i32 1, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @request_uri_is_valid_char(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 32
%3 = and i8 %0, 127
%4 = icmp ne i8 %3, 127
%5 = and i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void cfclos_(int *lundes, int *medium) {
  int fildes;
  if (medium) {
  }
  fildes = *lundes;
  close(fildes);
  return;
}


x86 assembly (clang, -O0):
<cfclos_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1130 <cfclos_+0x20>
jmp    1130 <cfclos_+0x20>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cfclos_(i32* nocapture %0, i32* nocapture readnone %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @close(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReloadGame(int /*<<< orphan*/);
void ReloadGameProc() { ReloadGame(0); }


x86 assembly (clang, -O0):
<ReloadGameProc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <ReloadGame@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReloadGameProc>:
xor    %edi,%edi
jmp    1030 <ReloadGame@plt>

LLVM IR (-O0):
define void @ReloadGameProc() {
%1 = call i32 @ReloadGame(i32 0)
ret void
}

LLVM IR (-O2):
define void @ReloadGameProc() {
%1 = tail call i32 @ReloadGame(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printVertical(int v) {
  if (v)
    printf("%c", '|');
  else
    printf("%c", ' ');
}


x86 assembly (clang, -O0):
<printVertical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113b <printVertical+0x2b>
lea    0xed4(%rip),%rdi
mov    $0x7c,%esi
call   1030 <printf@plt>
jmp    114c <printVertical+0x3c>
lea    0xebe(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVertical>:
test   %edi,%edi
mov    $0x20,%eax
mov    $0x7c,%esi
cmove  %eax,%esi
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @printVertical(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 124)
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 32)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printVertical(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8 32, i8 124
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}
int setBit_fun_int(int x, unsigned i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setBit_fun_int(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ setegid(int /*<<< orphan*/);
int /*<<< orphan*/ seteuid(int /*<<< orphan*/);
void change_user() {
  seteuid(getuid());
  setegid(getgid());
}


x86 assembly (clang, -O0):
<change_user>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%edi
call   1060 <seteuid@plt>
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,%edi
call   1050 <setegid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_user>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%edi
call   1060 <seteuid@plt>
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <setegid@plt>

LLVM IR (-O0):
define void @change_user() {
%1 = call i32 (...) @getuid()
%2 = call i32 @seteuid(i32 %1)
%3 = call i32 (...) @getgid()
%4 = call i32 @setegid(i32 %3)
ret void
}

LLVM IR (-O2):
define void @change_user() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 @seteuid(i32 %1)
%3 = tail call i32 (...) @getgid()
%4 = tail call i32 @setegid(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_backtrace(int);
void *time__Tm__localtime(void *self) {
  void *var;
  printf("NOT YET IMPLEMENTED nitni for time#Tm#localtime at "
         "lib/standard/time.nit:64,2--69,3\n");
  show_backtrace(1);
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<time__Tm__localtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <show_backtrace@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time__Tm__localtime>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <show_backtrace@plt>

LLVM IR (-O0):
@.str = [85 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#localtime at lib/standard/time.nit:64,2--69,3\0A\00"
define i8* @time__Tm__localtime(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @show_backtrace(i32 1)
br label %6
6: ; preds = %1
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@str = [84 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#localtime at lib/standard/time.nit:64,2--69,3\00"
define noalias i8* @time__Tm__localtime(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @show_backtrace(i32 1)
ret i8* undef
}
long D_GET_TAG(long s) { return (s & ~(0x80000000UL | 0x0fffffffUL)); }


x86 assembly (clang, -O0):
<D_GET_TAG>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffff70000000,%rax
ff ff ff
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<D_GET_TAG>:
movabs $0xffffffff70000000,%rax
ff ff ff
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @D_GET_TAG(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -2415919104
ret i64 %4
}

LLVM IR (-O2):
define i64 @D_GET_TAG(i64 %0) {
%2 = and i64 %0, -2415919104
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char pedir_letra() {
  char letra[10];
  printf("Escribe una letra:");
  scanf("%s", letra);
  return letra[0];
}


x86 assembly (clang, -O0):
<pedir_letra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa(%rbp),%rsi
lea    0xed4(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pedir_letra>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xe(%rsp),%al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Escribe una letra:\00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @pedir_letra() {
%1 = alloca [10 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = load i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
@.str = [19 x i8] c"Escribe una letra:\00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @pedir_letra() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
ret i8 %5
}
int hda_i915_exit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hda_i915_exit() {
ret i32 0
}
/* Variables and functions */
int lxadv();
int /*<<< orphan*/ lxadvch();
int lxinit(void) {
  lxadvch();
  return lxadv();
}


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

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

LLVM IR (-O0):
define i32 @lxinit() {
%1 = call i32 (...) @lxadvch()
%2 = call i32 (...) @lxadv()
ret i32 %2
}

LLVM IR (-O2):
define i32 @lxinit() {
%1 = tail call i32 (...) @lxadvch()
%2 = tail call i32 (...) @lxadv()
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ property;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
unsigned long get_XSelectionEvent_property(void *_p) {
  return (unsigned long)((XSelectionEvent *)_p)->property;
}


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

x86 assembly (clang, -O2):
<get_XSelectionEvent_property>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSelectionEvent_property(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSelectionEvent_property(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
void *vec_new_cap(size_t, int);
extern void *vec_new(size_t size) { return vec_new_cap(size, 1); }


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

x86 assembly (clang, -O2):
<vec_new>:
mov    $0x1,%esi
jmp    1030 <vec_new_cap@plt>

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

LLVM IR (-O2):
define i8* @vec_new(i64 %0) {
%2 = tail call i8* @vec_new_cap(i64 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgdecsw(int a) { lgen("%s\t%c%d", "decq", a); }


x86 assembly (clang, -O0):
<cgdecsw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdecsw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s\09%c%d\00"
@.str.1 = [5 x i8] c"decq\00"
define void @cgdecsw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s\09%c%d\00"
@.str.1 = [5 x i8] c"decq\00"
define void @cgdecsw(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GC_FREE(char *);
void utarray_str_dtor(void *elt) {
  char **eltc = (char **)elt;
  if (*eltc != NULL)
    GC_FREE(*eltc);
}


x86 assembly (clang, -O0):
<utarray_str_dtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <utarray_str_dtor+0x2e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <GC_FREE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utarray_str_dtor>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <utarray_str_dtor+0xd>
jmp    1030 <GC_FREE@plt>
ret

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

LLVM IR (-O2):
define void @utarray_str_dtor(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @GC_FREE(i8* %3)
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(int /*<<< orphan*/ *, int,
                                 int /*<<< orphan*/ *, int, int, int);
void pixel_avg_4x2(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 4, 2);
}


x86 assembly (clang, -O0):
<pixel_avg_4x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x4,%r8d
mov    $0x2,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_4x2>:
mov    $0x4,%r8d
mov    $0x2,%r9d
jmp    1030 <pixel_avg_wxh@plt>

LLVM IR (-O0):
define void @pixel_avg_4x2(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_avg_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 4, i32 2)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_4x2(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 4, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD5_Final(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Update(int /*<<< orphan*/ *, char const *,
                              int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void md5(const char in[], uint8_t out[]) {
  MD5_CTX ctx;
  if (out != 0 && in != 0) {
    MD5_Init(&ctx);
    MD5_Update(&ctx, in, strlen(in));
    MD5_Final(out, &ctx);
  }
}


x86 assembly (clang, -O0):
<md5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     119c <md5+0x5c>
cmpq   $0x0,-0x8(%rbp)
je     119c <md5+0x5c>
lea    -0x14(%rbp),%rdi
call   1050 <MD5_Init@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    -0x14(%rbp),%rdi
call   1060 <MD5_Update@plt>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <MD5_Final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
je     1186 <md5+0x46>
mov    %rsi,%r14
test   %rsi,%rsi
je     1186 <md5+0x46>
mov    %rdi,%rbx
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   1050 <MD5_Init@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1060 <MD5_Update@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <MD5_Final@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @md5(i8* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp ne i32* %1, null
%6 = icmp ne i8* %0, null
%7 = and i1 %6, %5
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 @MD5_Init(i32* %3)
%10 = call i32 @strlen(i8* %0)
%11 = call i32 @MD5_Update(i32* %3, i8* %0, i32 %10)
%12 = call i32 @MD5_Final(i32* %1, i32* %3)
br label %13
13: ; preds = %8, %2
ret void
}
int __eqdf2(double a1, double a2) {
  return *(long long *)&a1 == *(long long *)&a2;
}


x86 assembly (clang, -O0):
<__eqdf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__eqdf2>:
movq   %xmm0,%rcx
movq   %xmm1,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @__eqdf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = bitcast double* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast double* %4 to i64*
%8 = load i64, i64* %7
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__eqdf2(double %0, double %1) {
%3 = bitcast double %0 to i64
%4 = bitcast double %1 to i64
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int *argv2Ints(int, char **);
int /*<<< orphan*/ free(int *);
int maxArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int *heights = argv2Ints(argc - 1, argv + 1);
  printf("Result: %d\n", maxArea(heights, argc - 1));
  free(heights);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1050 <argv2Ints@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1060 <maxArea@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    -0x1(%rdi),%ebx
add    $0x8,%rsi
mov    %ebx,%edi
call   1050 <argv2Ints@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %ebx,%esi
call   1060 <maxArea@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Result: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = call i32* @argv2Ints(i32 %8, i8** %10)
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = call i32 @maxArea(i32* %12, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32*, i32** %6
%18 = call i32 @free(i32* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = add nsw i32 %0, -1
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = tail call i32* @argv2Ints(i32 %3, i8** %4)
%6 = tail call i32 @maxArea(i32* %5, i32 %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @free(i32* %5)
ret i32 0
}