xunge/DecIR huggingface dataset:
/* Variables and functions */
int getc(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
void clear_scanf_buffer() {
  int ch = getc(stdin);
  ungetc(ch, stdin);
  if (ch != 10) {
    while (getchar() != '\n')
      ;
  }
}


x86 assembly (clang, -O0):
<clear_scanf_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
cmpl   $0xa,-0x4(%rbp)
je     1186 <clear_scanf_buffer+0x56>
jmp    1169 <clear_scanf_buffer+0x39>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1181 <clear_scanf_buffer+0x51>
jmp    1169 <clear_scanf_buffer+0x39>
jmp    1186 <clear_scanf_buffer+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_scanf_buffer>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
call   1050 <getc@plt>
mov    %eax,%ebx
mov    (%r14),%esi
mov    %eax,%edi
call   1040 <ungetc@plt>
cmp    $0xa,%ebx
je     116b <clear_scanf_buffer+0x3b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1160 <clear_scanf_buffer+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @clear_scanf_buffer() {
%1 = alloca i32
%2 = load i32, i32* @stdin
%3 = call i32 @getc(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* @stdin
%6 = call i32 @ungetc(i32 %4, i32 %5)
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %16
9: ; preds = %0
br label %10
10: ; preds = %14, %9
%11 = call signext i8 (...) @getchar()
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
br label %16
16: ; preds = %15, %0
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @clear_scanf_buffer() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
%3 = load i32, i32* @stdin
%4 = tail call i32 @ungetc(i32 %2, i32 %3)
%5 = icmp eq i32 %2, 10
br i1 %5, label %9, label %6
6: ; preds = %0, %6
%7 = tail call signext i8 (...) @getchar()
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %6
9: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello World");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void instruc_28() {}


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

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

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

LLVM IR (-O2):
define void @instruc_28() {
ret void
}
struct task_struct *get_current(void) {
  register unsigned long sp asm("sp");
  return (struct task_struct *)(sp & ~0x1fff);
}


x86 assembly (clang, -O0):
<get_current>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
and    $0xffffffffffffe000,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define %struct.task_struct* @get_current() {
%1 = alloca i64
%2 = load i64, i64* %1
%3 = and i64 %2, -8192
%4 = inttoptr i64 %3 to %struct.task_struct*
ret %struct.task_struct* %4
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define noalias %struct.task_struct* @get_current() {
ret %struct.task_struct* null
}
int algorytm(int a, int b) {
  int c = 0;
  while (b != 0) {
    if (b % 2 != 0)
      c += a;
    a *= 2;
    b /= 2;
  }
  return (c);
}


x86 assembly (clang, -O0):
<algorytm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1154 <algorytm+0x54>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1138 <algorytm+0x38>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1111 <algorytm+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<algorytm>:
xor    %eax,%eax
test   %esi,%esi
je     112e <algorytm+0x2e>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %esi,%edx
and    $0x1,%edx
neg    %edx
and    %edi,%edx
add    %edx,%eax
add    %edi,%edi
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
add    $0x1,%esi
cmp    $0x2,%esi
mov    %ecx,%esi
ja     1110 <algorytm+0x10>
ret

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

LLVM IR (-O2):
define i32 @algorytm(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %12, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 %7
%11 = add nsw i32 %10, %5
%12 = shl nsw i32 %7, 1
%13 = sdiv i32 %6, 2
%14 = add i32 %6, 1
%15 = icmp ult i32 %14, 3
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ medusaDataReadyTimed(int, int /*<<< orphan*/, int);
int medusaCheckSocket(int socket) {
  if (medusaDataReadyTimed(socket, 0, 1) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<medusaCheckSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <medusaDataReadyTimed@plt>
cmp    $0x0,%rax
jne    1140 <medusaCheckSocket+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <medusaCheckSocket+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaCheckSocket>:
push   %rax
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <medusaDataReadyTimed@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @medusaCheckSocket(i32 %0) {
%2 = tail call i64 @medusaDataReadyTimed(i32 %0, i32 0, i32 1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rcx;

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


x86 assembly (clang, -O0):
<cpuid_misc_enable_xTPRMessageDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-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    -0x10(%rbp),%eax
and    $0x4000,%eax
sar    $0xe,%eax
cmp    $0x1,%eax
jne    1157 <cpuid_misc_enable_xTPRMessageDisable+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <cpuid_misc_enable_xTPRMessageDisable+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cpuid_misc_enable_xTPRMessageDisable() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 1, 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* %4
%10 = and i32 %9, 16384
%11 = ashr i32 %10, 14
%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_misc_enable_xTPRMessageDisable() {
%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 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = lshr i32 %10, 14
%12 = and i32 %11, 1
ret i32 %12
}
unsigned getb32(const unsigned char *buf) {
  unsigned long v;
  v = (unsigned long)buf[0] << 24;
  v |= (unsigned long)buf[1] << 16;
  v |= (unsigned long)buf[2] << 8;
  v |= (unsigned long)buf[3];
  return v;
}


x86 assembly (clang, -O0):
<getb32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getb32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int strcmp(char *, char *);
int mount__compare_proc_mounts(const void *a, const void *b) {
  return -strcmp(*((char **)a), *((char **)b));
}


x86 assembly (clang, -O0):
<mount__compare_proc_mounts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount__compare_proc_mounts>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <strcmp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mount__compare_proc_mounts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @mount__compare_proc_mounts(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_architecture(void) { printf("ARM64"); }


x86 assembly (clang, -O0):
<get_architecture>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ARM64\00"
define void @get_architecture() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ARM64\00"
define void @get_architecture() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
void getcharEOF() {
  int ch;
  while ((ch = getchar()) != EOF) {
    putchar(ch);
    printf(" --%c-- \n", ch);
  }
}


x86 assembly (clang, -O0):
<getcharEOF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
je     116d <getcharEOF+0x3d>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
jmp    1138 <getcharEOF+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcharEOF>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
je     116f <getcharEOF+0x3f>
mov    %eax,%ebp
lea    0xeb0(%rip),%rbx
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
jne    1150 <getcharEOF+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [10 x i8] c" --%c-- \0A\00"
define void @getcharEOF() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("bin2o - Converts a binary file into a .o file.\n"
         "Usage: bin2o [-a XX] [-n] [-i] [-b XX] [-e XX] [-s XX] infile "
         "outfile label\n"
         "  -i    - create an iop-compatible .o file.\n"
         "  -n    - don't add label_size symbol.\n"
         "  -a XX - set .data section alignment to XX.\n"
         "          (has to be a power of two).\n"
         "  -b XX - start reading file at this offset.\n"
         "  -e XX - stop reading file at this offset.\n"
         "  -s XX - force output data to be of this size.\n"
         "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [428 x i8] c"bin2o - Converts a binary file into a .o file.\0AUsage: bin2o [-a XX] [-n] [-i] [-b XX] [-e XX] [-s XX] infile outfile label\0A -i - create an iop-compatible .o file.\0A -n - don't add label_size symbol.\0A -a XX - set .data section alignment to XX.\0A (has to be a power of two).\0A -b XX - start reading file at this offset.\0A -e XX - stop reading file at this offset.\0A -s XX - force output data to be of this size.\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([428 x i8], [428 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [427 x i8] c"bin2o - Converts a binary file into a .o file.\0AUsage: bin2o [-a XX] [-n] [-i] [-b XX] [-e XX] [-s XX] infile outfile label\0A -i - create an iop-compatible .o file.\0A -n - don't add label_size symbol.\0A -a XX - set .data section alignment to XX.\0A (has to be a power of two).\0A -b XX - start reading file at this offset.\0A -e XX - stop reading file at this offset.\0A -s XX - force output data to be of this size.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([427 x i8], [427 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ CallBack2(int, void *, void *);
const char *strchr2(const char *str, int ch) {
  return (const char *)CallBack2(173, (void *)str, (void *)ch);
}


x86 assembly (clang, -O0):
<strchr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
mov    $0xad,%edi
call   1030 <CallBack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr2>:
mov    %rdi,%rax
movslq %esi,%rdx
mov    $0xad,%edi
mov    %rax,%rsi
jmp    1030 <CallBack2@plt>

LLVM IR (-O0):
define i8* @strchr2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i64 @CallBack2(i32 173, i8* %5, i8* %8)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @strchr2(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @CallBack2(i32 173, i8* %0, i8* %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
void yy_1_SignatureAutoCorrect(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_SignatureAutoCorrect(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_SignatureAutoCorrect(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
            int /*<<< orphan*/ *);
int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) {
  return syscall(211, rgid, egid, sgid);
}


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

x86 assembly (clang, -O2):
<getresgid>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xd3,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getresgid(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 = load i32*, i32** %6
%10 = call i32 @syscall(i32 211, i32* %7, i32* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @getresgid(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @syscall(i32 211, i32* %0, i32* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn))
watchdog_expired(__attribute__((unused)) const int sig) {
  fprintf(stderr, "receive: watchdog timer expired, assuming we hang - "
                  "force terminating run\n");
  fflush(stderr);
  exit(100);
}


x86 assembly (clang, -O0):
<watchdog_expired>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x64,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<watchdog_expired>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x64,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"receive: watchdog timer expired, assuming we hang - force terminating run\0A\00"
define void @watchdog_expired(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @exit(i32 100)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"receive: watchdog timer expired, assuming we hang - force terminating run\0A\00"
define void @watchdog_expired(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 100)
unreachable
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int16_t phi_difference(uint16_t from, uint16_t to) {
  int32_t difference = to - from;
  if (difference >= 32768)
    return difference - 65536;
  else if (difference < -32768)
    return difference + 65536;
  else
    return difference;
}


x86 assembly (clang, -O0):
<phi_difference>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x8000,-0x10(%rbp)
jl     1130 <phi_difference+0x30>
mov    -0x10(%rbp),%eax
sub    $0x10000,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <phi_difference+0x53>
cmpl   $0xffff8000,-0x10(%rbp)
jge    114d <phi_difference+0x4d>
mov    -0x10(%rbp),%eax
add    $0x10000,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <phi_difference+0x53>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi_difference>:
sub    %edi,%esi
lea    0x10000(%rsi),%eax
cmp    $0xffff8000,%esi
cmovge %esi,%eax
lea    -0x10000(%rsi),%ecx
cmp    $0x8000,%esi
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @phi_difference(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = icmp sgt i32 %3, 32767
%5 = add nsw i32 %3, -65536
%6 = icmp slt i32 %3, -32768
%7 = add nsw i32 %3, 65536
%8 = select i1 %6, i32 %7, i32 %3
%9 = select i1 %4, i32 %5, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRELLIPSE_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 4, torev);
}


x86 assembly (clang, -O0):
<U_WMRELLIPSE_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x4,%esi
call   1030 <U_WMRCORE_N16_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRELLIPSE_swap>:
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

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

/* Variables and functions */
size_t list_meter_uint8_t(const void *el) { return sizeof(uint8_t); }


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

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

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

LLVM IR (-O2):
define i64 @list_meter_uint8_t(i8* nocapture readnone %0) {
ret i64 4
}
void simon_hardware_test_savecrypto() {}


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

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

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

LLVM IR (-O2):
define void @simon_hardware_test_savecrypto() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void display(int *S, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf(" %d ", S[i]);
  }
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c" %d \00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t *__wcschrnul(const wchar_t *wcs, const wchar_t wc) {
  while (*wcs != L'\0')
    if (*wcs == wc)
      break;
    else
      ++wcs;
  return (wchar_t *)wcs;
}


x86 assembly (clang, -O0):
<__wcschrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     113d <__wcschrnul+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112c <__wcschrnul+0x2c>
jmp    113d <__wcschrnul+0x3d>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <__wcschrnul+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wcschrnul>:
mov    %rdi,%rax
add    $0xfffffffffffffffc,%rax
nopw   0x0(%rax,%rax,1)
mov    0x4(%rax),%ecx
add    $0x4,%rax
test   %ecx,%ecx
je     111f <__wcschrnul+0x1f>
cmp    %esi,%ecx
jne    1110 <__wcschrnul+0x10>
ret

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

LLVM IR (-O2):
define i32* @__wcschrnul(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %9, %3 ]
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = icmp eq i32 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i32, i32* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x87() {
  Assert_real((isascii(135) == 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_isascii.c",
              680, ("isascii should be 0 for 0x87"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x87>:
push   %rax
mov    $0x87,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x87\00"
define void @t_isascii_0x87() {
%1 = call i64 @isascii(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x87\00"
define void @t_isascii_0x87() {
%1 = tail call i64 @isascii(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, float *);
float _scanFloat() {
  float result;
  scanf("%f", &result);
  return result;
}


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

x86 assembly (clang, -O2):
<_scanFloat>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @_scanFloat() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int matches_prefix(const char *line, const char *prefix) {
  return !strncmp(line, prefix, strlen(prefix));
}


x86 assembly (clang, -O0):
<matches_prefix>:
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   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches_prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @matches_prefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @matches_prefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int do_sum(int n) {
  int i, sum;
  sum = 0;
  for (i = 0; i < n; ++i) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<do_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <do_sum+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <do_sum+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_sum>:
test   %edi,%edi
jle    1118 <do_sum+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @do_sum(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
int execute_msgrcv() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_msgrcv() {
ret i32 0
}
int findNextChar(char *pString) {
  int i = 0;
  while (*(pString + i) != 0 &&
         (*(pString + i) == ' ' || *(pString + i) == '\t'))
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<findNextChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     115e <findNextChar+0x5e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xe(%rbp)
je     1158 <findNextChar+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116e <findNextChar+0x6e>
jmp    117c <findNextChar+0x7c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <findNextChar+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextChar>:
xor    %eax,%eax
jmp    1114 <findNextChar+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rdi,%rax,1),%ecx
cmp    $0x20,%cl
je     1110 <findNextChar+0x10>
cmp    $0x9,%cl
je     1110 <findNextChar+0x10>
ret

LLVM IR (-O0):
define i32 @findNextChar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %32, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %30
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 32
br i1 %19, label %28, label %20
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 9
br label %28
28: ; preds = %20, %12
%29 = phi i1 [ true, %12 ], [ %27, %20 ]
br label %30
30: ; preds = %28, %4
%31 = phi i1 [ false, %4 ], [ %29, %28 ]
br i1 %31, label %32, label %35
32: ; preds = %30
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %4
35: ; preds = %30
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @findNextChar(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 9, label %6
i8 32, label %6
]
6: ; preds = %2, %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int foo(__m128 y, int size, ...) {
  int __attribute((aligned(16))) xxx;
  xxx = 2;
  bar(&xxx);
  return size;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
movl   $0x2,(%rsp)
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 returned %1, ...) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%5 = call i32 @bar(i32* %3)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int catcher(Display *d, XErrorEvent *e) { return 0; }


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

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

LLVM IR (-O0):
define i32 @catcher(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @catcher(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *config_get_option(char const *);
long conv_char2long(char const *, long);
long config_get_loption(const char *key, long err_return) {
  const char *optstr = config_get_option(key);
  return conv_char2long(optstr, err_return);
}


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

x86 assembly (clang, -O2):
<config_get_loption>:
push   %rbx
mov    %rsi,%rbx
call   1030 <config_get_option@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <conv_char2long@plt>

LLVM IR (-O0):
define i64 @config_get_loption(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = call i8* @config_get_option(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %4
%10 = call i64 @conv_char2long(i8* %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @config_get_loption(i8* %0, i64 %1) {
%3 = tail call i8* @config_get_option(i8* %0)
%4 = tail call i64 @conv_char2long(i8* %3, i64 %1)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char const *, size_t, int, int /*<<< orphan*/ *);
int msgpack_fbuffer_write(void *data, const char *buf, size_t len) {
  return (1 == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1;
}


x86 assembly (clang, -O0):
<msgpack_fbuffer_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    %eax,%esi
mov    $0x1,%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgpack_fbuffer_write>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @msgpack_fbuffer_write(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = call i32 @fwrite(i8* %7, i64 %8, i32 1, i32* %10)
%12 = icmp eq i32 1, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 -1
ret i32 %14
}

LLVM IR (-O2):
define i32 @msgpack_fbuffer_write(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i32* %4)
%6 = icmp ne i32 %5, 1
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bulk_erase_PIC24(int);
void bulk_erase_P24FJ(unsigned char doRestore) { bulk_erase_PIC24(0x404F); }


x86 assembly (clang, -O0):
<bulk_erase_P24FJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x404f,%edi
call   1030 <bulk_erase_PIC24@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bulk_erase_P24FJ>:
mov    $0x404f,%edi
jmp    1030 <bulk_erase_PIC24@plt>

LLVM IR (-O0):
define void @bulk_erase_P24FJ(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @bulk_erase_PIC24(i32 16463)
ret void
}

LLVM IR (-O2):
define void @bulk_erase_P24FJ(i8 zeroext %0) {
%2 = tail call i32 @bulk_erase_PIC24(i32 16463)
ret void
}
void Method3() { asm("foo:"); }


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

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

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

LLVM IR (-O2):
define void @Method3() {
tail call void asm sideeffect "foo:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}