xunge/DecIR huggingface dataset:
void default_log(int priority, const char *file, int line, const char *format,
                 ...) {
  return;
}


x86 assembly (clang, -O0):
<default_log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @default_log(i32 %0, i8* nocapture %1, i32 %2, i8* nocapture %3, ...) {
ret void
}
int mps_present() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mps_present() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strrchr(char *, char);
int get_ccw_dev(char *partition, char *device) {
  char *stop;
  stop = strrchr(partition, '/');
  if (stop == NULL)
    return -1;
  strncpy(device, stop + 1, 8);
  return 0;
}


x86 assembly (clang, -O0):
<get_ccw_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <get_ccw_dev+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <get_ccw_dev+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ccw_dev>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     114b <get_ccw_dev+0x2b>
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_ccw_dev(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i8* @strrchr(i8* %7, i8 signext 47)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %17
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = call i32 @strncpy(i8* %13, i8* %15, i32 8)
store i32 0, i32* %3
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_ccw_dev(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i32 @strncpy(i8* %1, i8* %6, i32 8)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
int sum_mmx2(void) {
  int ret;
  asm volatile("movd %%mm6, %0			\n\t" : "=r"(ret));
  return ret;
}


x86 assembly (clang, -O0):
<sum_mmx2>:
push   %rbp
mov    %rsp,%rbp
movd   %mm6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_mmx2>:
movd   %mm6,%eax
ret

LLVM IR (-O0):
define i32 @sum_mmx2() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movd %mm6, $0\09\09\09\0A\09", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @sum_mmx2() {
%1 = tail call i32 asm sideeffect "movd %mm6, $0\09\09\09\0A\09", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(void) {
  f(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
ret i32 0
}
/* Variables and functions */
size_t ft_strlen(const char *str) {
  char *much;
  if (!str)
    return (0);
  much = (char *)str;
  while (*much != 0)
    much++;
  return (much - str);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <ft_strlen+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1158 <ft_strlen+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <ft_strlen+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <ft_strlen+0x28>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
test   %rdi,%rdi
je     111f <ft_strlen+0x1f>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
br label %12
12: ; preds = %1, %8
%13 = phi i64 [ %11, %8 ], [ 0, %1 ]
ret i64 %13
}
void test_trace(void) {}


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

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

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

LLVM IR (-O2):
define void @test_trace() {
ret void
}
/* Type definitions */
typedef int u_int64_t;
typedef int u_int32_t;
typedef int /*<<< orphan*/ low_part;
typedef int /*<<< orphan*/ high_part;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char *, int);
int ntohl(int);
u_int64_t untoh64(void *network) {
  char *unaligned = (char *)network;
  u_int32_t high_part, low_part;
  memcpy(&high_part, unaligned, sizeof(high_part));
  unaligned += sizeof(high_part);
  memcpy(&low_part, unaligned, sizeof(low_part));
  high_part = ntohl(high_part);
  low_part = ntohl(low_part);
  return (((u_int64_t)high_part) << 32) + low_part;
}


x86 assembly (clang, -O0):
<untoh64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
add    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<untoh64>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x4,%rbx
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1040 <ntohl@plt>
mov    0x8(%rsp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @untoh64(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i32* %4, i8* %7, i32 4)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 4
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @memcpy(i32* %5, i8* %11, i32 4)
%13 = load i32, i32* %4
%14 = call i32 @ntohl(i32 %13)
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @ntohl(i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = shl i32 %17, 32
%19 = load i32, i32* %5
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @untoh64(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = call i32 @memcpy(i32* %3, i8* %7, i32 4)
%9 = load i32, i32* %2
%10 = call i32 @ntohl(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @ntohl(i32 %11)
ret i32 poison
}
/* Variables and functions */
int atoi(char *);
char *strstr(char *, char *);
int ph_parseRegProgressRid(char *data) {
  char *tag = strstr(data, "RID=");
  if (!tag)
    return 0;
  return atoi(tag + 4);
}


x86 assembly (clang, -O0):
<ph_parseRegProgressRid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <ph_parseRegProgressRid+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <ph_parseRegProgressRid+0x47>
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ph_parseRegProgressRid>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     113f <ph_parseRegProgressRid+0x1f>
add    $0x4,%rax
mov    %rax,%rdi
pop    %rax
jmp    1030 <atoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"RID=\00"
define i32 @ph_parseRegProgressRid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %14
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 4
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"RID=\00"
define i32 @ph_parseRegProgressRid(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 4
%6 = tail call i32 @atoi(i8* %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __stdio_fseek(int /*<<< orphan*/ *, long, int);
int fseek(FILE *stream, long offset, int whence) {
  return __stdio_fseek(stream, offset, whence);
}


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

x86 assembly (clang, -O2):
<fseek>:
jmp    1030 <__stdio_fseek@plt>

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

LLVM IR (-O2):
define i32 @fseek(i32* %0, i64 %1, i32 %2) {
%4 = tail call i32 @__stdio_fseek(i32* %0, i64 %1, i32 %2)
ret i32 %4
}
void zera_vetor(int vet[4]) {
  int i;
  for (i = 0; i < 4; i++) {
    vet[i] = 1000;
  }
}


x86 assembly (clang, -O0):
<zera_vetor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1136 <zera_vetor+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x3e8,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <zera_vetor+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zera_vetor>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @zera_vetor(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1000, i32 1000, i32 1000, i32 1000>, <4 x i32>* %2
ret void
}
void e(unsigned long long x) {
  if (x < 0)
    return;
  if (x >= 0)
    return;
  if (0 > x)
    return;
  if (0 <= x)
    return;
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jae    1118 <e+0x18>
jmp    114a <e+0x4a>
cmpq   $0x0,-0x8(%rbp)
jb     1128 <e+0x28>
jmp    114a <e+0x4a>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jbe    1139 <e+0x39>
jmp    114a <e+0x4a>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
ja     114a <e+0x4a>
jmp    114a <e+0x4a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @e(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %18
6: ; preds = %1
%7 = load i64, i64* %2
%8 = icmp uge i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %18
10: ; preds = %6
%11 = load i64, i64* %2
%12 = icmp ugt i64 0, %11
br i1 %12, label %13, label %14
13: ; preds = %10
br label %18
14: ; preds = %10
%15 = load i64, i64* %2
%16 = icmp ule i64 0, %15
br i1 %16, label %17, label %18
17: ; preds = %14
br label %18
18: ; preds = %5, %9, %13, %17, %14
ret void
}

LLVM IR (-O2):
define void @e(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void handle_sigint(int signal) {
  printf("SIGINT signal received!\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<handle_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_sigint>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"SIGINT signal received!\0A\00"
@EXIT_SUCCESS = global i32 0
define void @handle_sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [24 x i8] c"SIGINT signal received!\00"
define void @handle_sigint(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void regular_printerrflush(void) { fflush(stderr); }


x86 assembly (clang, -O0):
<regular_printerrflush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<regular_printerrflush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @regular_printerrflush() {
%1 = load i32, i32* @stderr
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @regular_printerrflush() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_ls() {
  puts("Available commands:\n"
       "help [<command name>]\n"
       "prompt [on | off]\n"
       "init [<hotel name>]\n"
       "drop [<hotel name>]\n"
       "create-service [<service name>]\n"
       "list [hotels | services | guests]\n"
       "switch [<hotel name>]\n"
       "back\n"
       "book [<guest name>]\n"
       "service [<service name>]\n"
       "bill [<guest name>]\n"
       "checkout [<guest name>]");
}


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

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

LLVM IR (-O0):
@.str = [282 x i8] c"Available commands:\0Ahelp [<command name>]\0Aprompt [on | off]\0Ainit [<hotel name>]\0Adrop [<hotel name>]\0Acreate-service [<service name>]\0Alist [hotels | services | guests]\0Aswitch [<hotel name>]\0Aback\0Abook [<guest name>]\0Aservice [<service name>]\0Abill [<guest name>]\0Acheckout [<guest name>]\00"
define void @help_ls() {
%1 = call i32 @puts(i8* getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [282 x i8] c"Available commands:\0Ahelp [<command name>]\0Aprompt [on | off]\0Ainit [<hotel name>]\0Adrop [<hotel name>]\0Acreate-service [<service name>]\0Alist [hotels | services | guests]\0Aswitch [<hotel name>]\0Aback\0Abook [<guest name>]\0Aservice [<service name>]\0Abill [<guest name>]\0Acheckout [<guest name>]\00"
define void @help_ls() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([282 x i8], [282 x i8]* @.str, i64 0, i64 0))
ret void
}
int isdigit(c)
int c;
{ return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ example_decode_struct();
int /*<<< orphan*/ example_encode_int();
int /*<<< orphan*/ example_encode_struct();
int htole16(int);
int /*<<< orphan*/ printf(char *, char);
int main() {
  printf("host is %ce\n", (htole16(0x1234) == 0x1234) ? 'l' : 'b');
  example_encode_int();
  example_encode_struct();
  example_decode_struct();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1234,%edi
call   1050 <htole16@plt>
mov    %eax,%edx
mov    $0x62,%eax
mov    $0x6c,%ecx
cmp    $0x1234,%edx
cmove  %ecx,%eax
lea    0xe7b(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <example_encode_int@plt>
mov    $0x0,%al
call   1070 <example_encode_struct@plt>
mov    $0x0,%al
call   1030 <example_decode_struct@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1234,%edi
call   1050 <htole16@plt>
cmp    $0x1234,%eax
mov    $0x6c,%eax
mov    $0x62,%esi
cmove  %eax,%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <example_encode_int@plt>
xor    %eax,%eax
call   1070 <example_encode_struct@plt>
xor    %eax,%eax
call   1030 <example_decode_struct@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"host is %ce\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @htole16(i32 4660)
%3 = icmp eq i32 %2, 4660
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 108, i32 98
%6 = trunc i32 %5 to i8
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = call i32 (...) @example_encode_int()
%9 = call i32 (...) @example_encode_struct()
%10 = call i32 (...) @example_decode_struct()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"host is %ce\0A\00"
define i32 @main() {
%1 = tail call i32 @htole16(i32 4660)
%2 = icmp eq i32 %1, 4660
%3 = select i1 %2, i8 108, i8 98
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = tail call i32 (...) @example_encode_int()
%6 = tail call i32 (...) @example_encode_struct()
%7 = tail call i32 (...) @example_decode_struct()
ret i32 0
}
int Drone_init(void *self) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Drone_init(i8* nocapture readnone %0) {
ret i32 1
}
int ifunc123(int a, int b) { return a + b + 2; }


x86 assembly (clang, -O0):
<ifunc123>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifunc123>:
lea    (%rdi,%rsi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @ifunc123(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 = add nsw i32 %5, %6
%8 = add nsw i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @ifunc123(i32 %0, i32 %1) {
%3 = add i32 %0, 2
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long long f28(unsigned long long x,
                                                    unsigned long long y) {
  unsigned long long r = x + y;
  if (x >= r)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f28>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1141 <f28+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f28>:
push   %rbx
mov    %rsi,%rbx
add    %rdi,%rbx
cmp    %rdi,%rbx
ja     1123 <f28+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f28(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ugt i64 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
char *os_GetSuffixPtr(char const *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int os_rGetSuffix(char const *path, char *buf, int size) {
  char *s = os_GetSuffixPtr(path);
  if (!s) {
    buf[0] = 0;
    return 0;
  }
  strncpy(buf, s, size);
  return strlen(buf);
}


x86 assembly (clang, -O0):
<os_rGetSuffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <os_GetSuffixPtr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    116e <os_rGetSuffix+0x3e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    118a <os_rGetSuffix+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_rGetSuffix>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1050 <os_GetSuffixPtr@plt>
test   %rax,%rax
je     115d <os_rGetSuffix+0x2d>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <strlen@plt>
movb   $0x0,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @os_rGetSuffix(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @os_GetSuffixPtr(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %3
store i8 0, i8* %1
br label %10
7: ; preds = %3
%8 = tail call i32 @strncpy(i8* %1, i8* %4, i32 %2)
%9 = tail call i32 @strlen(i8* %1)
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ %9, %7 ], [ 0, %6 ]
ret i32 %11
}
void STAT_print(int thread) {}


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

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

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

LLVM IR (-O2):
define void @STAT_print(i32 %0) {
ret void
}
long ownlen(char *input) {
  long charc = 0;
  while (input[charc] != '\0' || input[charc] != '\n') {
    charc++;
  }
  return charc;
}


x86 assembly (clang, -O0):
<ownlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    113f <ownlen+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114f <ownlen+0x4f>
jmp    1160 <ownlen+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ownlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @ownlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 10
br label %18
18: ; preds = %11, %4
%19 = phi i1 [ true, %4 ], [ %17, %11 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i64, i64* %3
%22 = add nsw i64 %21, 1
store i64 %22, i64* %3
br label %4
23: ; preds = %18
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ tstr;
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *strTime(time_t tx, char *format) {
  static char tstr[32];
  struct tm *tl;
  memset(tstr, 0, sizeof(tstr));
  tl = localtime(&tx);
  strftime(tstr, (sizeof(tstr) - 1), format, tl);
  return tstr;
}


x86 assembly (clang, -O0):
<strTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0x2f0a(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0x2ee2(%rip),%rdi
mov    $0x1f,%esi
call   1050 <strftime@plt>
lea    0x2ed1(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strTime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
lea    0x2f0e(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %r14,%rdi
mov    $0x1f,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@strTime.tstr = internal global [32 x i8] zeroinitializer
define i8* @strTime(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.tm*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @memset(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @strTime.tstr, i64 0, i64 0), i32 0, i32 32)
%7 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %7, %struct.tm** %5
%8 = load i8*, i8** %4
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @strTime.tstr, i64 0, i64 0), i32 31, i8* %8, %struct.tm* %9)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @strTime.tstr, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@strTime.tstr = internal global [32 x i8] zeroinitializer
define i8* @strTime(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = tail call i32 @memset(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @strTime.tstr, i64 0, i64 0), i32 0, i32 32)
%5 = call %struct.tm* @localtime(i32* %3)
%6 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @strTime.tstr, i64 0, i64 0), i32 31, i8* %1, %struct.tm* %5)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @strTime.tstr, i64 0, i64 0)
}
/* Variables and functions */
int foo();
__attribute__((target("avx512vnni,avx512vl"))) int bar(void) { return foo(); }


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @foo()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
void foo720(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo720(i32 %0) {
ret void
}
/* Type definitions */
struct md5_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ md5_init(struct md5_s *);
void DVDInitMD5(struct md5_s *h) { md5_init(h); }


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

x86 assembly (clang, -O2):
<DVDInitMD5>:
jmp    1030 <md5_init@plt>

LLVM IR (-O0):
%struct.md5_s = type { i32 }
define void @DVDInitMD5(%struct.md5_s* %0) {
%2 = alloca %struct.md5_s*
store %struct.md5_s* %0, %struct.md5_s** %2
%3 = load %struct.md5_s*, %struct.md5_s** %2
%4 = call i32 @md5_init(%struct.md5_s* %3)
ret void
}

LLVM IR (-O2):
%struct.md5_s = type { i32 }
define void @DVDInitMD5(%struct.md5_s* %0) {
%2 = tail call i32 @md5_init(%struct.md5_s* %0)
ret void
}
__attribute__((always_)) void outw(unsigned short value, int port) {
  asm volatile("out"
               "w"
               " %"
               "w"
               "0, %w1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%edx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outw ${0:w}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHostSuspend(uint32_t ui32Base) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000001))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<USBHostSuspend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
or     $0x2,%ecx
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostSuspend>:
orl    $0x2,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBHostSuspend(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 2
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBHostSuspend(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 2
store volatile i32 %5, i32* %3
ret void
}
void intel_crt_save(struct drm_output *output) {}


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

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

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

LLVM IR (-O2):
%struct.drm_output = type opaque
define void @intel_crt_save(%struct.drm_output* nocapture %0) {
ret void
}
int ZTypeInRange(int type, int low, int high) {
  return type >= low && type <= high;
}


x86 assembly (clang, -O0):
<ZTypeInRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <ZTypeInRange+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZTypeInRange>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ZTypeInRange(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_61(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 61)
    return pos;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @fn_ch_61(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 61
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xec() {
  Assert_real((isbdigit(236) == 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_isbdigit.c",
              1185, ("isbdigit should be 0 for 0xec"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xec\00"
define void @t_isbdigit_0xec() {
%1 = tail call i64 @isbdigit(i32 236)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1185, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ui_loop(int, char **, char *);
int main(int argc, char *argv[]) { return ui_loop(argc, argv, "spin"); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdx
call   1030 <ui_loop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdx
jmp    1030 <ui_loop@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"spin\00"
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @ui_loop(i32 %6, i8** %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"spin\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ui_loop(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void list_devices() {
  fprintf(stderr, "listing not yet implemented\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<list_devices>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<list_devices>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"listing not yet implemented\0A\00"
@EXIT_FAILURE = global i32 0
define void @list_devices() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"listing not yet implemented\0A\00"
@EXIT_FAILURE = global i32 0
define void @list_devices() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int f42(int *);
int f43(int *p) { return f42(p); }


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

x86 assembly (clang, -O2):
<f43>:
jmp    1030 <f42@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_text_mark_get_name() {
ret void
}
void swapTwoNumbers(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


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

x86 assembly (clang, -O2):
<swapTwoNumbers>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swapTwoNumbers(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void INT_Excep_TPU2_TGI2A(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU2_TGI2A() {
ret void
}
int startwin_run(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @startwin_run() {
ret i32 1
}

LLVM IR (-O2):
define i32 @startwin_run() {
ret i32 1
}
void a_store(volatile int *p, int x) {
  __asm__(".byte 0x67\n\tmov %1, %0" : "=m"(*p) : "r"(x) : "memory");
}


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

x86 assembly (clang, -O2):
<a_store>:
mov    %esi,(%edi)
ret

LLVM IR (-O0):
define void @a_store(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
ret void
}

LLVM IR (-O2):
define void @a_store(i32* %0, i32 %1) {
tail call void asm ".byte 0x67\0A\09mov $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LibDeck_UtilCloseRandom();
void LibDeck_DestroyLibrary(void) { LibDeck_UtilCloseRandom(); }


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

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

LLVM IR (-O0):
define void @LibDeck_DestroyLibrary() {
%1 = call i32 (...) @LibDeck_UtilCloseRandom()
ret void
}

LLVM IR (-O2):
define void @LibDeck_DestroyLibrary() {
%1 = tail call i32 (...) @LibDeck_UtilCloseRandom()
ret void
}