xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint_fast32_t;

/* Variables and functions */
uint_fast32_t gnu_hash(const unsigned char *s) {
  unsigned char c;
  uint_fast32_t h = 5381;
  for (c = *s; (c != '\0'); c = *++s) {
    h = ((h << 5) + h) + c;
  }
  return (h & 0xffffffff);
}


x86 assembly (clang, -O0):
<gnu_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     1151 <gnu_hash+0x51>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
add    -0x10(%rbp),%eax
movzbl -0x9(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
jmp    1118 <gnu_hash+0x18>
mov    -0x10(%rbp),%eax
and    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <gnu_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <gnu_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @gnu_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %6, 33
%10 = add nsw i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
void mdelay(int i) {}


x86 assembly (clang, -O0):
<mdelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mdelay(i32 %0) {
ret void
}
unsigned char inportb(unsigned short port) {
  unsigned char result;
  __asm__("in %%dx, %%al" : "=a"(result) : "d"(port));
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%dx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %5)
store i8 %6, i8* %4
%7 = load i8, i8* %2
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ testInDegree();
int main(void) {
  srand(1927);
  testInDegree();
  printf("i am satisfied with your function. congratulations. asian father "
         "approves.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x787,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1040 <testInDegree@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"i am satisfied with your function. congratulations. asian father approves.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @srand(i32 1927)
%3 = call i32 (...) @testInDegree()
%4 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [75 x i8] c"i am satisfied with your function. congratulations. asian father approves.\00"
define i32 @main() {
%1 = tail call i32 @srand(i32 1927)
%2 = tail call i32 (...) @testInDegree()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void interrupt_note_if_present(void) {}


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

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

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

LLVM IR (-O2):
define void @interrupt_note_if_present() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main() {
  float a = 0.1;
  float b = 0.2;
  float c;
  c = a + b;
  if (c == 0.3)
    puts("Iguales");
  else
    puts("Diferentes");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117a <main+0x6a>
jp     117a <main+0x6a>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
jmp    1186 <main+0x76>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%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 = [8 x i8] c"Iguales\00"
@.str.1 = [11 x i8] c"Diferentes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 0x3FB99999A0000000, float* %2
store float 0x3FC99999A0000000, float* %3
%5 = load float, float* %2
%6 = load float, float* %3
%7 = fadd float %5, %6
store float %7, float* %4
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fcmp oeq double %9, 3.000000e-01
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %0
%14 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"Diferentes\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char val_length(long val) {
  if (val < 0)
    return 3;
  if (val < 0x100)
    return 0;
  if (val < 0x10000)
    return 1;
  if (val < 0x1000000)
    return 2;
  return 3;
}


x86 assembly (clang, -O0):
<val_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    111c <val_length+0x1c>
movb   $0x3,-0x1(%rbp)
jmp    1165 <val_length+0x65>
cmpq   $0x100,-0x10(%rbp)
jge    1133 <val_length+0x33>
movb   $0x0,-0x1(%rbp)
jmp    1165 <val_length+0x65>
cmpq   $0x10000,-0x10(%rbp)
jge    114a <val_length+0x4a>
movb   $0x1,-0x1(%rbp)
jmp    1165 <val_length+0x65>
cmpq   $0x1000000,-0x10(%rbp)
01
jge    1161 <val_length+0x61>
movb   $0x2,-0x1(%rbp)
jmp    1165 <val_length+0x65>
movb   $0x3,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_length>:
test   %rdi,%rdi
js     1111 <val_length+0x11>
cmp    $0x100,%rdi
jae    1114 <val_length+0x14>
xor    %eax,%eax
ret
mov    $0x3,%al
ret
mov    $0x1,%al
cmp    $0x10000,%rdi
jb     112a <val_length+0x2a>
cmp    $0x1000000,%rdi
mov    $0x3,%al
sbb    $0x0,%al
ret

LLVM IR (-O0):
define signext i8 @val_length(i64 %0) {
%2 = alloca i8
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 3, i8* %2
br label %20
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp slt i64 %8, 256
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 0, i8* %2
br label %20
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp slt i64 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 1, i8* %2
br label %20
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp slt i64 %16, 16777216
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 2, i8* %2
br label %20
19: ; preds = %15
store i8 3, i8* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @val_length(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 256
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i64 %0, 16777216
%9 = select i1 %8, i8 2, i8 3
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i8 [ 3, %1 ], [ 0, %3 ], [ 1, %5 ], [ %9, %7 ]
ret i8 %11
}
/* Variables and functions */
scalar_t__ nrf_drv_usbd_errata_type_52840_fp1();
bool nrf_drv_usbd_errata_187(void) {
  return 1 && nrf_drv_usbd_errata_type_52840_fp1();
}


x86 assembly (clang, -O0):
<nrf_drv_usbd_errata_187>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nrf_drv_usbd_errata_type_52840_fp1@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_drv_usbd_errata_187>:
push   %rax
xor    %eax,%eax
call   1030 <nrf_drv_usbd_errata_type_52840_fp1@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_187() {
%1 = call i64 (...) @nrf_drv_usbd_errata_type_52840_fp1()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_187() {
%1 = tail call i64 (...) @nrf_drv_usbd_errata_type_52840_fp1()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void BitInit(unsigned *bit_array, int size) {
  int i;
  for (i = 0; i < size; ++i) {
    bit_array[i] = 0;
  }
}


x86 assembly (clang, -O0):
<BitInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <BitInit+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <BitInit+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitInit>:
test   %esi,%esi
jle    1126 <BitInit+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @BitInit(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
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
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @BitInit(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
int mlt_version_get_revision() { return 9; }


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

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

LLVM IR (-O0):
define i32 @mlt_version_get_revision() {
ret i32 9
}

LLVM IR (-O2):
define i32 @mlt_version_get_revision() {
ret i32 9
}
/* Variables and functions */
scalar_t__ simple_strtoul(char const *, char **, unsigned int, size_t);
long simple_strtol(const char *cp, char **endp, unsigned int base,
                   size_t field_width) {
  if (*cp == '-')
    return -(long)simple_strtoul(cp + 1, endp, base, field_width);
  return (long)simple_strtoul(cp, endp, base, field_width);
}


x86 assembly (clang, -O0):
<simple_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1160 <simple_strtol+0x50>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <simple_strtoul@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <simple_strtol+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <simple_strtoul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strtol>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    1124 <simple_strtol+0x14>
add    $0x1,%rdi
call   1030 <simple_strtoul@plt>
neg    %rax
pop    %rcx
ret
pop    %rax
jmp    1030 <simple_strtoul@plt>

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

LLVM IR (-O2):
define i64 @simple_strtol(i8* %0, i8** %1, i32 %2, i64 %3) {
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 45
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = tail call i64 @simple_strtoul(i8* %8, i8** %1, i32 %2, i64 %3)
%10 = sub nsw i64 0, %9
br label %13
11: ; preds = %4
%12 = tail call i64 @simple_strtoul(i8* %0, i8** %1, i32 %2, i64 %3)
br label %13
13: ; preds = %11, %7
%14 = phi i64 [ %10, %7 ], [ %12, %11 ]
ret i64 %14
}
int main() { return -1 <= (unsigned long)-2; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xe3() {
  Assert_real((iscntrl(227) == 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_iscntrl.c",
              1140, ("iscntrl should be 0 for 0xe3"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xe3>:
push   %rax
mov    $0xe3,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x474,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe3\00"
define void @t_iscntrl_0xe3() {
%1 = call i64 @iscntrl(i32 227)
%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 1140, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe3\00"
define void @t_iscntrl_0xe3() {
%1 = tail call i64 @iscntrl(i32 227)
%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 1140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(void) {
  system(
      "java -Dsongscribe=sb -splash:images/sbsplash.png -jar songscribe.jar");
  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 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [69 x i8] c"java -Dsongscribe=sb -splash:images/sbsplash.png -jar songscribe.jar\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"java -Dsongscribe=sb -splash:images/sbsplash.png -jar songscribe.jar\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int kv_vector_new_size(int old_size) {
  int size = 0;
  if (old_size == 1)
    size = 4;
  else if (old_size < 10)
    size = old_size * 2;
  else
    size = (int)(old_size * 1.25) + 1;
  return size;
}


x86 assembly (clang, -O0):
<kv_vector_new_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1124 <kv_vector_new_size+0x24>
movl   $0x4,-0x8(%rbp)
jmp    115c <kv_vector_new_size+0x5c>
cmpl   $0xa,-0x4(%rbp)
jge    113c <kv_vector_new_size+0x3c>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <kv_vector_new_size+0x57>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <kv_vector_new_size+0x5c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kv_vector_new_size>:
mov    $0x4,%eax
cmp    $0x1,%edi
je     1127 <kv_vector_new_size+0x27>
cmp    $0x9,%edi
jg     1114 <kv_vector_new_size+0x14>
add    %edi,%edi
mov    %edi,%eax
ret
cvtsi2sd %edi,%xmm0
mulsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @kv_vector_new_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 4, i32* %3
br label %20
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 2
store i32 %12, i32* %3
br label %19
13: ; preds = %7
%14 = load i32, i32* %2
%15 = sitofp i32 %14 to double
%16 = fmul double %15, 1.250000e+00
%17 = fptosi double %16 to i32
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %13, %10
br label %20
20: ; preds = %19, %6
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @kv_vector_new_size(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 10
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = shl nsw i32 %0, 1
br label %12
7: ; preds = %3
%8 = sitofp i32 %0 to double
%9 = fmul double %8, 1.250000e+00
%10 = fptosi double %9 to i32
%11 = add nsw i32 %10, 1
br label %12
12: ; preds = %1, %5, %7
%13 = phi i32 [ %6, %5 ], [ %11, %7 ], [ 4, %1 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ hashfn_int32_tw(int /*<<< orphan*/);
uint32_t hashtable_hashfn_int32(void *k) {
  int32_t i = *((int32_t *)k);
  return hashfn_int32_tw(i);
}


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

x86 assembly (clang, -O2):
<hashtable_hashfn_int32>:
mov    (%rdi),%edi
jmp    1030 <hashfn_int32_tw@plt>

LLVM IR (-O0):
define i32 @hashtable_hashfn_int32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @hashfn_int32_tw(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @hashtable_hashfn_int32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @hashfn_int32_tw(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ cal_distance(unsigned int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(unsigned int, unsigned int);
void backward_mm(unsigned int speed, unsigned int distance) {
  motion_direction(0b00001001);
  speed_control(speed, speed);
  cal_distance(distance);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<backward_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x9,%edi
call   1040 <motion_direction@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <speed_control@plt>
mov    -0x8(%rbp),%edi
call   1030 <cal_distance@plt>
mov    $0xa,%edi
call   1050 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backward_mm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x9,%edi
call   1040 <motion_direction@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1060 <speed_control@plt>
mov    %ebx,%edi
call   1030 <cal_distance@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_delay_us@plt>

LLVM IR (-O0):
define void @backward_mm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 9)
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @speed_control(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @cal_distance(i32 %9)
%11 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @backward_mm(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 9)
%4 = tail call i32 @speed_control(i32 %0, i32 %0)
%5 = tail call i32 @cal_distance(i32 %1)
%6 = tail call i32 @_delay_us(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
void TOOLS_DumpLine(FILE *pFilePointer) {
  int ch;
  while (((ch = fgetc(pFilePointer)) != EOF) && (ch != '\n')) {
  }
  return;
}


x86 assembly (clang, -O0):
<TOOLS_DumpLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2eb5(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xd(%rbp)
je     1148 <TOOLS_DumpLine+0x38>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1158 <TOOLS_DumpLine+0x48>
jmp    115d <TOOLS_DumpLine+0x4d>
jmp    111c <TOOLS_DumpLine+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOOLS_DumpLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1132 <TOOLS_DumpLine+0x22>
cmp    (%r14),%eax
jne    1120 <TOOLS_DumpLine+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @TOOLS_DumpLine(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %9, %4
%13 = phi i1 [ false, %4 ], [ %11, %9 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @TOOLS_DumpLine(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
ret void
}
/* Variables and functions */
double RAND_MAX;
int rand();
int GetRandom(int min, int max) {
  return min + (int)(rand() * (max - min + 1.0) / (1.0 + RAND_MAX));
}


x86 assembly (clang, -O0):
<GetRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cvtsi2sd %ecx,%xmm0
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cvtsi2sd %ecx,%xmm1
movsd  0xeba(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm1
mov    0x2e8b(%rip),%rcx
addsd  (%rcx),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandom>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
sub    %ebp,%ebx
cvtsi2sd %ebx,%xmm1
movsd  0xed0(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mov    0x2ea9(%rip),%rax
addsd  (%rax),%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @GetRandom(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 (...) @rand()
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = fadd double %11, 1.000000e+00
%13 = fmul double %7, %12
%14 = load double, double* @RAND_MAX
%15 = fadd double 1.000000e+00, %14
%16 = fdiv double %13, %15
%17 = fptosi double %16 to i32
%18 = add nsw i32 %5, %17
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @GetRandom(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sitofp i32 %3 to double
%5 = sub nsw i32 %1, %0
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fmul double %7, %4
%9 = load double, double* @RAND_MAX
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %8, %10
%12 = fptosi double %11 to i32
%13 = add nsw i32 %12, %0
ret i32 %13
}
int test_imm_9Auint16_reg(unsigned short val) {
  return ((val) & (-0x9A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Auint16_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, -154
%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_9Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -154
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned long long divmodk(unsigned long long, unsigned long long,
                           int /*<<< orphan*/);
int /*<<< orphan*/ printk(char *, unsigned long long, unsigned long long);
unsigned long long divk(unsigned long long num, unsigned long long den) {
  printk("%d,%d\n", num, den);
  return divmodk(num, den, 0);
}


x86 assembly (clang, -O0):
<divk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printk@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <divmodk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printk@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <divmodk@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
define i64 @divk(i64 %0, i64 %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%4 = tail call i64 @divmodk(i64 %0, i64 %1, i32 0)
ret i64 %4
}
int some_called_function(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @some_called_function() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void get_cut() { sleep(3); }


x86 assembly (clang, -O0):
<get_cut>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cut>:
mov    $0x3,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @get_cut() {
%1 = call i32 @sleep(i32 3)
ret void
}

LLVM IR (-O2):
define void @get_cut() {
%1 = tail call i32 @sleep(i32 3)
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int, int /*<<< orphan*/);
void *mcalloc(int n, int size) {
  int s = n * size;
  void *p = malloc(s);
  memset(p, s, 0);
  return p;
}


x86 assembly (clang, -O0):
<mcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
imul   %edi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mcalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i8* @malloc(i32 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i32, i32* %5
%14 = call i32 @memset(i8* %12, i32 %13, i32 0)
%15 = load i8*, i8** %6
ret i8* %15
}

LLVM IR (-O2):
define i8* @mcalloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memset(i8* %4, i32 %3, i32 0)
ret i8* %4
}
void send_cmd(unsigned char cmd) {
  (*(volatile unsigned char *)0x70200008) = cmd;
}


x86 assembly (clang, -O0):
<send_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x70200008,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd>:
mov    %dil,0x70200008
70
ret

LLVM IR (-O0):
define void @send_cmd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 1881145352 to i8*)
ret void
}

LLVM IR (-O2):
define void @send_cmd(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 1881145352 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m4x4_rotateZ(int /*<<< orphan*/, float);
int /*<<< orphan*/ matrixstack_head();
void matrixstack_rotate(float a) { m4x4_rotateZ(matrixstack_head(), a); }


x86 assembly (clang, -O0):
<matrixstack_rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <matrixstack_head@plt>
mov    %eax,%edi
movss  -0x4(%rbp),%xmm0
call   1030 <m4x4_rotateZ@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixstack_rotate>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1040 <matrixstack_head@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <m4x4_rotateZ@plt>

LLVM IR (-O0):
define void @matrixstack_rotate(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 (...) @matrixstack_head()
%4 = load float, float* %2
%5 = call i32 @m4x4_rotateZ(i32 %3, float %4)
ret void
}

LLVM IR (-O2):
define void @matrixstack_rotate(float %0) {
%2 = tail call i32 (...) @matrixstack_head()
%3 = tail call i32 @m4x4_rotateZ(i32 %2, float %0)
ret void
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s != (char)c) {
    if (!*s)
      return NULL;
    s++;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     114b <strchr+0x4b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113a <strchr+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
char __ocl_bitselect_char(char a, char b, char c) {
  return (b & c) | (a & (~c));
}


x86 assembly (clang, -O0):
<__ocl_bitselect_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
and    %ecx,%eax
movsbl -0x1(%rbp),%ecx
movsbl -0x3(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_bitselect_char>:
mov    %edx,%eax
and    %edx,%esi
not    %al
and    %dil,%al
or     %sil,%al
ret

LLVM IR (-O0):
define signext i8 @__ocl_bitselect_char(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = and i32 %8, %10
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
%18 = or i32 %11, %17
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @__ocl_bitselect_char(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %2, -1
%6 = and i8 %5, %0
%7 = or i8 %4, %6
ret i8 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t clampd(double v) {
  if (v < 0)
    return 0;
  if (v > 255)
    return 255;
  return (uint8_t)v;
}


x86 assembly (clang, -O0):
<clampd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1123 <clampd+0x23>
movl   $0x0,-0x4(%rbp)
jmp    114e <clampd+0x4e>
movsd  -0x10(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <clampd+0x46>
movl   $0xff,-0x4(%rbp)
jmp    114e <clampd+0x4e>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampd>:
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     111f <clampd+0x1f>
mov    $0xff,%eax
ucomisd 0xee7(%rip),%xmm0
ja     111f <clampd+0x1f>
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @clampd(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 2.550000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 255, i32* %2
br label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @clampd(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 2.550000e+02
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fptosi double %0 to i32
br label %7
7: ; preds = %3, %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ], [ 255, %3 ]
ret i32 %8
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *swirIDParser(char *header) {
  return tokenParser(header, ": ", 1, "swirIDParser");
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
@.str.1 = [13 x i8] c"swirIDParser\00"
define i8* @swirIDParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int get_n_vars();
int get_n_vgms();
int get_n_outputs(void) { return get_n_vars() + get_n_vgms(); }


x86 assembly (clang, -O0):
<get_n_outputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_n_vars@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_n_vgms@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_n_outputs>:
push   %rbx
xor    %eax,%eax
call   1040 <get_n_vars@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <get_n_vgms@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_n_outputs() {
%1 = call i32 (...) @get_n_vars()
%2 = call i32 (...) @get_n_vgms()
%3 = add nsw i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_n_outputs() {
%1 = tail call i32 (...) @get_n_vars()
%2 = tail call i32 (...) @get_n_vgms()
%3 = add nsw i32 %2, %1
ret i32 %3
}
int dims2pct(unsigned char level) {
  long int pct;
  pct = (level > 32u)  ? 90 * (level - 33u) / 177 + 10
        : (level > 1u) ? 8 * (level - 2u) / 31 + 2
                       : 0;
  return (int)pct;
}


x86 assembly (clang, -O0):
<dims2pct>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jbe    1135 <dims2pct+0x35>
movzbl -0x1(%rbp),%eax
sub    $0x21,%eax
imul   $0x5a,%eax,%eax
mov    $0xb1,%ecx
xor    %edx,%edx
div    %ecx
add    $0xa,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <dims2pct+0x70>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jbe    1160 <dims2pct+0x60>
movzbl -0x1(%rbp),%eax
sub    $0x2,%eax
shl    $0x3,%eax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %ecx
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    116a <dims2pct+0x6a>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    116a <dims2pct+0x6a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dims2pct>:
cmp    $0x21,%dil
jb     1126 <dims2pct+0x26>
imul   $0x5a,%edi,%eax
add    $0xfffff466,%eax
imul   $0x724287f5,%rax,%rcx
shr    $0x20,%rcx
sub    %ecx,%eax
shr    %eax
add    %ecx,%eax
shr    $0x7,%eax
add    $0xa,%eax
ret
xor    %eax,%eax
cmp    $0x2,%dil
jb     114c <dims2pct+0x4c>
lea    -0x10(,%rdi,8),%eax
imul   $0x8421085,%rax,%rcx
shr    $0x20,%rcx
sub    %ecx,%eax
shr    %eax
add    %ecx,%eax
shr    $0x4,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @dims2pct(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp ugt i32 %5, 32
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = sub i32 %9, 33
%11 = mul i32 90, %10
%12 = udiv i32 %11, 177
%13 = add i32 %12, 10
br label %28
14: ; preds = %1
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp ugt i32 %16, 1
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = sub i32 %20, 2
%22 = mul i32 8, %21
%23 = udiv i32 %22, 31
%24 = add i32 %23, 2
br label %26
25: ; preds = %14
br label %26
26: ; preds = %25, %18
%27 = phi i32 [ %24, %18 ], [ 0, %25 ]
br label %28
28: ; preds = %26, %7
%29 = phi i32 [ %13, %7 ], [ %27, %26 ]
%30 = zext i32 %29 to i64
store i64 %30, i64* %3
%31 = load i64, i64* %3
%32 = trunc i64 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @dims2pct(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ugt i8 %0, 32
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = mul nuw nsw i32 %2, 90
%6 = add nsw i32 %5, -2970
%7 = udiv i32 %6, 177
%8 = add nuw nsw i32 %7, 10
br label %16
9: ; preds = %1
%10 = icmp ugt i8 %0, 1
br i1 %10, label %11, label %16
11: ; preds = %9
%12 = shl nuw nsw i32 %2, 3
%13 = add nsw i32 %12, -16
%14 = udiv i32 %13, 31
%15 = add nuw nsw i32 %14, 2
br label %16
16: ; preds = %11, %9, %4
%17 = phi i32 [ %8, %4 ], [ %15, %11 ], [ 0, %9 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_epi16(int /*<<< orphan*/, int);
__m128i test_mm_srai_epi16_2(__m128i A, int B) { return _mm_srai_epi16(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_srai_epi16_2>:
jmp    1030 <_mm_srai_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srai_epi16_2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srai_epi16(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glVertex2dv(int /*<<< orphan*/ *);
void Vertex2dv(GLdouble v[2]) { glVertex2dv(v); }


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

x86 assembly (clang, -O2):
<Vertex2dv>:
jmp    1030 <glVertex2dv@plt>

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

LLVM IR (-O2):
define void @Vertex2dv(i32* %0) {
%2 = tail call i32 @glVertex2dv(i32* %0)
ret void
}