xunge/DecIR huggingface dataset:
void normal2x_generic_output(void *data, unsigned *out_width,
                             unsigned *out_height, unsigned width,
                             unsigned height) {
  *out_width = width << 1;
  *out_height = height << 1;
}


x86 assembly (clang, -O0):
<normal2x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal2x_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @normal2x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = shl i32 %11, 1
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %10
%15 = shl i32 %14, 1
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @normal2x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
void AtomicBarrier() { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @AtomicBarrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @AtomicBarrier() {
fence seq_cst
ret void
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t getuid(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @getuid() {
ret i32 42
}

LLVM IR (-O2):
define i32 @getuid() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ sys_cputs(char *, int);
void cputchar(int ch) {
  char c = ch;
  sys_cputs(&c, 1);
}


x86 assembly (clang, -O0):
<cputchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
call   1030 <sys_cputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <sys_cputs@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @cputchar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = call i32 @sys_cputs(i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @cputchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @sys_cputs(i8* %2, i32 1)
ret void
}
/* Type definitions */
typedef int nbits;

/* Variables and functions */
int /*<<< orphan*/ memset(unsigned long *, int /*<<< orphan*/, int);
void bitmap_clear_all(unsigned long *bitmap, unsigned int nbits) {
  memset(bitmap, 0,
         (((nbits) + (sizeof(long) * 8) - 1) / (sizeof(long) * 8)) *
             sizeof(*bitmap));
}


x86 assembly (clang, -O0):
<bitmap_clear_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    $0x40,%rax
sub    $0x1,%rax
shr    $0x6,%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_clear_all>:
mov    %esi,%edx
add    $0x3f,%rdx
shr    $0x3,%rdx
and    $0xfffffff8,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bitmap_clear_all(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = add i64 %7, 64
%9 = sub i64 %8, 1
%10 = udiv i64 %9, 64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i32 @memset(i64* %5, i32 0, i32 %12)
ret void
}

LLVM IR (-O2):
define void @bitmap_clear_all(i64* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = add nuw nsw i64 %3, 63
%5 = lshr i64 %4, 3
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1073741816
%8 = tail call i32 @memset(i64* %0, i32 0, i32 %7)
ret void
}
/* Variables and functions */
int bar(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", bar(0));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @bar(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int toupper(int);
int __toupper_l(int c, locale_t l) { return toupper(c); }


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

x86 assembly (clang, -O2):
<__toupper_l>:
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define i32 @__toupper_l(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @toupper(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__toupper_l(i32 %0, i32 %1) {
%3 = tail call i32 @toupper(i32 %0)
ret i32 %3
}
void ecspi4_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @ecspi4_iomux_config() {
ret void
}
int isleap(long year) {
  return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    113d <isleap+0x3d>
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    $0x1,%al
cmp    $0x0,%rdx
mov    %al,-0x9(%rbp)
jne    1155 <isleap+0x55>
mov    -0x8(%rbp),%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %rdi,%rax
imul   %rcx
test   $0x3,%dil
jne    1139 <isleap+0x39>
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
imul   $0x64,%rdx,%rcx
mov    %rdi,%rdx
mov    $0x1,%eax
sub    %rcx,%rdx
je     1139 <isleap+0x39>
ret
movabs $0x8f5c28f5c28f5c29,%rax
28 5c 8f
imul   %rax,%rdi
movabs $0x51eb851eb851eb0,%rcx
b8 1e 05
add    %rdi,%rcx
ror    $0x4,%rcx
movabs $0xa3d70a3d70a3d7,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @isleap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = srem i64 %3, 4
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %2
%8 = srem i64 %7, 100
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i64, i64* %2
%12 = srem i64 %11, 400
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isleap(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp ne i64 %2, 0
%4 = srem i64 %0, 100
%5 = icmp eq i64 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i64 %0, 400
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ kputc(unsigned char);
void kpstr(const char *s) {
  const char *s_ptr = s;
  unsigned char c;
  while (c = *s_ptr++) {
    kputc(c);
  }
}


x86 assembly (clang, -O0):
<kpstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     114e <kpstr+0x3e>
movzbl -0x11(%rbp),%edi
call   1030 <kputc@plt>
jmp    1124 <kpstr+0x14>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @kpstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @kputc(i8 zeroext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void NMI_Handler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @NMI_Handler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @NMI_Handler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int test_imm_94int8_mem(signed char *val) {
  return ((*val) & (0x94 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_94int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x94,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_94int8_mem>:
testb  $0x94,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_94int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -108
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dump_string(char *, int /*<<< orphan*/ *);
void dump_string_array(char **strings, int num_strings, FILE *fp) {
  int i;
  for (i = 0; i < num_strings; i++)
    dump_string(strings[i], fp);
  return;
}


x86 assembly (clang, -O0):
<dump_string_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <dump_string_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <dump_string@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <dump_string_array+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_string_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <dump_string_array+0x35>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <dump_string@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dump_string_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dump_string_array(i8** nocapture %0, i32 %1, i32* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @dump_string(i8* %10, i32* %2)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
unsigned xmult(unsigned a) {
  unsigned r = a << 1;
  if (a & (1U << 31)) {
    r ^= 0x04C11DB7U;
  }
  return r;
}


x86 assembly (clang, -O0):
<xmult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     112c <xmult+0x2c>
mov    -0x8(%rbp),%eax
xor    $0x4c11db7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmult>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
xor    $0x4c11db7,%eax
test   %edi,%edi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xmult(i32 %0) {
%2 = shl i32 %0, 1
%3 = icmp sgt i32 %0, -1
%4 = xor i32 %2, 79764919
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_initialize_number_of_standard_polynomials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(23, &length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_standard_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x17,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_standard_polynomials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x17,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_initialize_number_of_standard_polynomials(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 23, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_standard_polynomials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 23, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void qsort_swap(void *p1, void *p2, size_t size) {
  char buffer[size];
  memcpy(buffer, p1, size);
  memcpy(p1, p2, size);
  memcpy(p2, buffer, size);
}


x86 assembly (clang, -O0):
<qsort_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_swap>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @qsort_swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %7
%11 = alloca i8, i64 %9
store i64 %9, i64* %8
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %19, i8* %11, i64 %20)
%22 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @qsort_swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8, i64 %2
%5 = call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = call i32 @memcpy(i8* %1, i8* %4, i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ stdin;
int my_getc() { return feof(stdin) ? -1 : getchar(); }


x86 assembly (clang, -O0):
<my_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%rax
je     114d <my_getc+0x2d>
mov    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <my_getc+0x37>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getc>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
test   %rax,%rax
je     113b <my_getc+0x1b>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <getchar@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @my_getc() {
%1 = load i32, i32* @stdin
%2 = call i64 @feof(i32 %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %7
5: ; preds = %0
%6 = call i32 (...) @getchar()
br label %7
7: ; preds = %5, %4
%8 = phi i32 [ -1, %4 ], [ %6, %5 ]
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @my_getc() {
%1 = load i32, i32* @stdin
%2 = tail call i64 @feof(i32 %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @getchar()
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %5, %4 ], [ -1, %0 ]
ret i32 %7
}
int test_imm_19uint16_reg(unsigned short val) {
  return ((val) & (-0x19 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_19uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -25
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float lado;
  printf("Lado do quadrado: ");
  scanf("%f", &lado);
  printf("Area: %f\n", lado * lado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Lado do quadrado: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"Area: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Lado do quadrado: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"Area: %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, %5
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
unsigned int rbits32(unsigned int w) {
  w = ((w >> 1) & 0x55555555) | ((w << 1) & 0xaaaaaaaa);
  w = ((w >> 2) & 0x33333333) | ((w << 2) & 0xcccccccc);
  w = ((w >> 4) & 0x0f0f0f0f) | ((w << 4) & 0xf0f0f0f0);
  w = ((w >> 8) & 0x00ff00ff) | ((w << 8) & 0xff00ff00);
  w = ((w >> 16) & 0x0000ffff) | ((w << 16) & 0xffff0000);
  return w;
}


x86 assembly (clang, -O0):
<rbits32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
and    $0xaaaaaaaa,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
and    $0xcccccccc,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0f0f0f0,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00ff00,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
and    $0xffff0000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbits32>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @rbits32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = shl i32 %6, 1
%8 = and i32 %7, -1431655766
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = load i32, i32* %2
%14 = shl i32 %13, 2
%15 = and i32 %14, -858993460
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = lshr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = load i32, i32* %2
%21 = shl i32 %20, 4
%22 = and i32 %21, -252645136
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = lshr i32 %24, 8
%26 = and i32 %25, 16711935
%27 = load i32, i32* %2
%28 = shl i32 %27, 8
%29 = and i32 %28, -16711936
%30 = or i32 %26, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = lshr i32 %31, 16
%33 = and i32 %32, 65535
%34 = load i32, i32* %2
%35 = shl i32 %34, 16
%36 = and i32 %35, -65536
%37 = or i32 %33, %36
store i32 %37, i32* %2
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @rbits32(i32 %0) {
%2 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct memalloc {
  int dummy;
};

/* Variables and functions */
void memalloc_reset2(struct memalloc *, int /*<<< orphan*/);
void memalloc_reset(struct memalloc *ma) { return memalloc_reset2(ma, 0); }


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

x86 assembly (clang, -O2):
<memalloc_reset>:
xor    %esi,%esi
jmp    1030 <memalloc_reset2@plt>

LLVM IR (-O0):
%struct.memalloc = type { i32 }
define void @memalloc_reset(%struct.memalloc* %0) {
%2 = alloca %struct.memalloc*
store %struct.memalloc* %0, %struct.memalloc** %2
%3 = load %struct.memalloc*, %struct.memalloc** %2
ret void
}

LLVM IR (-O2):
%struct.memalloc = type { i32 }
define void @memalloc_reset(%struct.memalloc* %0) {
tail call void @memalloc_reset2(%struct.memalloc* %0, i32 0)
ret void
}
int fun350() { return 350; }


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

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

LLVM IR (-O0):
define i32 @fun350() {
ret i32 350
}

LLVM IR (-O2):
define i32 @fun350() {
ret i32 350
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ouch(int sig) { printf("\nOUCH! - I got signal %d\n", sig); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"\0AOUCH! - I got signal %d\0A\00"
define void @ouch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AOUCH! - I got signal %d\0A\00"
define void @ouch(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x38() {
  Assert_real((isxdigit(56)),
              "/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",
              285, ("isxdigit should be 1 for 8"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x38>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x11d,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x38>:
push   %rax
mov    $0x38,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x11d,%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 = [27 x i8] c"isxdigit should be 1 for 8\00"
define void @t_isxdigit_0x38() {
%1 = call i32 @isxdigit(i32 56)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([27 x i8], [27 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 = [27 x i8] c"isxdigit should be 1 for 8\00"
define void @t_isxdigit_0x38() {
%1 = tail call i32 @isxdigit(i32 56)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void glmNot3(bool out[3], const bool x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = !x[i];
}


x86 assembly (clang, -O0):
<glmNot3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1151 <glmNot3+0x51>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <glmNot3+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmNot3>:
xor    %eax,%eax
cmpl   $0x0,(%rsi)
sete   %al
mov    %eax,(%rdi)
xor    %eax,%eax
cmpl   $0x0,0x4(%rsi)
sete   %al
mov    %eax,0x4(%rdi)
xor    %eax,%eax
cmpl   $0x0,0x8(%rsi)
sete   %al
mov    %eax,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmNot3(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
store i32 %5, i32* %0
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %9, i32* %10
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %14, i32* %15
ret void
}
/* Variables and functions */
int unsetenv(char const *);
int os_unsetenv(const char *name) { return unsetenv(name); }


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

x86 assembly (clang, -O2):
<os_unsetenv>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define i32 @os_unsetenv(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret i32 %2
}
int clz(unsigned int x) {
  if (__builtin_clz(x))
    return x;
  return -1;
}


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cmp    $0x0,%eax
je     1124 <clz+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112b <clz+0x2b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
test   %edi,%edi
mov    $0xffffffff,%eax
cmovns %edi,%eax
ret

LLVM IR (-O0):
define i32 @clz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @clz(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 %0, i32 -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void put_ln() { printf("\n"); }


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

x86 assembly (clang, -O2):
<put_ln>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @put_ln() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
int main(void) {
  int x = 101;
  double y = 42.42;
  printf((_Generic((x), int : "%d", double : "%f", default : "%x")), x);
  puts("");
  ;
  printf((_Generic((y), int : "%d", double : "%f", default : "%x")), y);
  puts("");
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x65,-0x8(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rdi
mov    $0x65,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
movsd  0xeac(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 101, i32* %2
store double 4.242000e+01, double* %3
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = load double, double* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 101)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double 4.242000e+01)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  int z = 0;
  while (x > 0) {
    x--;
    if (x == y)
      z = 1;
  }
  assert(z == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    114c <main+0x3c>
movl   $0x1,-0x10(%rbp)
jmp    1126 <main+0x16>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ empty();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
int main() {
  test();
  empty();
  printf("Test OK\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Test OK\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = call i32 (...) @empty()
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Test OK\00"
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @empty()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct _info {
  int dummy;
};

/* Variables and functions */
int scan_infos(struct _info const *, int /*<<< orphan*/, int);
int keephome(const struct _info *lst, uid_t id) {
  return scan_infos(lst, id, 0x0001);
}


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

x86 assembly (clang, -O2):
<keephome>:
mov    $0x1,%edx
jmp    1030 <scan_infos@plt>

LLVM IR (-O0):
%struct._info = type { i32 }
define i32 @keephome(%struct._info* %0, i32 %1) {
%3 = alloca %struct._info*
%4 = alloca i32
store %struct._info* %0, %struct._info** %3
store i32 %1, i32* %4
%5 = load %struct._info*, %struct._info** %3
%6 = load i32, i32* %4
%7 = call i32 @scan_infos(%struct._info* %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct._info = type { i32 }
define i32 @keephome(%struct._info* %0, i32 %1) {
%3 = tail call i32 @scan_infos(%struct._info* %0, i32 %1, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printHelpAndExit(FILE *stream, int exitCode) {
  fprintf(stream, "Usage: linkInfo (-h | linka)\n");
  fprintf(stream, "Program vypise informacie o linke a jej ciely\n");
  fprintf(stream, "Prepinac -h vypise help\n");
  exit(exitCode);
}


x86 assembly (clang, -O0):
<printHelpAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xef3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printHelpAndExit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xed6(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xeec(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %ebp,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: linkInfo (-h | linka)\0A\00"
@.str.1 = [47 x i8] c"Program vypise informacie o linke a jej ciely\0A\00"
@.str.2 = [25 x i8] c"Prepinac -h vypise help\0A\00"
define void @printHelpAndExit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32*, i32** %3
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %4
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: linkInfo (-h | linka)\0A\00"
@.str.1 = [47 x i8] c"Program vypise informacie o linke a jej ciely\0A\00"
@.str.2 = [25 x i8] c"Prepinac -h vypise help\0A\00"
define void @printHelpAndExit(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 29, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i64 46, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 24, i64 1, i32* %0)
%6 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
void append(char *out, const char *txt) {
  if (*out != '\0') {
    strcat(out, ", ");
  }
  strcat(out, txt);
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <append+0x30>
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     112e <append+0x1e>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
define void @append(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* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
define void @append(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vec4d_scalarMult_new(double *, double *, double const);
void vec4d_scalarMult(double v[4], const double scalar) {
  vec4d_scalarMult_new(v, v, scalar);
}


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

x86 assembly (clang, -O2):
<vec4d_scalarMult>:
mov    %rdi,%rsi
jmp    1030 <vec4d_scalarMult_new@plt>

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

LLVM IR (-O2):
define void @vec4d_scalarMult(double* %0, double %1) {
%3 = tail call i32 @vec4d_scalarMult_new(double* %0, double* %0, double %1)
ret void
}