xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ init_leds();
int /*<<< orphan*/ set_sequences();
int main(void) {
  (*(volatile unsigned long *)(0xE01FC000 + 0x000)) = 2;
  init_leds();
  while (1) {
    set_sequences();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xe01fc000,%eax
movq   $0x2,(%rax)
mov    $0x0,%al
call   1030 <init_leds@plt>
mov    $0x0,%al
call   1040 <set_sequences@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xe01fc000,%eax
movq   $0x2,(%rax)
xor    %eax,%eax
call   1030 <init_leds@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <set_sequences@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
%2 = call i32 (...) @init_leds()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @set_sequences()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
%1 = tail call i32 (...) @init_leds()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @set_sequences()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ print_int(char);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  char c;
  int num;
  c = '1';
  num = c;
  print_string("Should get 49, since '1' is equal to 49\n");
  print_int(num);
  print_string("\n");
  print_string("Should get 49, since '1' is equal to 49\n");
  print_int(c);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x31,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1040 <print_int@plt>
lea    0xed6(%rip),%rdi
call   1030 <print_string@plt>
lea    0xea3(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x1(%rbp),%edi
call   1040 <print_int@plt>
lea    0xeb5(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %r14,%rdi
call   1030 <print_string@plt>
mov    $0x31,%edi
call   1040 <print_int@plt>
lea    0xee3(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    %r14,%rdi
call   1030 <print_string@plt>
mov    $0x31,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Should get 49, since '1' is equal to 49\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i8
%2 = alloca i32
store i8 49, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
store i32 %4, i32* %2
%5 = call i32 @print_string(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = call i32 @print_int(i8 signext %7)
%9 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @print_string(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%11 = load i8, i8* %1
%12 = call i32 @print_int(i8 signext %11)
%13 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Should get 49, since '1' is equal to 49\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i8 signext 49)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @print_int(i8 signext 49)
%6 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read(int, char *, int);
int sprintf(char *, char *);
int /*<<< orphan*/ write(int, char *, int);
void connection_handler(int connection_fd) {
  int nbytes;
  char buffer[256];
  nbytes = read(connection_fd, buffer, 256);
  buffer[nbytes] = 0;
  nbytes = sprintf(buffer, "Shhh... I'm sleeping.\n");
  write(connection_fd, buffer, nbytes);
}


x86 assembly (clang, -O0):
<connection_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <read@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1050 <sprintf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <write@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connection_handler>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x100,%edx
call   1040 <read@plt>
cltq
movb   $0x0,(%rsp,%rax,1)
movups 0xeb7(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa2e676e697065,%rax
mov    %rax,0xf(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x16,%edx
call   1030 <write@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Shhh... I'm sleeping.\0A\00"
define void @connection_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [256 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 256)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %9
store i8 0, i8* %10
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%12 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%15 = load i32, i32* %3
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Shhh... I'm sleeping.\0A\00"
define void @connection_handler(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 256)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %5
store i8 0, i8* %6
%7 = call i32 @write(i32 %0, i8* %3, i32 22)
ret void
}
int allEvenBits(int x) {
  int t = 0x55;
  t |= t << 8;
  t |= t << 16;
  return !((x & t) ^ t);
}


x86 assembly (clang, -O0):
<allEvenBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x55,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allEvenBits>:
not    %edi
xor    %eax,%eax
test   $0x55555555,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @allEvenBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 85, i32* %3
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = load i32, i32* %3
%7 = or i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 16
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = and i32 %12, %13
%15 = load i32, i32* %3
%16 = xor i32 %14, %15
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @allEvenBits(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = icmp eq i32 %2, 1431655765
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler1(int signal) { printf("Signal %d received.\n", signal); }


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

x86 assembly (clang, -O2):
<handler1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"Signal %d received.\0A\00"
define void @handler1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tls_free() {
  printf("NOT IMPLEMENTED:"
         "pa_tls_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"NOT IMPLEMENTED:pa_tls_free\0A\00"
define i32 @pa_tls_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [28 x i8] c"NOT IMPLEMENTED:pa_tls_free\00"
define i32 @pa_tls_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void foo462() {}


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

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

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

LLVM IR (-O2):
define void @foo462() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
struct stat *malloc(int);
void *memcpy(struct stat *, struct stat *, int);
void *to_nit_file_stat(struct stat *st) {
  struct stat *stat_element;
  stat_element = malloc(sizeof(struct stat));
  return memcpy(stat_element, st, sizeof(struct stat));
}


x86 assembly (clang, -O0):
<to_nit_file_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_nit_file_stat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
pop    %rbx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i8* @to_nit_file_stat(%struct.stat* %0) {
%2 = alloca %struct.stat*
%3 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%4 = call %struct.stat* @malloc(i32 4)
store %struct.stat* %4, %struct.stat** %3
%5 = load %struct.stat*, %struct.stat** %3
%6 = load %struct.stat*, %struct.stat** %2
%7 = call i8* @memcpy(%struct.stat* %5, %struct.stat* %6, i32 4)
ret i8* %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i8* @to_nit_file_stat(%struct.stat* %0) {
%2 = tail call %struct.stat* @malloc(i32 4)
%3 = tail call i8* @memcpy(%struct.stat* %2, %struct.stat* %0, i32 4)
ret i8* %3
}
void *allocate(int nb) {
  void *mem;
  mem = calloc(nb, 1);
  if (mem == 0L)
    error("allocate in %s: not enuf memory (%d bytes)\n", (getparam("argv0")),
          nb);
  return (mem);
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1179 <allocate+0x49>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <getparam@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movslq %edi,%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116a <allocate+0x3a>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <getparam@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"allocate in %s: not enuf memory (%d bytes)\0A\00"
@.str.1 = [6 x i8] c"argv0\00"
define i8* @allocate(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @calloc(i64 %5, i64 1)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @getparam to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [44 x i8] c"allocate in %s: not enuf memory (%d bytes)\0A\00"
@.str.1 = [6 x i8] c"argv0\00"
define i8* @allocate(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @calloc(i64 %2, i64 1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getparam to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %0)
br label %8
8: ; preds = %5, %1
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ print_siginfo(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void handler(int sig, siginfo_t *si, void *uc) {
  printf("Caught signal %d\n", sig);
  print_siginfo(si);
  signal(sig, SIG_IGN);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <print_siginfo@plt>
mov    -0x4(%rbp),%edi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
call   1050 <signal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <print_siginfo@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <signal@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Caught signal %d\0A\00"
@SIG_IGN = global i32 0
define void @handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %5
%10 = call i32 @print_siginfo(i32* %9)
%11 = load i32, i32* %4
%12 = load i32, i32* @SIG_IGN
%13 = call i32 @signal(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Caught signal %d\0A\00"
@SIG_IGN = global i32 0
define void @handler(i32 %0, i32* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @print_siginfo(i32* %1)
%6 = load i32, i32* @SIG_IGN
%7 = tail call i32 @signal(i32 %0, i32 %6)
ret void
}
void termop_charset(struct ansiseq *s) {
  tnc_log_log(
      7, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c",
      208, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_charset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0xd0,%r8d
lea    0xf37(%rip),%r9
lea    0xf3f(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_charset>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf66(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0xd0,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_charset = [15 x i8] c"termop_charset\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_charset(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 208, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_charset, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_charset = [15 x i8] c"termop_charset\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_charset(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 208, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.termop_charset, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
const char *utf8proc_version(void) {
  return "2"
         "."
         "0"
         "."
         "2"
         "";
}


x86 assembly (clang, -O0):
<utf8proc_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"2.0.2\00"
define i8* @utf8proc_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"2.0.2\00"
define i8* @utf8proc_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Beta_Fire3(int value) {
  if (value) {
    cpc_key_press(0x66);
  } else {
    cpc_key_unpress(0x66);
  };
}


x86 assembly (clang, -O0):
<Joy_Beta_Fire3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Beta_Fire3+0x24>
mov    $0x66,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Beta_Fire3+0x2e>
mov    $0x66,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Beta_Fire3>:
test   %edi,%edi
je     112e <Joy_Beta_Fire3+0xe>
mov    $0x66,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x66,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Beta_Fire3(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 @cpc_key_press(i32 102)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 102)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Beta_Fire3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 102)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 102)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct str {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ str_catn(struct str *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void str_catz(struct str *sa, const char *s) { str_catn(sa, s, strlen(s)); }


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

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

LLVM IR (-O0):
%struct.str = type { i32 }
define void @str_catz(%struct.str* %0, i8* %1) {
%3 = alloca %struct.str*
%4 = alloca i8*
store %struct.str* %0, %struct.str** %3
store i8* %1, i8** %4
%5 = load %struct.str*, %struct.str** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @str_catn(%struct.str* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.str = type { i32 }
define void @str_catz(%struct.str* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @str_catn(%struct.str* %0, i8* %1, i32 %3)
ret void
}
int init_don_scheduler(struct dope_services *d) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.dope_services = type opaque
define i32 @init_don_scheduler(%struct.dope_services* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_therm_status_enable_DigitalReadout(void) {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 6;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rax) &
        ((((uint64_t)1 << (((0)) - ((0)) + 1)) - 1) << ((0)))) >>
       (0)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_therm_status_enable_DigitalReadout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
sar    $0x0,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_therm_status_enable_DigitalReadout+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_therm_status_enable_DigitalReadout+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_therm_status_enable_DigitalReadout>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x6,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_therm_status_enable_DigitalReadout() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 6, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @cpuid(i32 %7, i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = ashr i32 %10, 0
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpuid_therm_status_enable_DigitalReadout() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 6, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = and i32 %10, 1
ret i32 %11
}
/* Variables and functions */
int IFF_RUNNING;
int IFF_UP;
int net_set_flag(char *, int);
int net_nic_up(char *ifname) {
  return net_set_flag(ifname, (IFF_UP | IFF_RUNNING));
}


x86 assembly (clang, -O0):
<net_nic_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
call   1030 <net_set_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_nic_up>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <net_set_flag@plt>

LLVM IR (-O0):
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @net_nic_up(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @IFF_UP
%5 = load i32, i32* @IFF_RUNNING
%6 = or i32 %4, %5
%7 = call i32 @net_set_flag(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @net_nic_up(i8* %0) {
%2 = load i32, i32* @IFF_UP
%3 = load i32, i32* @IFF_RUNNING
%4 = or i32 %3, %2
%5 = tail call i32 @net_set_flag(i8* %0, i32 %4)
ret i32 %5
}
int main() {
  int a;
  int b;
  int am;
  int bm;
  am = a;
  bm = b;
  while (am != bm) {
    if (am > bm) {
      bm = bm + b;
    } else {
      am = am + a;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     114b <main+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    113d <main+0x3d>
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x46>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1117 <main+0x17>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int logand_funktion(int var1, int var2) { return (var1 < 2 && 4 < var2); }


x86 assembly (clang, -O0):
<logand_funktion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    1127 <logand_funktion+0x27>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logand_funktion>:
cmp    $0x2,%edi
setl   %al
cmp    $0x5,%esi
setge  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @logand_funktion(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 = icmp slt i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp slt i32 4, %8
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @logand_funktion(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 2
%4 = icmp sgt i32 %1, 4
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void Cyc_ignore(void *x) { ; }


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

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

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

LLVM IR (-O2):
define void @Cyc_ignore(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int write(int, char *, int);
ssize_t bdtun_fail_request(int fd) {
  ssize_t res = write(fd, "\0x01", 1);
  if (res != 1) {
    return res;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bdtun_fail_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1147 <bdtun_fail_request+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <bdtun_fail_request+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdtun_fail_request>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\00x01\00"
define i32 @bdtun_fail_request(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
int isdigit(int c) {
  return ((unsigned char)c >= '0' && (unsigned char)c <= '9');
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x5(%rbp)
jl     112a <isdigit+0x2a>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
movzbl %dil,%ecx
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 57
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void putstr(char *s) {
  while (*s)
    putchar(*s++);
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <putstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int test_imm_58uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x58,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_58uint64_lowword_reg>:
test   $0x58,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_58uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 88
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fd_close(int);
int real_dup2(int, int);
int dup2(int old, int _new) {
  fd_close(_new);
  return real_dup2(old, _new);
}


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

x86 assembly (clang, -O2):
<dup2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <fd_close@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <real_dup2@plt>

LLVM IR (-O0):
define i32 @dup2(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 = call i32 @fd_close(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @real_dup2(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 @fd_close(i32 %1)
%4 = tail call i32 @real_dup2(i32 %0, i32 %1)
ret i32 %4
}
int usrdraw(w)
struct xtwindow *w;
{
  wl_twdraw(w);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.xtwindow = type opaque
define i32 @usrdraw(%struct.xtwindow* %0) {
%2 = alloca %struct.xtwindow*
store %struct.xtwindow* %0, %struct.xtwindow** %2
%3 = load %struct.xtwindow*, %struct.xtwindow** %2
%4 = call i32 (%struct.xtwindow*, ...) bitcast (i32 (...)* @wl_twdraw to i32 (%struct.xtwindow*, ...)*)(%struct.xtwindow* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.xtwindow = type opaque
define i32 @usrdraw(%struct.xtwindow* %0) {
%2 = tail call i32 (%struct.xtwindow*, ...) bitcast (i32 (...)* @wl_twdraw to i32 (%struct.xtwindow*, ...)*)(%struct.xtwindow* %0)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y_root;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xkey_y_root(void *_p) {
  return (int)((XEvent *)_p)->xkey.y_root;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xkey_y_root>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xkey_y_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(void *);
void semaphoreCleanupHandler(void *arg) { pthread_mutex_unlock(arg); }


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

x86 assembly (clang, -O2):
<semaphoreCleanupHandler>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define void @semaphoreCleanupHandler(i8* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i8* %0)
ret void
}
double calc_temp_penalty(temp, tempcrit)
double temp, tempcrit;
{
  double value;
  if (temp > tempcrit)
    value = (temp - tempcrit) * (temp - tempcrit) / (8);
  return (value);
}


x86 assembly (clang, -O0):
<calc_temp_penalty>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1147 <calc_temp_penalty+0x47>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_temp_penalty>:
subsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calc_temp_penalty(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fsub double %10, %11
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fsub double %13, %14
%16 = fmul double %12, %15
%17 = fdiv double %16, 8.000000e+00
store double %17, double* %5
br label %18
18: ; preds = %9, %2
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @calc_temp_penalty(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fmul double %3, %3
%5 = fmul double %4, 1.250000e-01
ret double %5
}
void finalize_world(struct world *world) {}


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

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

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

LLVM IR (-O2):
%struct.world = type opaque
define void @finalize_world(%struct.world* nocapture %0) {
ret void
}
int main(void) { "\x80"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\80\00"
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int hidden_func();
int main(int argc, char **argv) { return hidden_func(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hidden_func()
ret i32 %3
}
int foo() { return 99; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 99
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 99
}
/* Variables and functions */
char *b_strcrem(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *a = "   a bcde fg\th  ij 	kl	mnopqrstuvwxyz", *v = " \t";
  printf("%s\n", b_strcrem(a, v));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xee5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <b_strcrem@plt>
mov    %rax,%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c" a bcde fg\09h ij \09kl\09mnopqrstuvwxyz\00"
@.str.1 = [3 x i8] c" \09\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i8* @b_strcrem(i8* %4, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c" a bcde fg\09h ij \09kl\09mnopqrstuvwxyz\00"
@.str.1 = [3 x i8] c" \09\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @b_strcrem(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int x, y;
  y = scanf("%d", &x);
  printf("y = %d\n", y);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"y = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int __ii_idx_i(int i, int cxt, int value) { return i + cxt + value; }


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

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

LLVM IR (-O0):
define i32 @__ii_idx_i(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__ii_idx_i(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}