xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xfocus;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xfocus_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xfocus.serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xfocus_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xfocus_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xfocus_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int get_fan_nr();
int wrap_get_fan_nr(struct activity *a) { return (get_fan_nr()); }


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

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

LLVM IR (-O0):
%struct.activity = type { i32 }
define i32 @wrap_get_fan_nr(%struct.activity* %0) {
%2 = alloca %struct.activity*
store %struct.activity* %0, %struct.activity** %2
%3 = call i32 (...) @get_fan_nr()
ret i32 %3
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define i32 @wrap_get_fan_nr(%struct.activity* nocapture readnone %0) {
%2 = tail call i32 (...) @get_fan_nr()
ret i32 %2
}
int test_bit(int nr, const unsigned long *addr) {
  return 1UL & (addr[((nr) / (sizeof(unsigned long) * 8))] >>
                (nr & ((sizeof(unsigned long) * 8) - 1)));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 64
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load i64, i64* %9
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = and i64 %12, 63
%14 = lshr i64 %10, %13
%15 = and i64 1, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = lshr i64 %3, 6
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load i64, i64* %5
%7 = and i64 %3, 63
%8 = lshr i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 1
ret i32 %10
}
int foo(void) {
  int a, b, c, d, e, f;
  asm("# Magic instruction" : "=r"(a), "=r"(d) : "r"(0) : "eax");
  asm("# Magic instruction" : "=r"(b), "=r"(e) : "r"(0) : "edx");
  asm("# Magic instruction" : "=r"(c), "=r"(f) : "r"(0) : "ecx");
  return a + b + c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %esi,%esi
add    %ecx,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call { i32, i32 } asm "# Magic instruction", "=r,=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 0)
%8 = extractvalue { i32, i32 } %7, 0
%9 = extractvalue { i32, i32 } %7, 1
store i32 %8, i32* %1
store i32 %9, i32* %4
%10 = call { i32, i32 } asm "# Magic instruction", "=r,=r,r,~{edx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%11 = extractvalue { i32, i32 } %10, 0
%12 = extractvalue { i32, i32 } %10, 1
store i32 %11, i32* %2
store i32 %12, i32* %5
%13 = call { i32, i32 } asm "# Magic instruction", "=r,=r,r,~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%14 = extractvalue { i32, i32 } %13, 0
%15 = extractvalue { i32, i32 } %13, 1
store i32 %14, i32* %3
store i32 %15, i32* %6
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call { i32, i32 } asm "# Magic instruction", "=r,=r,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = extractvalue { i32, i32 } %1, 0
%3 = tail call { i32, i32 } asm "# Magic instruction", "=r,=r,r,~{edx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%4 = extractvalue { i32, i32 } %3, 0
%5 = tail call { i32, i32 } asm "# Magic instruction", "=r,=r,r,~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%6 = extractvalue { i32, i32 } %5, 0
%7 = add nsw i32 %4, %2
%8 = add nsw i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int x = -1;
  int y = (x > 0) ? 1 : 0;
  printf("%d\n", y);
  printf("%s\n", (y) ? "True" : "False");
  return (EXIT_SUCCESS);
}


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)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%ecx
lea    0xeb2(%rip),%rsi
lea    0xea6(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"True\00"
@.str.3 = [6 x i8] c"False\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.3 = [6 x i8] c"False\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int is_first_in_group_NestedParty(size_t __tag) {
  return (__tag == (524)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_first_in_group_NestedParty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x20c,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_in_group_NestedParty>:
xor    %eax,%eax
cmp    $0x20c,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_first_in_group_NestedParty(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 524
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_first_in_group_NestedParty(i64 %0) {
%2 = icmp eq i64 %0, 524
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ t;

/* Variables and functions */
int open(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncat(char *, char const *, int);
int devopen(const char *dev, int flags) {
  char t[1024];
  strcpy(t, "/dev/");
  strncat(t, dev, sizeof(t) - 5);
  return open(t, flags);
}


x86 assembly (clang, -O0):
<devopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3fb,%edx
call   1040 <strncat@plt>
lea    -0x410(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <open@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devopen>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xeb8(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x3fb,%edx
call   1040 <strncat@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1050 <open@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/dev/\00"
define i32 @devopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @strncat(i8* %8, i8* %9, i32 1019)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @open(i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"/dev/\00"
define i32 @devopen(i8* %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strncat(i8* %4, i8* %0, i32 1019)
%7 = call i32 @open(i8* %4, i32 %1)
ret i32 %7
}
int _max(int a, int b) { return (a > b) ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int foo(double __x) { return __x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void hexdump_ns(unsigned char *d, int l) {
  int i;
  for (i = 0; i < l; i++) {
    printf("%2.2X", d[i]);
  }
}


x86 assembly (clang, -O0):
<hexdump_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <hexdump_ns+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <hexdump_ns+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump_ns>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <hexdump_ns+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <hexdump_ns+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%2.2X\00"
define void @hexdump_ns(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int atocol(char *strng, int len) {
  register int col;
  col = (strng[0] & 0137) - 'A';
  if (len == 2)
    col = ((col + 1) * 26) + ((strng[1] & 0137) - 'A');
  return (col);
}


x86 assembly (clang, -O0):
<atocol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x5f,%eax
sub    $0x41,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1141 <atocol+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
imul   $0x1a,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0x5f,%ecx
sub    $0x41,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atocol>:
movzbl (%rdi),%eax
and    $0x5f,%eax
cmp    $0x2,%esi
jne    1122 <atocol+0x22>
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
movzbl 0x1(%rdi),%eax
and    $0x5f,%eax
add    %ecx,%eax
add    $0xfffff93f,%eax
ret
add    $0xffffffbf,%eax
ret

LLVM IR (-O0):
define i32 @atocol(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 i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, 95
%11 = sub nsw i32 %10, 65
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %25
14: ; preds = %2
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = mul nsw i32 %16, 26
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = and i32 %21, 95
%23 = sub nsw i32 %22, 65
%24 = add nsw i32 %17, %23
store i32 %24, i32* %5
br label %25
25: ; preds = %14, %2
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @atocol(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = and i8 %3, 95
%5 = zext i8 %4 to i32
%6 = add nsw i32 %5, -65
%7 = icmp eq i32 %1, 2
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = mul nuw nsw i32 %5, 26
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = and i8 %11, 95
%13 = zext i8 %12 to i32
%14 = add nsw i32 %9, -1729
%15 = add nsw i32 %14, %13
br label %16
16: ; preds = %8, %2
%17 = phi i32 [ %15, %8 ], [ %6, %2 ]
ret i32 %17
}
/* Variables and functions */
char *strchr(char *, char);
char *libamg_str_next_token(char *str, char sep) {
  char *token = strchr(str, sep);
  if (!token)
    return token;
  token[0] = '\0';
  return ++token;
}


x86 assembly (clang, -O0):
<libamg_str_next_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114b <libamg_str_next_token+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <libamg_str_next_token+0x52>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libamg_str_next_token>:
push   %rax
call   1030 <strchr@plt>
test   %rax,%rax
je     1124 <libamg_str_next_token+0x14>
movb   $0x0,(%rax)
add    $0x1,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @libamg_str_next_token(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
store i8 0, i8* %3
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ validity(int, int);
void angry_prof(int tick) {
  int n, k;
  int i;
  for (i = 0; i < tick; i++) {
    scanf("%d %d", &n, &k);
    validity(n, k);
  }
}


x86 assembly (clang, -O0):
<angry_prof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116b <angry_prof+0x4b>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <validity@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <angry_prof+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angry_prof>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    115f <angry_prof+0x3f>
mov    %edi,%ebx
lea    0xecb(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%r12
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <validity@plt>
add    $0xffffffff,%ebx
jne    1140 <angry_prof+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @angry_prof(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %15
7: ; preds = %1, %7
%8 = phi i32 [ %13, %7 ], [ 0, %1 ]
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @validity(i32 %10, i32 %11)
%13 = add nuw nsw i32 %8, 1
%14 = icmp eq i32 %13, %0
br i1 %14, label %15, label %7
15: ; preds = %7, %1
ret void
}
int test_imm_83int16_reg(short val) {
  return ((val) & (-0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff7d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_83int16_reg>:
test   $0xff7d,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_83int16_reg(i16 signext %0) {
%2 = and i16 %0, -131
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int iLog2(int x) {
  int i;
  for (i = 32; i; i--) {
    if (x & (1 << (i - 1))) {
      return i;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<iLog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1153 <iLog2+0x53>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1140 <iLog2+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <iLog2+0x5a>
jmp    1145 <iLog2+0x45>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <iLog2+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iLog2>:
mov    $0x20,%edx
mov    $0x1d,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edx,%eax
lea    0x2(%rcx),%edx
movzbl %dl,%edx
bt     %edx,%edi
jb     113c <iLog2+0x3c>
lea    0x1(%rcx),%edx
movzbl %dl,%edx
bt     %edx,%edi
jb     1142 <iLog2+0x42>
cmp    $0xffffffff,%ecx
je     1148 <iLog2+0x48>
lea    -0x3(%rax),%edx
bt     %ecx,%edi
lea    -0x3(%rcx),%ecx
jae    1110 <iLog2+0x10>
add    $0xfffffffe,%eax
ret
add    $0x3,%ecx
mov    %ecx,%eax
ret
add    $0x2,%ecx
mov    %ecx,%eax
ret
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @iLog2(i32 %0) {
br label %2
2: ; preds = %15, %1
%3 = phi i32 [ 32, %1 ], [ %16, %15 ]
%4 = add nsw i32 %3, -1
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %0
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = add nsw i32 %3, -2
%10 = shl nuw i32 1, %9
%11 = and i32 %10, %0
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = icmp eq i32 %9, 0
br i1 %14, label %20, label %15
15: ; preds = %13
%16 = add nsw i32 %3, -3
%17 = shl nuw i32 1, %16
%18 = and i32 %17, %0
%19 = icmp eq i32 %18, 0
br i1 %19, label %2, label %20
20: ; preds = %15, %13, %8, %2
%21 = phi i32 [ %3, %2 ], [ %4, %8 ], [ %9, %13 ], [ %9, %15 ]
ret i32 %21
}
void freeIntArray(int **someArray, int rows) {
  int i;
  for (i = 0; i < rows; i++) {
    free(someArray[i]);
  }
  free(someArray);
}


x86 assembly (clang, -O0):
<freeIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeIntArray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeIntArray+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeIntArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeIntArray+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeIntArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeIntArray(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
void gtk_debug_flag_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_debug_flag_get_type() {
ret void
}
void str_copy(char *t, char *s) {
  while (*t++ = *s++)
    ;
}


x86 assembly (clang, -O0):
<str_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <str_copy+0x3b>
jmp    110c <str_copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <str_copy+0x10>
ret

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

LLVM IR (-O2):
define void @str_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int on_release(struct fs_context *context) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.fs_context = type opaque
define i32 @on_release(%struct.fs_context* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int is_separator(char c) { return strchr(" ,)]}:#\n", c) != NULL; }


x86 assembly (clang, -O0):
<is_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_separator>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c" ,)]}:#\0A\00"
define i32 @is_separator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c" ,)]}:#\0A\00"
define i32 @is_separator(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timeval {
  int member_0;
  long member_1;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int espera_envio(int descriptor, int segundos) {
  struct timeval plazo = {segundos, 0L};
  fd_set fds;
  FD_ZERO(&fds);
  FD_SET(descriptor, &fds);
  return (select(descriptor + 1, (fd_set *)NULL, &fds, (fd_set *)NULL, &plazo));
}


x86 assembly (clang, -O0):
<espera_envio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x1c(%rbp),%rdx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<espera_envio>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    %esi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
xor    %esi,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @espera_envio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i64 0, i64* %9
%10 = call i32 @FD_ZERO(i32* %6)
%11 = load i32, i32* %3
%12 = call i32 @FD_SET(i32 %11, i32* %6)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
%15 = call i32 @select(i32 %14, i32* null, i32* %6, i32* null, %struct.timeval* %5)
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @espera_envio(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = alloca i32
%5 = bitcast %struct.timeval* %3 to i8*
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i64 0, i64* %7
%8 = bitcast i32* %4 to i8*
%9 = call i32 @FD_ZERO(i32* %4)
%10 = call i32 @FD_SET(i32 %0, i32* %4)
%11 = add nsw i32 %0, 1
%12 = call i32 @select(i32 %11, i32* null, i32* %4, i32* null, %struct.timeval* %3)
ret i32 %12
}
/* Type definitions */
struct event_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_del_timer(struct event_loop *, int);
int /*<<< orphan*/ printf(char *);
void beatonce(struct event_loop *loop, int id, void *data) {
  printf("heartbeat only once after 5s\n");
  event_del_timer(loop, id);
}


x86 assembly (clang, -O0):
<beatonce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <event_del_timer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beatonce>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <event_del_timer@plt>

LLVM IR (-O0):
%struct.event_loop = type { i32 }
@.str = [30 x i8] c"heartbeat only once after 5s\0A\00"
define void @beatonce(%struct.event_loop* %0, i32 %1, i8* %2) {
%4 = alloca %struct.event_loop*
%5 = alloca i32
%6 = alloca i8*
store %struct.event_loop* %0, %struct.event_loop** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = load %struct.event_loop*, %struct.event_loop** %4
%9 = load i32, i32* %5
%10 = call i32 @event_del_timer(%struct.event_loop* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.event_loop = type { i32 }
@str = [29 x i8] c"heartbeat only once after 5s\00"
define void @beatonce(%struct.event_loop* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @event_del_timer(%struct.event_loop* %0, i32 %1)
ret void
}
void asmCPUID(unsigned int eax, unsigned int words[4]) {
  asm("cpuid"
      : "=a"(words[0]), "=b"(words[1]), "=c"(words[2]), "=d"(words[3])
      : "a"(eax), "c"(0));
}


x86 assembly (clang, -O0):
<asmCPUID>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<asmCPUID>:
push   %rbx
mov    %edi,%eax
xor    %ecx,%ecx
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %ecx,0x8(%rsi)
mov    %edx,0xc(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @asmCPUID(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %3
%14 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %13, i32 0)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @asmCPUID(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprintabs(FILE *fp, int depth) {
  int i;
  for (i = 0; i < depth; i++) {
    fprintf(fp, "\t");
  }
  return;
}


x86 assembly (clang, -O0):
<fprintabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <fprintabs+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fprintabs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintabs>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <fprintabs+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x9,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <fprintabs+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @fprintabs(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 9, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct feed_tty {
  int dummy;
};
struct feed_client {
  int dummy;
};

/* Variables and functions */
char feed_tty_init(struct feed_client *const, struct feed_tty *const);
char feed_tty_init_cb(void *const p_object, struct feed_client *const p_client,
                      void const *const p_descriptor) {
  char b_result;
  struct feed_tty *const p_tty = (struct feed_tty *)(p_object);
  (void)(p_descriptor);
  b_result = feed_tty_init(p_client, p_tty);
  return b_result;
}


x86 assembly (clang, -O0):
<feed_tty_init_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <feed_tty_init@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_tty_init_cb>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <feed_tty_init@plt>

LLVM IR (-O0):
%struct.feed_client = type { i32 }
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_init_cb(i8* %0, %struct.feed_client* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.feed_client*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca %struct.feed_tty*
store i8* %0, i8** %4
store %struct.feed_client* %1, %struct.feed_client** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.feed_tty*
store %struct.feed_tty* %10, %struct.feed_tty** %8
%11 = load i8*, i8** %6
%12 = load %struct.feed_client*, %struct.feed_client** %5
%13 = load %struct.feed_tty*, %struct.feed_tty** %8
%14 = call signext i8 @feed_tty_init(%struct.feed_client* %12, %struct.feed_tty* %13)
store i8 %14, i8* %7
%15 = load i8, i8* %7
ret i8 %15
}

LLVM IR (-O2):
%struct.feed_client = type { i32 }
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_init_cb(i8* %0, %struct.feed_client* %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to %struct.feed_tty*
%5 = tail call signext i8 @feed_tty_init(%struct.feed_client* %1, %struct.feed_tty* %4)
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyEnL1free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<yyEnL1free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yyEnL1free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int base10len(int n) {
  int len = 0;
  while (n) {
    n /= 10;
    ++len;
  }
  return len;
}


x86 assembly (clang, -O0):
<base10len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <base10len+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <base10len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base10len>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <base10len+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <base10len+0x10>
ret

LLVM IR (-O0):
define i32 @base10len(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* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %2
%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
ret i32 %13
}

LLVM IR (-O2):
define i32 @base10len(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
char *_(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int quick_usage(const char *path) {
  fprintf(stderr, _("Try \"%s -h | more\" for more information.\n"), path);
  return 2;
}


x86 assembly (clang, -O0):
<quick_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xec1(%rip),%rdi
call   1040 <_@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_usage>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
lea    0xeca(%rip),%rdi
call   1040 <_@plt>
mov    %ebp,%edi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Try \22%s -h | more\22 for more information.\0A\00"
define i32 @quick_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i8* @_(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* %4, i8* %5)
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Try \22%s -h | more\22 for more information.\0A\00"
define i32 @quick_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @_(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32 %2, i8* %3, i8* %0)
ret i32 2
}