xunge/DecIR huggingface dataset:
/* Type definitions */
struct portrangestruct {
  int dummy;
};

/* Variables and functions */
struct portrangestruct *config_parse_portranges(char *);
int config_parse_ports(char *line, struct portrangestruct **pr) {
  *pr = config_parse_portranges(line);
  return 0;
}


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

x86 assembly (clang, -O2):
<config_parse_ports>:
push   %rbx
mov    %rsi,%rbx
call   1030 <config_parse_portranges@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.portrangestruct = type { i32 }
define i32 @config_parse_ports(i8* %0, %struct.portrangestruct** nocapture writeonly %1) {
%3 = tail call %struct.portrangestruct* @config_parse_portranges(i8* %0)
store %struct.portrangestruct* %3, %struct.portrangestruct** %1
ret i32 0
}
unsigned int RSHash(const char *str) {
  unsigned int b = 378551;
  unsigned int a = 63689;
  unsigned int hash = 0;
  while (*str) {
    hash = hash * a + (*str++);
    a *= b;
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<RSHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5c6b7,-0xc(%rbp)
movl   $0xf8c9,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <RSHash+0x57>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    111d <RSHash+0x1d>
mov    -0x14(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1141 <RSHash+0x41>
add    $0x1,%rdi
mov    $0xf8c9,%edx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%esi
imul   %edx,%esi
movsbl %cl,%eax
add    %esi,%eax
imul   $0x5c6b7,%edx,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <RSHash+0x20>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @RSHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i32 [ %13, %4 ], [ 63689, %1 ]
%8 = phi i8* [ %10, %4 ], [ %0, %1 ]
%9 = mul i32 %6, %7
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %5 to i32
%12 = add i32 %9, %11
%13 = mul i32 %7, 378551
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = and i32 %12, 2147483647
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
int energymon_is_exclusive_cray_pm_cpu_energy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @energymon_is_exclusive_cray_pm_cpu_energy() {
ret i32 0
}
double _speed() { return 3.0; }


x86 assembly (clang, -O0):
<_speed>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_speed>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_speed() {
ret double 3.000000e+00
}

LLVM IR (-O2):
define double @_speed() {
ret double 3.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void show_breadcrumb(const char *name, void *memo) {
  if (*(int *)memo > 0) {
    printf("%s -> ", name);
  }
  (*(int *)memo)++;
}


x86 assembly (clang, -O0):
<show_breadcrumb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    113d <show_breadcrumb+0x2d>
mov    -0x8(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_breadcrumb>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%eax
test   %eax,%eax
jle    112b <show_breadcrumb+0x1b>
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s -> \00"
define void @show_breadcrumb(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* %3
br label %9
9: ; preds = %6, %2
%10 = phi i32 [ %8, %6 ], [ %4, %2 ]
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
ret void
}
void __attribute__((section(".after_vectors"), weak)) SysTick_Handler(void) {
  ;
}


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

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

LLVM IR (-O0):
define weak void @SysTick_Handler() section ".after_vectors" {
ret void
}

LLVM IR (-O2):
define weak void @SysTick_Handler() section ".after_vectors" {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int str_startswith(const char *head, const char *worm) {
  return !strncmp(head, worm, strlen(head));
}


x86 assembly (clang, -O0):
<str_startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @str_startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int execute_truncate64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_truncate64() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CSdown();
int /*<<< orphan*/ Init_SPISystem();
int /*<<< orphan*/ sdWrite(unsigned char *, unsigned long);
int mainFunction(void) {
  while (1) {
    CSdown();
    Init_SPISystem();
    unsigned char toSend[512];
    toSend[0] = 0xAA;
    for (unsigned long i = 0; i < 2000; i += 512) {
      sdWrite(toSend, i);
    }
  }
}


x86 assembly (clang, -O0):
<mainFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    $0x0,%al
call   1030 <CSdown@plt>
mov    $0x0,%al
call   1050 <Init_SPISystem@plt>
movb   $0xaa,-0x200(%rbp)
movq   $0x0,-0x208(%rbp)
cmpq   $0x7d0,-0x208(%rbp)
jae    1198 <mainFunction+0x68>
lea    -0x200(%rbp),%rdi
mov    -0x208(%rbp),%rsi
call   1040 <sdWrite@plt>
mov    -0x208(%rbp),%rax
add    $0x200,%rax
mov    %rax,-0x208(%rbp)
jmp    115b <mainFunction+0x2b>
jmp    113b <mainFunction+0xb>

x86 assembly (clang, -O2):
<mainFunction>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <CSdown@plt>
xor    %eax,%eax
call   1050 <Init_SPISystem@plt>
movb   $0xaa,(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <sdWrite@plt>
mov    $0x200,%esi
mov    %rbx,%rdi
call   1040 <sdWrite@plt>
mov    $0x400,%esi
mov    %rbx,%rdi
call   1040 <sdWrite@plt>
mov    $0x600,%esi
mov    %rbx,%rdi
call   1040 <sdWrite@plt>
jmp    1140 <mainFunction+0x10>

LLVM IR (-O0):
define i32 @mainFunction() {
%1 = alloca [512 x i8]
%2 = alloca i64
br label %3
3: ; preds = %0, %17
%4 = call i32 (...) @CSdown()
%5 = call i32 (...) @Init_SPISystem()
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
store i8 -86, i8* %6
store i64 0, i64* %2
br label %7
7: ; preds = %14, %3
%8 = load i64, i64* %2
%9 = icmp ult i64 %8, 2000
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%12 = load i64, i64* %2
%13 = call i32 @sdWrite(i8* %11, i64 %12)
br label %14
14: ; preds = %10
%15 = load i64, i64* %2
%16 = add i64 %15, 512
store i64 %16, i64* %2
br label %7
17: ; preds = %7
br label %3
}

LLVM IR (-O2):
define i32 @mainFunction() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @CSdown()
%5 = call i32 (...) @Init_SPISystem()
store i8 -86, i8* %2
%6 = call i32 @sdWrite(i8* %2, i64 0)
%7 = call i32 @sdWrite(i8* %2, i64 512)
%8 = call i32 @sdWrite(i8* %2, i64 1024)
%9 = call i32 @sdWrite(i8* %2, i64 1536)
br label %3
}
/* Variables and functions */
int ap_cmd_get_int(int, int, int *);
int ap_get_playlist_position(int session, int *pos) {
  return (ap_cmd_get_int(session, 0xcc31, pos));
}


x86 assembly (clang, -O0):
<ap_get_playlist_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc31,%esi
call   1030 <ap_cmd_get_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_playlist_position>:
mov    %rsi,%rdx
mov    $0xcc31,%esi
jmp    1030 <ap_cmd_get_int@plt>

LLVM IR (-O0):
define i32 @ap_get_playlist_position(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 @ap_cmd_get_int(i32 %5, i32 52273, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_get_playlist_position(i32 %0, i32* %1) {
%3 = tail call i32 @ap_cmd_get_int(i32 %0, i32 52273, i32* %1)
ret i32 %3
}
int findgroup(int k, int *parent) {
  if (parent[k] != k) {
    parent[k] = findgroup(parent[k], parent);
  }
  return parent[k];
}


x86 assembly (clang, -O0):
<findgroup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
je     1154 <findgroup+0x44>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
call   1030 <findgroup@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findgroup>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%eax
movslq %edi,%rbx
mov    (%rsi,%rbx,4),%edi
cmp    %ebx,%edi
je     112c <findgroup+0x1c>
mov    %rsi,%r14
call   1030 <findgroup@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @findgroup(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @findgroup(i32 %5, i32* %1)
store i32 %8, i32* %4
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ %8, %7 ], [ %0, %2 ]
ret i32 %10
}
int garray_ambigendian(void) {
  unsigned short s = 1;
  unsigned char c = *(char *)(&s);
  return (c == 0);
}


x86 assembly (clang, -O0):
<garray_ambigendian>:
push   %rbp
mov    %rsp,%rbp
movw   $0x1,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @garray_ambigendian() {
%1 = alloca i16
%2 = alloca i8
store i16 1, i16* %1
%3 = bitcast i16* %1 to i8*
%4 = load i8, i8* %3
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @garray_ambigendian() {
ret i32 0
}
/* Variables and functions */
int f266(int *);
int f267(int *p) { return f266(p); }


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

x86 assembly (clang, -O2):
<f267>:
jmp    1030 <f266@plt>

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

LLVM IR (-O2):
define i32 @f267(i32* %0) {
%2 = tail call i32 @f266(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CX4_C4DoScaleRotate(int /*<<< orphan*/);
void CX4_op00_03(void) { CX4_C4DoScaleRotate(0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <CX4_C4DoScaleRotate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %edi,%edi
jmp    1030 <CX4_C4DoScaleRotate@plt>

LLVM IR (-O0):
define void @CX4_op00_03() {
%1 = call i32 @CX4_C4DoScaleRotate(i32 0)
ret void
}

LLVM IR (-O2):
define void @CX4_op00_03() {
%1 = tail call i32 @CX4_C4DoScaleRotate(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ printk(char *);
void int_Invalid_TSS(void) {
  color(0xff0000);
  printk("Invalid TSS!!!");
  io_hlt();
}


x86 assembly (clang, -O0):
<int_Invalid_TSS>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebb(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_Invalid_TSS>:
push   %rax
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebe(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <io_hlt@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Invalid TSS!!!\00"
define void @int_Invalid_TSS() {
%1 = call i32 @color(i32 16711680)
%2 = call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @io_hlt()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Invalid TSS!!!\00"
define void @int_Invalid_TSS() {
%1 = tail call i32 @color(i32 16711680)
%2 = tail call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @io_hlt()
ret void
}
/* Type definitions */
struct HTTPRequest {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free_request(struct HTTPRequest *);
struct HTTPRequest *read_request(int /*<<< orphan*/ *);
int /*<<< orphan*/ respond_to(struct HTTPRequest *, int /*<<< orphan*/ *,
                              char *);
void service(FILE *in, FILE *out, char *docroot) {
  struct HTTPRequest *req;
  req = read_request(in);
  respond_to(req, out, docroot);
  free_request(req);
}


x86 assembly (clang, -O0):
<service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_request@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <respond_to@plt>
mov    -0x20(%rbp),%rdi
call   1050 <free_request@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<service>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <read_request@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <respond_to@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <free_request@plt>

LLVM IR (-O0):
%struct.HTTPRequest = type { i32 }
define void @service(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca %struct.HTTPRequest*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%8 = load i32*, i32** %4
%9 = call %struct.HTTPRequest* @read_request(i32* %8)
store %struct.HTTPRequest* %9, %struct.HTTPRequest** %7
%10 = load %struct.HTTPRequest*, %struct.HTTPRequest** %7
%11 = load i32*, i32** %5
%12 = load i8*, i8** %6
%13 = call i32 @respond_to(%struct.HTTPRequest* %10, i32* %11, i8* %12)
%14 = load %struct.HTTPRequest*, %struct.HTTPRequest** %7
%15 = call i32 @free_request(%struct.HTTPRequest* %14)
ret void
}

LLVM IR (-O2):
%struct.HTTPRequest = type { i32 }
define void @service(i32* %0, i32* %1, i8* %2) {
%4 = tail call %struct.HTTPRequest* @read_request(i32* %0)
%5 = tail call i32 @respond_to(%struct.HTTPRequest* %4, i32* %1, i8* %2)
%6 = tail call i32 @free_request(%struct.HTTPRequest* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(int /*<<< orphan*/);
void aff_0(int nb) {
  my_putchar('0');
  if (nb < 7)
    my_putchar('0');
}


x86 assembly (clang, -O0):
<aff_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x30,%edi
call   1030 <my_putchar@plt>
cmpl   $0x7,-0x4(%rbp)
jge    1139 <aff_0+0x29>
mov    $0x30,%edi
call   1030 <my_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aff_0>:
push   %rbx
mov    %edi,%ebx
mov    $0x30,%edi
call   1030 <my_putchar@plt>
cmp    $0x6,%ebx
jg     112d <aff_0+0x1d>
mov    $0x30,%edi
pop    %rbx
jmp    1030 <my_putchar@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @aff_0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @my_putchar(i32 48)
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @my_putchar(i32 48)
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @aff_0(i32 %0) {
%2 = tail call i32 @my_putchar(i32 48)
%3 = icmp slt i32 %0, 7
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @my_putchar(i32 48)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_led_8_8_12(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                  int);
void render_yz(uint8_t x, uint8_t y) {
  set_led_8_8_12(7, x, y, ((1 << 12) - 1));
}


x86 assembly (clang, -O0):
<render_yz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x7,%edi
mov    $0xfff,%ecx
call   1030 <set_led_8_8_12@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_yz>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x7,%edi
mov    $0xfff,%ecx
jmp    1030 <set_led_8_8_12@plt>

LLVM IR (-O0):
define void @render_yz(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 @set_led_8_8_12(i32 7, i32 %5, i32 %6, i32 4095)
ret void
}

LLVM IR (-O2):
define void @render_yz(i32 %0, i32 %1) {
%3 = tail call i32 @set_led_8_8_12(i32 7, i32 %0, i32 %1, i32 4095)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("The newly opened mall is - %f miles away.\n.", 19.2 - 13.5);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"The newly opened mall is - %f miles away.\0A.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), double 0x4016CCCCCCCCCCCC)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"The newly opened mall is - %f miles away.\0A.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), double 0x4016CCCCCCCCCCCC)
ret i32 0
}
unsigned int hashParts(void *f1, int size, long long max) {
  return *(int *)f1 % max;
}


x86 assembly (clang, -O0):
<hashParts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
cqto
idivq  -0x18(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashParts>:
mov    %rdx,%rcx
movslq (%rdi),%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     111b <hashParts+0x1b>
cqto
idiv   %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hashParts(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = load i64, i64* %6
%12 = srem i64 %10, %11
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @hashParts(i8* nocapture %0, i32 %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = srem i64 %6, %2
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_pthread_cleanup_push(void (*routine)(void *), void *arg) {
  printf("UNIMPLEMENTED: pthread_cleanup_push\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"UNIMPLEMENTED: pthread_cleanup_push\0A\00"
define void @my_pthread_cleanup_push(void (i8*)* %0, i8* %1) {
%3 = alloca void (i8*)*
%4 = alloca i8*
store void (i8*)* %0, void (i8*)** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"UNIMPLEMENTED: pthread_cleanup_push\00"
define void @my_pthread_cleanup_push(void (i8*)* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
char get_r_rs(int inst) { return ((inst & 0x03E00000) >> 21); }


x86 assembly (clang, -O0):
<get_r_rs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3e00000,%eax
sar    $0x15,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_r_rs>:
mov    %edi,%eax
shr    $0x15,%eax
and    $0x1f,%al
ret

LLVM IR (-O0):
define signext i8 @get_r_rs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65011712
%5 = ashr i32 %4, 21
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @get_r_rs(i32 %0) {
%2 = lshr i32 %0, 21
%3 = trunc i32 %2 to i8
%4 = and i8 %3, 31
ret i8 %4
}
/* Variables and functions */
double RAND_MAX;
double fabs(double);
scalar_t__ rand();
double rand_double(double start, double end) {
  return ((double)rand()) / RAND_MAX * fabs(end - start) + start;
}


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movaps 0xeb6(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
sub    $0x28,%rsp
movaps %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm1
movapd 0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
andpd  0xeaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = call double @llvm.fabs.f64(double %11)
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %8, double %12, double %13)
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_double(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fabs.f64(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %6, double %8, double %0)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ xioctl(int, int, void *);
void xioctl_int(int fd, int request, long arg) {
  xioctl(fd, request, (void *)arg);
}


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

x86 assembly (clang, -O2):
<xioctl_int>:
jmp    1030 <xioctl@plt>

LLVM IR (-O0):
define void @xioctl_int(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @xioctl(i32 %7, i32 %8, i8* %10)
ret void
}

LLVM IR (-O2):
define void @xioctl_int(i32 %0, i32 %1, i64 %2) {
%4 = inttoptr i64 %2 to i8*
%5 = tail call i32 @xioctl(i32 %0, i32 %1, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *get_first();
int /*<<< orphan*/ *get_last();
bool is_empty() {
  if (get_first() == NULL && get_last() == NULL)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_first@plt>
cmp    $0x0,%rax
jne    1156 <is_empty+0x36>
mov    $0x0,%al
call   1030 <get_last@plt>
cmp    $0x0,%rax
jne    1156 <is_empty+0x36>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_empty+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <get_first@plt>
test   %rax,%rax
jne    1140 <is_empty+0x20>
xor    %eax,%eax
call   1030 <get_last@plt>
test   %rax,%rax
jne    1140 <is_empty+0x20>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_empty() {
%1 = tail call i32* (...) @get_first()
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32* (...) @get_last()
%5 = icmp eq i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int strcmp(char *, char *);
int string_compare(void *s1, void *s2) {
  return strcmp((char *)s1, (char *)s2);
}


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

x86 assembly (clang, -O2):
<string_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @string_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dread_ascfile(char const *, double *, double *, int *,
                                 double *);
void dread_ascfile_c_(const char *name, double *t0, double *dt, int *n,
                      double *data) {
  dread_ascfile(name, t0, dt, n, data);
}


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

x86 assembly (clang, -O2):
<dread_ascfile_c_>:
jmp    1030 <dread_ascfile@plt>

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

LLVM IR (-O2):
define void @dread_ascfile_c_(i8* %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = tail call i32 @dread_ascfile(i8* %0, double* %1, double* %2, i32* %3, double* %4)
ret void
}
/* Variables and functions */
int strlen(char *);
void trimLastChar(char *s) {
  int len = strlen(s);
  if (len > 0)
    s[len - 1] = 0;
}


x86 assembly (clang, -O0):
<trimLastChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1143 <trimLastChar+0x33>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimLastChar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1124 <trimLastChar+0x14>
add    $0xffffffff,%eax
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trimLastChar(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
br label %8
8: ; preds = %4, %1
ret void
}
void blkcache_invalidate(int iftype, int dev) {}


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

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

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

LLVM IR (-O2):
define void @blkcache_invalidate(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x4b() {
  Assert_real((iscntrl(75) == 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",
              380, ("iscntrl should be 0 for K"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x4b>:
push   %rax
mov    $0x4b,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x17c,%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 = [26 x i8] c"iscntrl should be 0 for K\00"
define void @t_iscntrl_0x4b() {
%1 = call i64 @iscntrl(i32 75)
%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 380, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"iscntrl should be 0 for K\00"
define void @t_iscntrl_0x4b() {
%1 = tail call i64 @iscntrl(i32 75)
%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 380, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char const *);
int test_strlen(const char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<test_strlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @test_strlen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
int is_space(int key) { return key == 0x20; }


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

x86 assembly (clang, -O2):
<is_space>:
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_space(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ pthread_cond_destroy(int /*<<< orphan*/ *);
int gen_posix_cond_destroy(pthread_cond_t *cond) {
  if (!cond) {
    return -EINVAL;
  }
  pthread_cond_destroy(cond);
  return 0;
}


x86 assembly (clang, -O0):
<gen_posix_cond_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <gen_posix_cond_destroy+0x2a>
xor    %eax,%eax
mov    0x2eb0(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <gen_posix_cond_destroy+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <pthread_cond_destroy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_posix_cond_destroy>:
push   %rax
test   %rdi,%rdi
je     111f <gen_posix_cond_destroy+0xf>
call   1030 <pthread_cond_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2eba(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @gen_posix_cond_destroy(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32 @pthread_cond_destroy(i32* %10)
store i32 0, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @gen_posix_cond_destroy(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
br label %8
6: ; preds = %1
%7 = tail call i32 @pthread_cond_destroy(i32* %0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ 0, %6 ], [ %5, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void btktermio_beep(void) {
  printf("\a");
  ;
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
define void @btktermio_beep() {
%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 @btktermio_beep() {
%1 = tail call i32 @putchar(i32 7)
ret void
}
void foo623() {}


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

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

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

LLVM IR (-O2):
define void @foo623() {
ret void
}
int test_llist_remove() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_llist_remove() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SAFE_MUNMAP(void *, size_t);
void tst_numa_unmap(void *ptr, size_t size) { SAFE_MUNMAP(ptr, size); }


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

x86 assembly (clang, -O2):
<tst_numa_unmap>:
jmp    1030 <SAFE_MUNMAP@plt>

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

LLVM IR (-O2):
define void @tst_numa_unmap(i8* %0, i64 %1) {
%3 = tail call i32 @SAFE_MUNMAP(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
scalar_t__ queue_demo();
scalar_t__ stack_demo();
int main(int argc, char **argv) {
  printf("DS Demo\n");
  if (stack_demo() == 0 && queue_demo() == 0)
    return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <stack_demo@plt>
cmp    $0x0,%rax
jne    1180 <main+0x50>
mov    $0x0,%al
call   1050 <queue_demo@plt>
cmp    $0x0,%rax
jne    1180 <main+0x50>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <stack_demo@plt>
test   %rax,%rax
jne    1162 <main+0x32>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <queue_demo@plt>
test   %rax,%rax
jne    1162 <main+0x32>
mov    0x2e80(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"DS Demo\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i64 (...) @stack_demo()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = call i64 (...) @queue_demo()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* @EXIT_SUCCESS
store i32 %13, i32* %3
br label %14
14: ; preds = %12, %9, %2
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"DS Demo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i64 (...) @stack_demo()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i64 (...) @queue_demo()
%8 = icmp eq i64 %7, 0
%9 = load i32, i32* @EXIT_SUCCESS
%10 = select i1 %8, i32 %9, i32 0
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
void morse_ditdat_sound_blocking(char encoded) {
  char count = (encoded & 7);
  char i = 0;
}


x86 assembly (clang, -O0):
<morse_ditdat_sound_blocking>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @morse_ditdat_sound_blocking(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = and i32 %6, 7
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
store i8 0, i8* %4
ret void
}

LLVM IR (-O2):
define void @morse_ditdat_sound_blocking(i8 signext %0) {
ret void
}
/* Variables and functions */
int GetThreadWork();
int /*<<< orphan*/ workfunction(int);
void ThreadWorkerFunction(int threadnum) {
  int work;
  while (1) {
    work = GetThreadWork();
    if (work == -1) {
      break;
    }
    workfunction(work);
  }
}


x86 assembly (clang, -O0):
<ThreadWorkerFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GetThreadWork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1144 <ThreadWorkerFunction+0x24>
jmp    1151 <ThreadWorkerFunction+0x31>
mov    -0x8(%rbp),%edi
call   1040 <workfunction@plt>
jmp    112b <ThreadWorkerFunction+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreadWorkerFunction>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <GetThreadWork@plt>
cmp    $0xffffffff,%eax
je     1145 <ThreadWorkerFunction+0x25>
mov    %eax,%edi
call   1040 <workfunction@plt>
jmp    1130 <ThreadWorkerFunction+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @ThreadWorkerFunction(i32 %0) {
%2 = tail call i32 (...) @GetThreadWork()
%3 = icmp eq i32 %2, -1
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @workfunction(i32 %5)
%7 = tail call i32 (...) @GetThreadWork()
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}