xunge/DecIR huggingface dataset:
/* Variables and functions */
char tolower(char);
void str_tolower(char *str) {
  char *c = str;
  while (*c) {
    *c = tolower(*c);
    c++;
  }
}


x86 assembly (clang, -O0):
<str_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <str_tolower+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <str_tolower+0x14>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @str_tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int main() {
  int a = 1;
  int b = 2;
  int c = 0;
  int d = 5;
  while (a) {
    a += b;
    a += d;
    b += c;
    c += 1;
    d += 9;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1163 <main+0x63>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <main+0x27>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ customFree(int *, char *, int);
void not_malloced_free() {
  int a = 100;
  customFree(&a,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/"
             "refs/heads/master/EnhancedMalloc/src/main.c",
             7);
  ;
}


x86 assembly (clang, -O0):
<not_malloced_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x7,%edx
call   1030 <customFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_malloced_free>:
push   %rax
movl   $0x64,0x4(%rsp)
lea    0xee0(%rip),%rsi
lea    0x4(%rsp),%rdi
mov    $0x7,%edx
call   1030 <customFree@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @not_malloced_free() {
%1 = alloca i32
store i32 100, i32* %1
%2 = call i32 @customFree(i32* %1, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/felixinfinite/Rutgers_CS_214_Fall_2015/refs/heads/master/EnhancedMalloc/src/main.c\00"
define void @not_malloced_free() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%3 = call i32 @customFree(i32* %1, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ DecryptionPrinceCore(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *);
int /*<<< orphan*/ Whitening(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void Decrypt(uint8_t *block, uint8_t *roundKeys) {
  Whitening(block, &roundKeys[8]);
  DecryptionPrinceCore(block, &roundKeys[16]);
  Whitening(block, roundKeys);
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   1030 <Whitening@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x40,%rsi
call   1040 <DecryptionPrinceCore@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Whitening@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x20,%rsi
call   1030 <Whitening@plt>
lea    0x40(%r14),%rsi
mov    %rbx,%rdi
call   1040 <DecryptionPrinceCore@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <Whitening@plt>

LLVM IR (-O0):
define void @Decrypt(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 = getelementptr inbounds i32, i32* %6, i64 8
%8 = call i32 @Whitening(i32* %5, i32* %7)
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 16
%12 = call i32 @DecryptionPrinceCore(i32* %9, i32* %11)
%13 = load i32*, i32** %3
%14 = load i32*, i32** %4
%15 = call i32 @Whitening(i32* %13, i32* %14)
ret void
}

LLVM IR (-O2):
define void @Decrypt(i32* %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 8
%4 = tail call i32 @Whitening(i32* %0, i32* %3)
%5 = getelementptr inbounds i32, i32* %1, i64 16
%6 = tail call i32 @DecryptionPrinceCore(i32* %0, i32* %5)
%7 = tail call i32 @Whitening(i32* %0, i32* %1)
ret void
}
long main() {
  long g;
  g = (-1 * (6 + 3) / (3 - 2)) + (2 + (2 / 0));
}


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

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = alloca i64
store i64 poison, i64* %2
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
int intlen(int num) {
  int i = 0;
  while (num) {
    num /= 10;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <intlen+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <intlen+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <intlen+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <intlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @intlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
void set_bit(int nr, void *addr) {
  unsigned long mask = 1 << (nr & 0x1f);
  unsigned long *p = ((unsigned long *)addr) + (nr >> 5);
  *p |= mask;
  return;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
sar    $0x5,%ecx
movslq %ecx,%rcx
or     %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = and i32 %7, 31
%9 = shl i32 1, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i64*
%13 = load i32, i32* %3
%14 = ashr i32 %13, 5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %12, i64 %15
store i64* %16, i64** %6
%17 = load i64, i64* %5
%18 = load i64*, i64** %6
%19 = load i64, i64* %18
%20 = or i64 %19, %17
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @set_bit(i32 %0, i8* nocapture %1) {
%3 = and i32 %0, 31
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = bitcast i8* %1 to i64*
%7 = ashr i32 %0, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %6, i64 %8
%10 = load i64, i64* %9
%11 = or i64 %10, %5
store i64 %11, i64* %9
ret void
}
/* Variables and functions */
int isxdigit(int c) {
  return (((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'f')) ||
          ((c >= 'A') && (c <= 'F')));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(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 i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int abs(int);
int hash(char *word) {
  int hashcode = 0;
  while (*word) {
    hashcode = (31 * hashcode + *word++) % 4093;
  }
  return abs(hashcode);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <hash+0x48>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    $0xffd,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
jmp    1123 <hash+0x13>
mov    -0xc(%rbp),%edi
call   1030 <abs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     114b <hash+0x4b>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
shl    $0x5,%edx
sub    %ecx,%edx
movsbl %al,%eax
add    %edx,%eax
movslq %eax,%rcx
imul   $0xffffffff80180481,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0xb,%eax
add    %edx,%eax
imul   $0xffd,%eax,%eax
sub    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
jmp    114d <hash+0x4d>
xor    %ecx,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul nsw i32 31, %9
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = add nsw i32 %10, %14
%16 = srem i32 %15, 4093
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
%19 = call i32 @abs(i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 31
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = srem i32 %11, 4093
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
%17 = tail call i32 @llvm.abs.i32(i32 %16, i1 true)
ret i32 %17
}
/* Variables and functions */
unsigned long davidegrayson_nibble_sort_counter_word(unsigned long);
void nibble_sort_grayson(unsigned long *buf) {
  for (int i = 0; i < 1024; i++) {
    buf[i] = davidegrayson_nibble_sort_counter_word(buf[i]);
  }
}


x86 assembly (clang, -O0):
<nibble_sort_grayson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    115e <nibble_sort_grayson+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <davidegrayson_nibble_sort_counter_word@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <nibble_sort_grayson+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_grayson>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <davidegrayson_nibble_sort_counter_word@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <nibble_sort_grayson+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @nibble_sort_grayson(i64* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = tail call i64 @davidegrayson_nibble_sort_counter_word(i64 %6)
store i64 %7, i64* %5
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 1024
br i1 %9, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ _test_MAX_biggerullong_smallerint(int /*<<< orphan*/, int);
int _test_various_MAX_biggerullong_smallerint() {
  _test_MAX_biggerullong_smallerint(0, -1);
  return 0;
}


x86 assembly (clang, -O0):
<_test_various_MAX_biggerullong_smallerint>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <_test_MAX_biggerullong_smallerint@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_various_MAX_biggerullong_smallerint>:
push   %rax
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <_test_MAX_biggerullong_smallerint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_test_various_MAX_biggerullong_smallerint() {
%1 = call i32 @_test_MAX_biggerullong_smallerint(i32 0, i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @_test_various_MAX_biggerullong_smallerint() {
%1 = tail call i32 @_test_MAX_biggerullong_smallerint(i32 0, i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ si475x_set_property(int, int);
void si475xAMRX_regional_cfg(void) {
  si475x_set_property(0x1102, 9);
  si475x_set_property(0x1100, 531);
  si475x_set_property(0x1101, 1629);
}


x86 assembly (clang, -O0):
<si475xAMRX_regional_cfg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1102,%edi
mov    $0x9,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1100,%edi
mov    $0x213,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1101,%edi
mov    $0x65d,%esi
call   1030 <si475x_set_property@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xAMRX_regional_cfg>:
push   %rax
mov    $0x1102,%edi
mov    $0x9,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1100,%edi
mov    $0x213,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1101,%edi
mov    $0x65d,%esi
pop    %rax
jmp    1030 <si475x_set_property@plt>

LLVM IR (-O0):
define void @si475xAMRX_regional_cfg() {
%1 = call i32 @si475x_set_property(i32 4354, i32 9)
%2 = call i32 @si475x_set_property(i32 4352, i32 531)
%3 = call i32 @si475x_set_property(i32 4353, i32 1629)
ret void
}

LLVM IR (-O2):
define void @si475xAMRX_regional_cfg() {
%1 = tail call i32 @si475x_set_property(i32 4354, i32 9)
%2 = tail call i32 @si475x_set_property(i32 4352, i32 531)
%3 = tail call i32 @si475x_set_property(i32 4353, i32 1629)
ret void
}
/* Type definitions */
struct sockaddr {
  scalar_t__ sa_family;
};

/* Variables and functions */
scalar_t__ AF_INET;
size_t INET6_ADDRSTRLEN;
size_t INET_ADDRSTRLEN;
size_t get_addr_strlen(const struct sockaddr *sa) {
  return sa->sa_family == AF_INET ? INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
}


x86 assembly (clang, -O0):
<get_addr_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eca(%rip),%rcx
cmp    (%rcx),%rax
jne    1132 <get_addr_strlen+0x32>
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1140 <get_addr_strlen+0x40>
mov    0x2eaf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_addr_strlen>:
mov    (%rdi),%rax
mov    0x2ed6(%rip),%rcx
cmp    (%rcx),%rax
jne    111a <get_addr_strlen+0x1a>
mov    0x2eba(%rip),%rax
mov    (%rax),%rax
ret
mov    0x2ec7(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
@INET_ADDRSTRLEN = global i64 0
@INET6_ADDRSTRLEN = global i64 0
define i64 @get_addr_strlen(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%3 = load %struct.sockaddr*, %struct.sockaddr** %2
%4 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @AF_INET
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i64, i64* @INET_ADDRSTRLEN
br label %12
10: ; preds = %1
%11 = load i64, i64* @INET6_ADDRSTRLEN
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
@INET_ADDRSTRLEN = global i64 0
@INET6_ADDRSTRLEN = global i64 0
define i64 @get_addr_strlen(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @AF_INET
%5 = icmp eq i64 %3, %4
%6 = load i64, i64* @INET_ADDRSTRLEN
%7 = load i64, i64* @INET6_ADDRSTRLEN
%8 = select i1 %5, i64 %6, i64 %7
ret i64 %8
}
/* Type definitions */
struct ip {
  int /*<<< orphan*/ ip_len;
};
struct ether_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ jlog(int, char *, int /*<<< orphan*/);
void inet_print_iphdr(void *data) {
  struct ip *iph;
  iph = data + sizeof(struct ether_header);
  jlog(0x08, "inet]> iphdr len: %i", iph->ip_len);
}


x86 assembly (clang, -O0):
<inet_print_iphdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    $0x8,%edi
lea    0xec6(%rip),%rsi
call   1030 <jlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_print_iphdr>:
mov    0x4(%rdi),%edx
lea    0xee6(%rip),%rsi
mov    $0x8,%edi
jmp    1030 <jlog@plt>

LLVM IR (-O0):
%struct.ip = type { i32 }
@.str = [21 x i8] c"inet]> iphdr len: %i\00"
define void @inet_print_iphdr(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.ip*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr i8, i8* %4, i64 4
%6 = bitcast i8* %5 to %struct.ip*
store %struct.ip* %6, %struct.ip** %3
%7 = load %struct.ip*, %struct.ip** %3
%8 = getelementptr inbounds %struct.ip, %struct.ip* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @jlog(i32 8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"inet]> iphdr len: %i\00"
define void @inet_print_iphdr(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @jlog(i32 8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_write_char(unsigned char const);
void uart_write_chars(const unsigned char *buffer, size_t size) {
  for (size_t i = 0; i < size; i++) {
    uart_write_char(buffer[i]);
  }
}


x86 assembly (clang, -O0):
<uart_write_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <uart_write_chars+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <uart_write_char@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <uart_write_chars+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_write_chars>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <uart_write_chars+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <uart_write_char@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <uart_write_chars+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @uart_write_chars(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @uart_write_char(i8 zeroext %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @uart_write_chars(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @uart_write_char(i8 zeroext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
void dummy_dec_jpeg200(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @dummy_dec_jpeg200() {
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ memset(int *, int, int);
int /*<<< orphan*/ sleep(int);
void *thread_main(void *arg) {
  int *ptr;
  ptr = malloc(1024);
  memset(ptr, 5, 1024);
  sleep(1);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_main>:
push   %rax
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x5,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thread_main(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @malloc(i32 1024)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @memset(i32* %5, i32 5, i32 1024)
%7 = call i32 @sleep(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_main(i8* nocapture readnone %0) {
%2 = tail call i32* @malloc(i32 1024)
%3 = tail call i32 @memset(i32* %2, i32 5, i32 1024)
%4 = tail call i32 @sleep(i32 1)
ret i8* null
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
bool M8_get_bit_seven(int16_t x) { return ((x >> 7) & 1) == 1; }


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

x86 assembly (clang, -O2):
<M8_get_bit_seven>:
mov    %edi,%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @M8_get_bit_seven(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
bool isHaswell() { return false; }


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

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

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

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

/* Type definitions */
struct TYPE_3__ {
  long quot;
  long rem;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
ldiv_t ldiv(long numerator, long denominator) {
  ldiv_t x;
  x.quot = numerator / denominator;
  x.rem = numerator - x.quot * denominator;
  return x;
}


x86 assembly (clang, -O0):
<ldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
imul   %rdx,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = load i64, i64* %5
%14 = mul nsw i64 %12, %13
%15 = sub nsw i64 %10, %14
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %15, i64* %16
%17 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%18 = load { i64, i64 }, { i64, i64 }* %17
ret { i64, i64 } %18
}

LLVM IR (-O2):
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = mul nsw i64 %3, %1
%5 = srem i64 %0, %1
%6 = insertvalue { i64, i64 } poison, i64 %3, 0
%7 = insertvalue { i64, i64 } %6, i64 %5, 1
ret { i64, i64 } %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int _mm_extract_epi8(int /*<<< orphan*/, int);
int test_mm_extract_epi8(__m128i x) { return _mm_extract_epi8(x, 1); }


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

x86 assembly (clang, -O2):
<test_mm_extract_epi8>:
mov    $0x1,%esi
jmp    1030 <_mm_extract_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_extract_epi8(i32 %0) {
%2 = tail call i32 @_mm_extract_epi8(i32 %0, i32 1)
ret i32 %2
}
void BGRAToYRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @BGRAToYRow_Any_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
void foo(void) {
  char buf[1024];
  printf("in foo\n");
  memset(buf, 0, sizeof(buf));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x408,%rsp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
add    $0x408,%rsp
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"in foo\00"
define void @foo() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = call i32 @memset(i8* %2, i32 0, i32 1024)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_ATTACH;
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int aggancia(pid_t pid) {
  int ret;
  ret = ptrace(PTRACE_ATTACH, pid, NULL, NULL);
  if (ret != -1) {
    wait(NULL);
  }
  return ret;
}


x86 assembly (clang, -O0):
<aggancia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1159 <aggancia+0x39>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aggancia>:
push   %rbx
mov    %edi,%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1143 <aggancia+0x23>
xor    %edi,%edi
call   1040 <wait@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@PTRACE_ATTACH = global i32 0
define i32 @aggancia(i32 %0) {
%2 = load i32, i32* @PTRACE_ATTACH
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32* null, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @wait(i32* null)
br label %7
7: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_readlink() {
  printf("NOT IMPLEMENTED:"
         "pa_readlink"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"NOT IMPLEMENTED:pa_readlink\00"
define i32 @pa_readlink() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
__attribute__((visibility("default"))) void emu_glReleaseShaderCompiler() {}


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

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

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

LLVM IR (-O2):
define void @emu_glReleaseShaderCompiler() {
ret void
}
int dns_v_api(void) { return 0x20160809; }


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

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

LLVM IR (-O0):
define i32 @dns_v_api() {
ret i32 538314761
}

LLVM IR (-O2):
define i32 @dns_v_api() {
ret i32 538314761
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x17() {
  Assert_real((iscntrl(23)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              120, ("iscntrl should be 1 for 0x17"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x17>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x78,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x17>:
push   %rax
mov    $0x17,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x78,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x17\00"
define void @t_iscntrl_0x17() {
%1 = call i32 @iscntrl(i32 23)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x17\00"
define void @t_iscntrl_0x17() {
%1 = tail call i32 @iscntrl(i32 23)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char tolower(char);
void strtolower(char *to_lower) {
  int i;
  for (i = 0; to_lower[i] != '\0'; i++)
    to_lower[i] = tolower(to_lower[i]);
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <strtolower+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strtolower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
float K_F(float n) {
  n = (n - 273.15) * 1.8;
  n += 32;
  return n;
}


x86 assembly (clang, -O0):
<K_F>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xec5(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<K_F>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
addss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @K_F(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 2.731500e+02
%6 = fmul double %5, 1.800000e+00
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load float, float* %2
%9 = fadd float %8, 3.200000e+01
store float %9, float* %2
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
define float @K_F(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -2.731500e+02
%4 = fmul double %3, 1.800000e+00
%5 = fptrunc double %4 to float
%6 = fadd float %5, 3.200000e+01
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ bin2hex();
int /*<<< orphan*/ hex2bin();
scalar_t__ strstr(char *, char *);
int main(int argc, char **argv) {
  if (argc >= 2 && strstr(argv[1], "-r"))
    bin2hex();
  else
    hex2bin();
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jl     117a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     117a <main+0x4a>
mov    $0x0,%al
call   1040 <bin2hex@plt>
jmp    1181 <main+0x51>
mov    $0x0,%al
call   1030 <hex2bin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1154 <main+0x24>
mov    0x8(%rsi),%rdi
lea    0xebf(%rip),%rsi
call   1050 <strstr@plt>
test   %rax,%rax
je     1154 <main+0x24>
xor    %eax,%eax
call   1040 <bin2hex@plt>
jmp    115b <main+0x2b>
xor    %eax,%eax
call   1030 <hex2bin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-r\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 = icmp sge i32 %6, 2
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strstr(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (...) @bin2hex()
br label %18
16: ; preds = %8, %2
%17 = call i32 (...) @hex2bin()
br label %18
18: ; preds = %16, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strstr(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @bin2hex()
br label %13
11: ; preds = %4, %2
%12 = tail call i32 (...) @hex2bin()
br label %13
13: ; preds = %11, %9
ret i32 0
}
unsigned int bcdtod(unsigned int bcd) {
  return ((bcd & 0xf0) >> 4) * 10 + (bcd & 0x0f);
}


x86 assembly (clang, -O0):
<bcdtod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
shr    $0x4,%eax
imul   $0xa,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcdtod>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @bcdtod(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 240
%5 = lshr i32 %4, 4
%6 = mul i32 %5, 10
%7 = load i32, i32* %2
%8 = and i32 %7, 15
%9 = add i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bcdtod(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = mul nuw nsw i32 %3, 10
%5 = and i32 %0, 15
%6 = add nuw nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int get_ticks();
int /*<<< orphan*/ milli_delay(int);
int /*<<< orphan*/ printf(char *, int);
void test_a() {
  int i = 0;
  while (1) {
    printf("<Ticks:%x> ", get_ticks());
    milli_delay(10000);
  }
}


x86 assembly (clang, -O0):
<test_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_ticks@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2710,%edi
call   1050 <milli_delay@plt>
jmp    113f <test_a+0xf>

x86 assembly (clang, -O2):
<test_a>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <get_ticks@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2710,%edi
call   1050 <milli_delay@plt>
jmp    1140 <test_a+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"<Ticks:%x> \00"
define void @test_a() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @get_ticks()
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @milli_delay(i32 10000)
br label %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"<Ticks:%x> \00"
define void @test_a() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @get_ticks()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @milli_delay(i32 10000)
br label %1
}