xunge/DecIR huggingface dataset:
int main() {
  char *a, *b;
  a = "abcdef";
  if (*(a + 2) != 'c')
    return 1;
  if (*(2 + a) != 'c')
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x63,%eax
je     1133 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1157 <main+0x57>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x63,%eax
je     1150 <main+0x50>
movl   $0x2,-0x4(%rbp)
jmp    1157 <main+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char const *strong_l2();
const char *__attribute__((section(".test.b"))) sibcall_strong_l2(void) {
  return strong_l2();
}


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

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

LLVM IR (-O0):
define i8* @sibcall_strong_l2() section ".test.b" {
%1 = call i8* (...) @strong_l2()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_strong_l2() section ".test.b" {
%1 = tail call i8* (...) @strong_l2()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
code_segment_gtext() { output_line(".text"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c".text\00"
define i32 @code_segment_gtext() {
%1 = alloca i32
%2 = call i32 @output_line(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c".text\00"
define i32 @code_segment_gtext() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl_32a(uint32_t x) { return (x << 8) | (x >> 24); }


x86 assembly (clang, -O0):
<rotl_32a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl_32a>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x18,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @rotl_32a(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 24
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print1(int);
int /*<<< orphan*/ sem_add(int, int);
int /*<<< orphan*/ sem_sub(int, int);
int /*<<< orphan*/ semid_init(int *);
void child() {
  int semid;
  semid_init(&semid);
  while (1) {
    sem_sub(semid, 1);
    print1(100);
    sem_add(semid, 1);
  }
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <semid_init@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1060 <sem_sub@plt>
mov    $0x64,%edi
call   1040 <print1@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <sem_add@plt>
jmp    1151 <child+0x11>

x86 assembly (clang, -O2):
<child>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <semid_init@plt>
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1060 <sem_sub@plt>
mov    $0x64,%edi
call   1040 <print1@plt>
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1050 <sem_add@plt>
jmp    1150 <child+0x10>

LLVM IR (-O0):
define void @child() {
%1 = alloca i32
%2 = call i32 @semid_init(i32* %1)
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %1
%5 = call i32 @sem_sub(i32 %4, i32 1)
%6 = call i32 @print1(i32 100)
%7 = load i32, i32* %1
%8 = call i32 @sem_add(i32 %7, i32 1)
br label %3
}

LLVM IR (-O2):
define void @child() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @semid_init(i32* %1)
br label %4
4: ; preds = %4, %0
%5 = load i32, i32* %1
%6 = call i32 @sem_sub(i32 %5, i32 1)
%7 = call i32 @print1(i32 100)
%8 = load i32, i32* %1
%9 = call i32 @sem_add(i32 %8, i32 1)
br label %4
}
/* Variables and functions */
int OK;
int PDC_set_80x25(void) { return (OK); }


x86 assembly (clang, -O0):
<PDC_set_80x25>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_set_80x25>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @PDC_set_80x25() {
%1 = load i32, i32* @OK
ret i32 %1
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_set_80x25() {
%1 = load i32, i32* @OK
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ internal_urcu_lock();
int /*<<< orphan*/ internal_urcu_unlock();
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ urcu_remove_reader(int /*<<< orphan*/);
void urcu_unregister_thread(void) {
  internal_urcu_lock();
  urcu_remove_reader(pthread_self());
  internal_urcu_unlock();
}


x86 assembly (clang, -O0):
<urcu_unregister_thread>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <internal_urcu_lock@plt>
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <urcu_remove_reader@plt>
mov    $0x0,%al
call   1040 <internal_urcu_unlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<urcu_unregister_thread>:
push   %rax
xor    %eax,%eax
call   1030 <internal_urcu_lock@plt>
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <urcu_remove_reader@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <internal_urcu_unlock@plt>

LLVM IR (-O0):
define void @urcu_unregister_thread() {
%1 = call i32 (...) @internal_urcu_lock()
%2 = call i32 (...) @pthread_self()
%3 = call i32 @urcu_remove_reader(i32 %2)
%4 = call i32 (...) @internal_urcu_unlock()
ret void
}

LLVM IR (-O2):
define void @urcu_unregister_thread() {
%1 = tail call i32 (...) @internal_urcu_lock()
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @urcu_remove_reader(i32 %2)
%4 = tail call i32 (...) @internal_urcu_unlock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_chld(int signo) { printf("child exit\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"child exit\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"child exit\00"
define void @sig_chld(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int fun1353() { return 1353; }


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

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

LLVM IR (-O0):
define i32 @fun1353() {
ret i32 1353
}

LLVM IR (-O2):
define i32 @fun1353() {
ret i32 1353
}
unsigned nextPowerOf2(unsigned number) {
  unsigned powOf2 = 1;
  while (powOf2 < number) {
    powOf2 <<= 1;
  }
  return powOf2;
}


x86 assembly (clang, -O0):
<nextPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1128 <nextPowerOf2+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <nextPowerOf2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextPowerOf2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1110 <nextPowerOf2+0x10>
ret

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

LLVM IR (-O2):
define i32 @nextPowerOf2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int getVarLongSize(int64_t input) {
  for (unsigned char x = 1; x < 10; ++x)
    if (((input & -1) << (x * 7)) == 0)
      return x;
  return 10;
}


x86 assembly (clang, -O0):
<getVarLongSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movb   $0x1,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jge    114e <getVarLongSize+0x4e>
mov    -0x8(%rbp),%eax
and    $0xffffffff,%eax
movzbl -0x9(%rbp),%ecx
imul   $0x7,%ecx,%ecx
shl    %cl,%eax
cmp    $0x0,%eax
jne    113c <getVarLongSize+0x3c>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <getVarLongSize+0x55>
jmp    1141 <getVarLongSize+0x41>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    110b <getVarLongSize+0xb>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVarLongSize>:
test   $0x1ffffff,%edi
je     112a <getVarLongSize+0x2a>
test   $0x3ffff,%edi
je     1130 <getVarLongSize+0x30>
test   $0x7ff,%edi
je     1136 <getVarLongSize+0x36>
test   $0xf,%dil
mov    $0x4,%ecx
mov    $0xa,%eax
cmove  %ecx,%eax
ret
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @getVarLongSize(i32 %0) {
%2 = and i32 %0, 33554431
%3 = icmp eq i32 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = and i32 %0, 262143
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = and i32 %0, 2047
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = and i32 %0, 15
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i32 4, i32 10
br label %14
14: ; preds = %10, %7, %4, %1
%15 = phi i32 [ 3, %7 ], [ 2, %4 ], [ 1, %1 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int random_uint32();
int random_range(int max) { return random_uint32() % max; }


x86 assembly (clang, -O0):
<random_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random_uint32@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_range>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random_uint32@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_range(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @random_uint32()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @random_range(i32 %0) {
%2 = tail call i32 (...) @random_uint32()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy10(int *x, int *y) { memcpy(x, y, 10); }


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

x86 assembly (clang, -O2):
<copy10>:
mov    $0xa,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy10(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 = call i32 @memcpy(i32* %5, i32* %6, i32 10)
ret void
}

LLVM IR (-O2):
define void @copy10(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkpalin(int);
int main(void) {
  int num = 123321;
  checkpalin(num);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 123321, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @checkpalin(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @checkpalin(i32 123321)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct ssh {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
void audit_session_key_free_body(struct ssh *ssh, int ctos, pid_t pid,
                                 uid_t uid) {}


x86 assembly (clang, -O0):
<audit_session_key_free_body>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.ssh = type { i32 }
define void @audit_session_key_free_body(%struct.ssh* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
float Sum_S(int i, float **delta) { return (delta[i][i]); }


x86 assembly (clang, -O0):
<Sum_S>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sum_S>:
movslq %edi,%rax
mov    (%rsi,%rax,8),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @Sum_S(i32 %0, float** %1) {
%3 = alloca i32
%4 = alloca float**
store i32 %0, i32* %3
store float** %1, float*** %4
%5 = load float**, float*** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds float*, float** %5, i64 %7
%9 = load float*, float** %8
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %9, i64 %11
%13 = load float, float* %12
ret float %13
}

LLVM IR (-O2):
define float @Sum_S(i32 %0, float** nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds float*, float** %1, i64 %3
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 %3
%7 = load float, float* %6
ret float %7
}
void pwm2_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @pwm2_iomux_config() {
ret void
}
int vx_need_resched(struct task_struct *p, int slice, int cpu) {
  return (slice == 0);
}


x86 assembly (clang, -O0):
<vx_need_resched>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vx_need_resched>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
ret

LLVM IR (-O0):
%struct.task_struct = type opaque
define i32 @vx_need_resched(%struct.task_struct* %0, i32 %1, i32 %2) {
%4 = alloca %struct.task_struct*
%5 = alloca i32
%6 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @vx_need_resched(%struct.task_struct* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char *rmalloc(int);
char *substring(char *string, int32_t start, int32_t end) {
  char *subbuff = rmalloc(sizeof(char) * (end - start));
  memcpy(subbuff, &string[start], (end - start));
  subbuff[end - start] = '\0';
  return subbuff;
}


x86 assembly (clang, -O0):
<substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <rmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
sub    %esi,%edx
movslq %edx,%rbx
mov    %ebx,%edi
call   1030 <rmalloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1040 <memcpy@plt>
movb   $0x0,0x0(%rbp,%rbx,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substring(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = mul i64 1, %11
%13 = trunc i64 %12 to i32
%14 = call i8* @rmalloc(i32 %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = sub nsw i32 %20, %21
%23 = call i32 @memcpy(i8* %15, i8* %19, i32 %22)
%24 = load i8*, i8** %7
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = sub nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %24, i64 %28
store i8 0, i8* %29
%30 = load i8*, i8** %7
ret i8* %30
}

LLVM IR (-O2):
define i8* @substring(i8* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = sext i32 %4 to i64
%6 = tail call i8* @rmalloc(i32 %4)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @memcpy(i8* %6, i8* %8, i32 %4)
%10 = getelementptr inbounds i8, i8* %6, i64 %5
store i8 0, i8* %10
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __infer_nondet_int();
int getc(FILE *stream) {
  FILE tmp;
  tmp = *stream;
  return __infer_nondet_int();
}


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

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

LLVM IR (-O0):
define i32 @getc(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = call i32 (...) @__infer_nondet_int()
ret i32 %6
}

LLVM IR (-O2):
define i32 @getc(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
unsigned XXH_versionNumber(void) { return (0 * 100 * 100 + 6 * 100 + 2); }


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

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

LLVM IR (-O0):
define i32 @XXH_versionNumber() {
ret i32 602
}

LLVM IR (-O2):
define i32 @XXH_versionNumber() {
ret i32 602
}
/* Variables and functions */
scalar_t__ sqrt(int);
int isPrime(int n) {
  int i;
  int root = (int)sqrt(n);
  for (i = 2; i < root + 1; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    116d <isPrime+0x5d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115a <isPrime+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1174 <isPrime+0x64>
jmp    115f <isPrime+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <isPrime+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %rax,%rsi
mov    $0x1,%ecx
cmp    $0x2,%esi
jl     114f <isPrime+0x3f>
neg    %esi
mov    $0x2,%edi
nopl   0x0(%rax)
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     114d <isPrime+0x3d>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%edx
add    $0x1,%edx
mov    %edx,%edi
cmp    $0x1,%eax
jne    1130 <isPrime+0x20>
jmp    114f <isPrime+0x3f>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i64 @sqrt(i32 %0)
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 2
br i1 %4, label %12, label %8
5: ; preds = %8
%6 = add nuw i32 %9, 1
%7 = icmp eq i32 %9, %3
br i1 %7, label %12, label %8
8: ; preds = %1, %5
%9 = phi i32 [ %6, %5 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int *calloc(size_t, int);
int **malloc(size_t);
int **create_table(size_t height, size_t width) {
  int **table = malloc(height * sizeof(int *));
  for (int i = 0; i < height; i++) {
    table[i] = calloc(width, sizeof(int));
  }
  return table;
}


x86 assembly (clang, -O0):
<create_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1181 <create_table+0x61>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1148 <create_table+0x28>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_table>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x0(,%rdi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
test   %r15,%r15
je     116a <create_table+0x4a>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <create_table+0x30>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i32** @create_table(i64 %0, i64 %1) {
%3 = shl i64 %0, 3
%4 = tail call i32** @malloc(i64 %3)
%5 = icmp eq i64 %0, 0
br i1 %5, label %6, label %7
6: ; preds = %7, %2
ret i32** %4
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ 0, %2 ]
%9 = tail call i32* @calloc(i64 %1, i32 4)
%10 = getelementptr inbounds i32*, i32** %4, i64 %8
store i32* %9, i32** %10
%11 = add nuw i64 %8, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void die(const char *s) {
  write(STDOUT_FILENO, "\x1b[2J", 4);
  write(STDOUT_FILENO, "\x1b[H", 3);
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xeb8(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    (%r14),%edi
lea    0xea9(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%7 = load i8*, i8** %2
%8 = call i32 @perror(i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @die(i8* nocapture %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = load i32, i32* @STDOUT_FILENO
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int config_set(void *, char *, char *);
int config_ini_property_cb(char *key, char *value, void *data) {
  return config_set(data, key, value);
}


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

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

LLVM IR (-O0):
define i32 @config_ini_property_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @config_set(i8* %7, i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @config_ini_property_cb(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @config_set(i8* %2, i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x9a() {
  Assert_real((isxdigit(154) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              775, ("isxdigit should be 0 for 0x9a"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x9a\00"
define void @t_isxdigit_0x9a() {
%1 = call i64 @isxdigit(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x9a\00"
define void @t_isxdigit_0x9a() {
%1 = tail call i64 @isxdigit(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void poll_forever(void (*poll_func)(void), int poll_delay) {
  while (1) {
    sleep(poll_delay);
    poll_func();
  }
}


x86 assembly (clang, -O0):
<poll_forever>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <sleep@plt>
call   *-0x8(%rbp)
jmp    111f <poll_forever+0xf>

x86 assembly (clang, -O2):
<poll_forever>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <sleep@plt>
call   *%rbx
jmp    1120 <poll_forever+0x10>

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

LLVM IR (-O2):
define void @poll_forever(void ()* nocapture %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @sleep(i32 %1)
tail call void %0()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void Assert(int assertion, const char *error) {
  if (!assertion) {
    printf("Assertion Failed: %s\n", error);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<Assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1153 <Assert+0x33>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Assert>:
test   %edi,%edi
je     1125 <Assert+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Assertion Failed: %s\0A\00"
define void @Assert(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Assertion Failed: %s\0A\00"
define void @Assert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c)) {
    return c + ('a' - 'A');
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int INT = 8, IF = 0;
  printf("%d", INT + IF);
  printf("%d", INT / 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
int register_netdev(struct net_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define i32 @register_netdev(%struct.net_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(unsigned char);
int isxdigit(int c) {
  unsigned char bc = c;
  if (isdigit(bc))
    return 1;
  bc |= 0x20;
  return ((bc >= 'a') && (bc <= 'f'));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1140 <isxdigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1174 <isxdigit+0x64>
movzbl -0x9(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0xa(%rbp)
jl     1169 <isxdigit+0x59>
movzbl -0x9(%rbp),%eax
cmp    $0x66,%eax
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = call i64 @isdigit(i8 zeroext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %26
11: ; preds = %1
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = or i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = icmp sge i32 %17, 97
br i1 %18, label %19, label %23
19: ; preds = %11
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = icmp sle i32 %21, 102
br label %23
23: ; preds = %19, %11
%24 = phi i1 [ false, %11 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %10
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i64 @isdigit(i8 zeroext %2)
%4 = icmp ne i64 %3, 0
%5 = and i32 %0, 223
%6 = add nsw i32 %5, -65
%7 = icmp ult i32 %6, 6
%8 = select i1 %4, i1 true, i1 %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int isascii(int c) { return ((c & ~0x7f) == 0); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
void swap(char **str1, char **str2) {
  char *tmp = *str1;
  *str1 = *str2;
  *str2 = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Type definitions */
typedef int uint16_t;
struct argp_state {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void print_version(FILE *stream, struct argp_state *state) {
  fprintf(stream,
          "test"
          ".jgfs2 0x%04x\n",
          (((uint16_t)(0x00) * 0x100) + (uint16_t)(0x01)));
}


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

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

LLVM IR (-O0):
%struct.argp_state = type { i32 }
@.str = [19 x i8] c"test.jgfs2 0x%04x\0A\00"
define void @print_version(i32* %0, %struct.argp_state* %1) {
%3 = alloca i32*
%4 = alloca %struct.argp_state*
store i32* %0, i32** %3
store %struct.argp_state* %1, %struct.argp_state** %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
%struct.argp_state = type { i32 }
@.str = [19 x i8] c"test.jgfs2 0x%04x\0A\00"
define void @print_version(i32* nocapture %0, %struct.argp_state* nocapture readnone %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_109(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 109)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_ch_109>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x6d,%eax
jne    1144 <fn_ch_109+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_ch_109+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ch_109>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x6d,%ecx
jne    1133 <fn_ch_109+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_ch_109(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @next_utf8(i8* %5, i32* %4)
%7 = icmp eq i32 %6, 109
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn_ch_109(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 109
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ get_partner_status();
int /*<<< orphan*/ log_trace(char *);
void wait_for_mam() {
  if (0) {
    log_trace("ENTERING: wait_for_mam");
  }
  while (!get_partner_status()) {
    ;
  }
  if (0) {
    log_trace("LEAVING: wait_for_mam");
  }
}


x86 assembly (clang, -O0):
<wait_for_mam>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_for_mam+0x9>
mov    $0x0,%al
call   1030 <get_partner_status@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <wait_for_mam+0x25>
jmp    113a <wait_for_mam+0x2a>
jmp    1119 <wait_for_mam+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_mam>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_partner_status@plt>
test   %eax,%eax
je     1120 <wait_for_mam+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_for_mam() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @get_partner_status()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @wait_for_mam() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @get_partner_status()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}