xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int posix_spawnattr_init(posix_spawnattr_t *ret) {
  if (ret == NULL)
    return -1;
  memset(ret, 0, sizeof(posix_spawnattr_t));
  return 0;
}


x86 assembly (clang, -O0):
<posix_spawnattr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <posix_spawnattr_init+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <posix_spawnattr_init+0x3a>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnattr_init>:
push   %rbx
test   %rdi,%rdi
je     1126 <posix_spawnattr_init+0x16>
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
jmp    112b <posix_spawnattr_init+0x1b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @posix_spawnattr_init(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @memset(i32* %0, i32 0, i32 4)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void afficher_messageR(char *message, int lg) {
  int i;
  for (i = 0; i < lg; i++)
    printf("%c", message[i]);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @afficher_messageR(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
int ispunct(int c) { return c > ' ' && c <= '~' && !isalnum(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    114c <ispunct+0x3c>
xor    %eax,%eax
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     114c <ispunct+0x3c>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
lea    -0x21(%rdi),%ecx
xor    %eax,%eax
cmp    $0x5d,%ecx
ja     112d <ispunct+0x1d>
push   %rax
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @isalnum(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
unsigned int _lrotl(unsigned int, int);
unsigned int test_lrotl(unsigned int value, int shift) {
  return _lrotl(value, shift);
}


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

x86 assembly (clang, -O2):
<test_lrotl>:
jmp    1030 <_lrotl@plt>

LLVM IR (-O0):
define i32 @test_lrotl(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 @_lrotl(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_lrotl(i32 %0, i32 %1) {
%3 = tail call i32 @_lrotl(i32 %0, i32 %1)
ret i32 %3
}
void sleep(unsigned short ms) {
  unsigned short j, k;
  for (j = 0; j < ms; j++) {
    for (k = 0; k < 5714; k++) {
    }
  }
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1162 <sleep+0x62>
movw   $0x0,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x1652,%eax
jge    114c <sleep+0x4c>
jmp    113b <sleep+0x3b>
mov    -0x6(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x6(%rbp)
jmp    1127 <sleep+0x27>
jmp    1151 <sleep+0x51>
mov    -0x4(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x4(%rbp)
jmp    1111 <sleep+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sleep(i16 zeroext %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void barWrite8(uint32_t bar, uint32_t offset, uint8_t value) {
  volatile uint8_t *pReg = (volatile uint8_t *)(bar | (offset & 0xFF));
  *pReg = value;
}


x86 assembly (clang, -O0):
<barWrite8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<barWrite8>:
movzbl %sil,%eax
or     %edi,%eax
cltq
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @barWrite8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = or i32 %8, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %7
%14 = load i32, i32* %6
%15 = load i32*, i32** %7
store volatile i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @barWrite8(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = or i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %2, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_adc();
int /*<<< orphan*/ e_zp();
void e_adc_zp() {
  e_zp();
  e_adc();
}


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

x86 assembly (clang, -O2):
<e_adc_zp>:
push   %rax
xor    %eax,%eax
call   1030 <e_zp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_adc@plt>

LLVM IR (-O0):
define void @e_adc_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_adc()
ret void
}

LLVM IR (-O2):
define void @e_adc_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_adc()
ret void
}
int nfs_have_delegation(struct inode *inode, int flags) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @nfs_have_delegation(%struct.inode* %0, i32 %1) {
%3 = alloca %struct.inode*
%4 = alloca i32
store %struct.inode* %0, %struct.inode** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @nfs_have_delegation(%struct.inode* nocapture readnone %0, i32 %1) {
ret i32 0
}
void RTSystemQueryAvailableRam(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSystemQueryAvailableRam() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int strPcmp(const void *a, const void *b) {
  return strcmp(**(char ***)a, **(char ***)b);
}


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

x86 assembly (clang, -O2):
<strPcmp>:
mov    (%rdi),%rax
mov    (%rax),%rdi
mov    (%rsi),%rax
mov    (%rax),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strPcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8***
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
%6 = bitcast i8* %1 to i8***
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %8)
ret i32 %9
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ testBit(unsigned long long, int);
void clearBit(uint64_t *bb, int i) {
  assert(testBit(*bb, i));
  *bb ^= 1ull << i;
}


x86 assembly (clang, -O0):
<clearBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
call   1040 <testBit@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBit>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1040 <testBit@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%rax
xor    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @clearBit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i32, i32* %4
%8 = call i32 @testBit(i64 %6, i32 %7)
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = shl i64 1, %11
%13 = load i64*, i64** %3
%14 = load i64, i64* %13
%15 = xor i64 %14, %12
store i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @clearBit(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
%4 = tail call i32 @testBit(i64 %3, i32 %1)
%5 = tail call i32 @assert(i32 %4)
%6 = zext i32 %1 to i64
%7 = shl nuw i64 1, %6
%8 = load i64, i64* %0
%9 = xor i64 %8, %7
store i64 %9, i64* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_fputs(char const *, int /*<<< orphan*/ *);
int __wrap_fputs(const char *s, FILE *stream) { return dll_fputs(s, stream); }


x86 assembly (clang, -O0):
<__wrap_fputs>:
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 <dll_fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_fputs>:
jmp    1030 <dll_fputs@plt>

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

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

/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pthread_cond_init(void *, int /*<<< orphan*/ *);
void *EventCreate(int ManualReset, int InitState) {
  pthread_condattr_t attr;
  pthread_cond_t *cond = malloc(sizeof(pthread_cond_t));
  pthread_cond_init(cond, &attr);
  return cond;
}


x86 assembly (clang, -O0):
<EventCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <pthread_cond_init@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EventCreate>:
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
call   1030 <pthread_cond_init@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @EventCreate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i8* @malloc(i32 1)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @pthread_cond_init(i8* %8, i32* %5)
%10 = load i8*, i8** %6
ret i8* %10
}

LLVM IR (-O2):
define i8* @EventCreate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%6 = call i32 @pthread_cond_init(i8* %5, i32* %3)
ret i8* %5
}
void bar_short(void) { foo_short(2 - 3i); }


x86 assembly (clang, -O0):
<bar_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <foo_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_short>:
movabs $0xfffffffd00000002,%rdi
ff ff ff
xor    %eax,%eax
jmp    1030 <foo_short@plt>

LLVM IR (-O0):
define void @bar_short() {
%1 = alloca { i32, i32 }
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 1
store i32 2, i32* %2
store i32 -3, i32* %3
%4 = bitcast { i32, i32 }* %1 to i64*
%5 = load i64, i64* %4
%6 = call i32 (i64, ...) bitcast (i32 (...)* @foo_short to i32 (i64, ...)*)(i64 %5)
ret void
}

LLVM IR (-O2):
define void @bar_short() {
%1 = tail call i32 (i64, ...) bitcast (i32 (...)* @foo_short to i32 (i64, ...)*)(i64 -12884901886)
ret void
}
float sq_area_diagonal(float diagonal) {
  float area = diagonal * diagonal / 2;
  return area;
}


x86 assembly (clang, -O0):
<sq_area_diagonal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq_area_diagonal>:
mulss  %xmm0,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @sq_area_diagonal(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = fdiv float %6, 2.000000e+00
store float %7, float* %3
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
define float @sq_area_diagonal(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, 5.000000e-01
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x21() {
  Assert_real((isbdigit(33) == 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",
              170, ("isbdigit should be 0 for !"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x21>:
push   %rax
mov    $0x21,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xaa,%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 = [27 x i8] c"isbdigit should be 0 for !\00"
define void @t_isbdigit_0x21() {
%1 = call i64 @isbdigit(i32 33)
%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 170, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for !\00"
define void @t_isbdigit_0x21() {
%1 = tail call i64 @isbdigit(i32 33)
%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 170, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int count_arg(char *);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", count_arg("test %d %d %d")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
call   1040 <count_arg@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [14 x i8] c"test %d %d %d\00"
define i32 @main() {
%1 = tail call i32 @count_arg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mouseMotionWithButtons(int, int);
void mouseMotionFunc(int mousePositionX, int mousePositionY) {
  mouseMotionWithButtons(mousePositionX, mousePositionY);
}


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

x86 assembly (clang, -O2):
<mouseMotionFunc>:
jmp    1030 <mouseMotionWithButtons@plt>

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

LLVM IR (-O2):
define void @mouseMotionFunc(i32 %0, i32 %1) {
%3 = tail call i32 @mouseMotionWithButtons(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
getchar() { return getc(stdin); }


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

x86 assembly (clang, -O2):
<getchar>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
ret i32 %2
}
void ScaleRowDown2Box_Odd_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown2Box_Odd_AVX2() {
ret void
}
/* Variables and functions */
int max_phrase_length(char *);
char *max_phrase_length_01a() {
  char hex[] = "00020000000100030000";
  do {
    if (!(max_phrase_length(hex) == 59))
      return "return 59 (words plus spaces) for a hex string of 5 quads";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<max_phrase_length_01a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed7(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <max_phrase_length@plt>
cmp    $0x3b,%eax
je     1162 <max_phrase_length_01a+0x52>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <max_phrase_length_01a+0x5f>
jmp    1167 <max_phrase_length_01a+0x57>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_phrase_length_01a>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x30303030333030,%rax
mov    %rax,0xd(%rsp)
mov    %rsp,%rdi
call   1030 <max_phrase_length@plt>
xor    %ecx,%ecx
cmp    $0x3b,%eax
lea    0xed3(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.max_phrase_length_01a.hex = [21 x i8] c"00020000000100030000\00"
@.str = [58 x i8] c"return 59 (words plus spaces) for a hex string of 5 quads\00"
define i8* @max_phrase_length_01a() {
%1 = alloca i8*
%2 = alloca [21 x i8]
%3 = bitcast [21 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%6 = call i32 @max_phrase_length(i8* %5)
%7 = icmp eq i32 %6, 59
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.max_phrase_length_01a.hex = [21 x i8] c"00020000000100030000\00"
@.str = [58 x i8] c"return 59 (words plus spaces) for a hex string of 5 quads\00"
define i8* @max_phrase_length_01a() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 @max_phrase_length(i8* %2)
%4 = icmp eq i32 %3, 59
%5 = select i1 %4, i8* null, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
double ln_deg_to_rad(double degrees) {
  return (degrees * (1.7453292519943295769e-2));
}


x86 assembly (clang, -O0):
<ln_deg_to_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ln_deg_to_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F91DF46A2529D39
ret double %4
}

LLVM IR (-O2):
define double @ln_deg_to_rad(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
ret double %2
}
/* Variables and functions */
long __pathconf_common(int);
long fpathconf(int fd, int name) { return __pathconf_common(name); }


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

x86 assembly (clang, -O2):
<fpathconf>:
mov    %esi,%edi
jmp    1030 <__pathconf_common@plt>

LLVM IR (-O0):
define i64 @fpathconf(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 = call i64 @__pathconf_common(i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @fpathconf(i32 %0, i32 %1) {
%3 = tail call i64 @__pathconf_common(i32 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sync();
int /*<<< orphan*/ write(int, char *, int);
void clear_caches() {
  int fd;
  char *data = "3";
  sync();
  fd = open("/proc/sys/vm/drop_caches", O_WRONLY);
  if (fd != -1) {
    write(fd, data, sizeof(char));
    close(fd);
  }
}


x86 assembly (clang, -O0):
<clear_caches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <sync@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
lea    0xe98(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1195 <clear_caches+0x55>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_caches>:
push   %rbx
xor    %eax,%eax
call   1050 <sync@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1060 <open@plt>
cmp    $0xffffffff,%eax
je     117f <clear_caches+0x3f>
mov    %eax,%ebx
lea    0xe95(%rip),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"3\00"
@.str.1 = [25 x i8] c"/proc/sys/vm/drop_caches\00"
@O_WRONLY = global i32 0
define void @clear_caches() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 (...) @sync()
%4 = load i32, i32* @O_WRONLY
%5 = call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %1
%10 = load i8*, i8** %2
%11 = call i32 @write(i32 %9, i8* %10, i32 1)
%12 = load i32, i32* %1
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"3\00"
@.str.1 = [25 x i8] c"/proc/sys/vm/drop_caches\00"
@O_WRONLY = global i32 0
define void @clear_caches() {
%1 = tail call i32 (...) @sync()
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = tail call i32 @close(i32 %3)
br label %8
8: ; preds = %5, %0
ret void
}
void stack_list_push(struct Stack *s, int x) {}


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

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

LLVM IR (-O0):
%struct.Stack = type opaque
define void @stack_list_push(%struct.Stack* %0, i32 %1) {
%3 = alloca %struct.Stack*
%4 = alloca i32
store %struct.Stack* %0, %struct.Stack** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.Stack = type opaque
define void @stack_list_push(%struct.Stack* nocapture %0, i32 %1) {
ret void
}
int test_imm_BAint16_reg(short val) {
  return ((val) & (-0xBA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BAint16_reg(i16 signext %0) {
%2 = and i16 %0, -186
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void lif_close_img_file(int descriptor) { close(descriptor); }


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

x86 assembly (clang, -O2):
<lif_close_img_file>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @lif_close_img_file(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void init_rambases() {}


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

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

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

LLVM IR (-O2):
define void @init_rambases() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ si_uid;
  scalar_t__ si_pid;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
void hdl(int signal, siginfo_t *siginfo, void *context) {
  printf("Sending PID: %ld, UID: %ld\n", (long)siginfo->si_pid,
         (long)siginfo->si_uid);
}


x86 assembly (clang, -O0):
<hdl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdl>:
mov    (%rsi),%rdx
mov    0x8(%rsi),%rsi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
@.str = [28 x i8] c"Sending PID: %ld, UID: %ld\0A\00"
define void @hdl(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64 }
@.str = [28 x i8] c"Sending PID: %ld, UID: %ld\0A\00"
define void @hdl(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %7)
ret void
}
void deConnection() {}


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

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

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

LLVM IR (-O2):
define void @deConnection() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
void component_editor_cursor_set_param(void *handle, unsigned int index,
                                       char *value) {
  if (!handle) {
    debug_warning("[component_editor_cursor_set_param] handle cannot be NULL");
    return;
  }
  debug_warning("[component_editor_cursor_set_param] component_editor_cursor "
                "is an internal component which does not have parameters");
}


x86 assembly (clang, -O0):
<component_editor_cursor_set_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113f <component_editor_cursor_set_param+0x2f>
lea    0xecb(%rip),%rdi
call   1030 <debug_warning@plt>
jmp    114b <component_editor_cursor_set_param+0x3b>
lea    0xef4(%rip),%rdi
call   1030 <debug_warning@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_editor_cursor_set_param>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
lea    0xf19(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <debug_warning@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"[component_editor_cursor_set_param] handle cannot be NULL\00"
@.str.1 = [116 x i8] c"[component_editor_cursor_set_param] component_editor_cursor is an internal component which does not have parameters\00"
define void @component_editor_cursor_set_param(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = call i32 @debug_warning(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %3
%12 = call i32 @debug_warning(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"[component_editor_cursor_set_param] handle cannot be NULL\00"
@.str.1 = [116 x i8] c"[component_editor_cursor_set_param] component_editor_cursor is an internal component which does not have parameters\00"
define void @component_editor_cursor_set_param(i8* readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %0, null
%5 = select i1 %4, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @debug_warning(i8* %5)
ret void
}
/* Variables and functions */
unsigned long callthru3(int, unsigned long, unsigned long, unsigned long);
unsigned long bogus_socket_conn_probe(int dev, void *addr, int conn) {
  return callthru3(224, (unsigned long)dev, (unsigned long)addr,
                   (unsigned long)conn);
}


x86 assembly (clang, -O0):
<bogus_socket_conn_probe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rcx
mov    $0xe0,%edi
call   1030 <callthru3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bogus_socket_conn_probe>:
mov    %rsi,%rax
movslq %edi,%rsi
movslq %edx,%rcx
mov    $0xe0,%edi
mov    %rax,%rdx
jmp    1030 <callthru3@plt>

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

LLVM IR (-O2):
define i64 @bogus_socket_conn_probe(i32 %0, i8* %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = ptrtoint i8* %1 to i64
%6 = sext i32 %2 to i64
%7 = tail call i64 @callthru3(i32 224, i64 %4, i64 %5, i64 %6)
ret i64 %7
}
void EVP_CIPHER_CTX_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_flags() {
ret void
}
/* Variables and functions */
double cycle_timer();
double get_microseconds(double cpu_freq) { return cycle_timer() / cpu_freq; }


x86 assembly (clang, -O0):
<get_microseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <cycle_timer@plt>
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_microseconds>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <cycle_timer@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_microseconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @cycle_timer()
%4 = load double, double* %2
%5 = fdiv double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @get_microseconds(double %0) {
%2 = tail call double (...) @cycle_timer()
%3 = fdiv double %2, %0
ret double %3
}
int fun2(unsigned word) { return (((int)word << 24) >> 24); }


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun2>:
movsbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @fun2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = ashr i32 %4, 24
ret i32 %5
}

LLVM IR (-O2):
define i32 @fun2(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t uleb_byte_get_has_next(const uint8_t byte) { return (byte & 0x80); }


x86 assembly (clang, -O0):
<uleb_byte_get_has_next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uleb_byte_get_has_next>:
mov    %edi,%eax
and    $0x80,%eax
ret

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

LLVM IR (-O2):
define i32 @uleb_byte_get_has_next(i32 %0) {
%2 = and i32 %0, 128
ret i32 %2
}
int clk_debugfs_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clk_debugfs_init() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char const);
int isLineEmpty(const char *line) {
  while (*line != '\0') {
    if (isspace(*line) == 0)
      return 0;
    line++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isLineEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <isLineEmpty+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    114e <isLineEmpty+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1166 <isLineEmpty+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isLineEmpty+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLineEmpty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114c <isLineEmpty+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     114a <isLineEmpty+0x3a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isLineEmpty+0x20>
jmp    114c <isLineEmpty+0x3c>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isLineEmpty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i64 @isspace(i8 signext %8)
%11 = icmp eq i64 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ effetre_ric(int /*<<< orphan*/, int);
void effetre(int n) { effetre_ric(0, n); }


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

x86 assembly (clang, -O2):
<effetre>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <effetre_ric@plt>

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

LLVM IR (-O2):
define void @effetre(i32 %0) {
%2 = tail call i32 @effetre_ric(i32 0, i32 %0)
ret void
}
float ull2f(u)
unsigned long long int u;
{ return u; }


x86 assembly (clang, -O0):
<ull2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x10(%rbp)
test   %rax,%rax
movss  %xmm0,-0xc(%rbp)
js     1145 <ull2f+0x45>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ull2f>:
test   %rdi,%rdi
js     110b <ull2f+0xb>
cvtsi2ss %rdi,%xmm0
ret
mov    %rdi,%rax
shr    %rax
and    $0x1,%edi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @ull2f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @ull2f(i64 %0) {
%2 = uitofp i64 %0 to float
ret float %2
}
/* Variables and functions */
scalar_t__ do_run_memory_bench();
int /*<<< orphan*/ printf(char *, double);
double run_memory_bench() {
  double secs = 0;
  int i;
  for (i = 0; i < 100; i++) {
    secs += do_run_memory_bench();
  }
  printf("Time to run memory bench: %.2f[secs]\n", secs);
  return secs;
}


x86 assembly (clang, -O0):
<run_memory_bench>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1165 <run_memory_bench+0x45>
mov    $0x0,%al
call   1030 <do_run_memory_bench@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <run_memory_bench+0x17>
movsd  -0x8(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_memory_bench>:
push   %rbx
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
mov    $0x64,%ebx
nopl   (%rax)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <do_run_memory_bench@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0xffffffff,%ebx
jne    1130 <run_memory_bench+0x10>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Time to run memory bench: %.2f[secs]\0A\00"
define double @run_memory_bench() {
%1 = alloca double
%2 = alloca i32
store double 0.000000e+00, double* %1
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call i64 (...) @do_run_memory_bench()
%8 = sitofp i64 %7 to double
%9 = load double, double* %1
%10 = fadd double %9, %8
store double %10, double* %1
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = load double, double* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %15)
%17 = load double, double* %1
ret double %17
}

LLVM IR (-O2):
@.str = [38 x i8] c"Time to run memory bench: %.2f[secs]\0A\00"
define double @run_memory_bench() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = phi double [ 0.000000e+00, %0 ], [ %6, %1 ]
%4 = tail call i64 (...) @do_run_memory_bench()
%5 = sitofp i64 %4 to double
%6 = fadd double %3, %5
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 100
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %6)
ret double %6
}