xunge/DecIR huggingface dataset:
char L4_KDB_ReadChar_Blocked(void) {
  char ret;
  __asm__ __volatile__("/* L4_KDB_"
                       "ReadChar_Blocked"
                       "() */		\n"
                       "	int	$3		\n"
                       "	cmpb	%1, %%al	\n"
                       : "=a"(ret)
                       : "i"(0x0d));
  return ret;
}


x86 assembly (clang, -O0):
<L4_KDB_ReadChar_Blocked>:
push   %rbp
mov    %rsp,%rbp
int3
cmp    $0xd,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<L4_KDB_ReadChar_Blocked>:
int3
cmp    $0xd,%al
ret

LLVM IR (-O0):
define signext i8 @L4_KDB_ReadChar_Blocked() {
%1 = alloca i8
%2 = call i8 asm sideeffect "/* L4_KDB_ReadChar_Blocked() */\09\09\0A\09int\09$$3\09\09\0A\09cmpb\09$1, %al\09\0A", "={ax},i,~{dirflag},~{fpsr},~{flags}"(i32 13)
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @L4_KDB_ReadChar_Blocked() {
%1 = tail call i8 asm sideeffect "/* L4_KDB_ReadChar_Blocked() */\09\09\0A\09int\09$$3\09\09\0A\09cmpb\09$1, %al\09\0A", "={ax},i,~{dirflag},~{fpsr},~{flags}"(i32 13)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo3() { printf("foo3 in inline2\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"foo3 in inline2\0A\00"
define void @foo3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"foo3 in inline2\00"
define void @foo3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int main(int argc, const char *argv[]) {
  int i;
  while (i < 10) {
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    112a <main+0x2a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int f1(volatile int *a) {
  int b = a[1];
  int c = a[0];
  int d = a[2];
  int e = a[3];
  return b + c + d + e;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
add    0x8(%rdi),%eax
add    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load volatile i32, i32* %8
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load volatile i32, i32* %11
store i32 %12, i32* %4
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load volatile i32, i32* %14
store i32 %15, i32* %5
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load volatile i32, i32* %17
store i32 %18, i32* %6
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @f1(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load volatile i32, i32* %2
%4 = load volatile i32, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load volatile i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load volatile i32, i32* %7
%9 = add nsw i32 %4, %3
%10 = add nsw i32 %9, %6
%11 = add nsw i32 %10, %8
ret i32 %11
}
void TimerCHConfigure(unsigned long ulBase, unsigned long ulChannel,
                      unsigned long ulCCx) {
  unsigned long ulTemp = 0;

  ;

  ;

  ;
  ulTemp = (0x00000001 << ((ulChannel - 1) * 4));
  (*((volatile unsigned long *)(ulBase + 0x00000020))) &= ~ulTemp;
  (*((volatile unsigned long *)(ulBase + 0x00000020))) |=
      ulCCx << ((ulChannel - 1) * 4);
}


x86 assembly (clang, -O0):
<TimerCHConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
shl    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x20(%rax)
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
shl    $0x2,%rcx
shl    %cl,%rdx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerCHConfigure>:
lea    0x0(,%rsi,4),%ecx
add    $0xfc,%cl
mov    $0xfffffffe,%eax
rol    %cl,%eax
cltq
and    %rax,0x20(%rdi)
shl    %cl,%rdx
or     %rdx,0x20(%rdi)
ret

LLVM IR (-O0):
define void @TimerCHConfigure(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 0, i64* %7
%8 = load i64, i64* %5
%9 = sub i64 %8, 1
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
%12 = shl i32 1, %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = xor i64 %14, -1
%16 = load i64, i64* %4
%17 = add i64 %16, 32
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = and i64 %19, %15
store volatile i64 %20, i64* %18
%21 = load i64, i64* %6
%22 = load i64, i64* %5
%23 = sub i64 %22, 1
%24 = mul i64 %23, 4
%25 = shl i64 %21, %24
%26 = load i64, i64* %4
%27 = add i64 %26, 32
%28 = inttoptr i64 %27 to i64*
%29 = load volatile i64, i64* %28
%30 = or i64 %29, %25
store volatile i64 %30, i64* %28
ret void
}

LLVM IR (-O2):
define void @TimerCHConfigure(i64 %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 2
%5 = add i64 %4, -4
%6 = trunc i64 %5 to i32
%7 = shl nuw i32 1, %6
%8 = xor i32 %7, -1
%9 = sext i32 %8 to i64
%10 = add i64 %0, 32
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, %9
store volatile i64 %13, i64* %11
%14 = shl i64 %2, %5
%15 = load volatile i64, i64* %11
%16 = or i64 %15, %14
store volatile i64 %16, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_write_msg_fini();
int /*<<< orphan*/ log_write_msg_init();
int logwrite_main(int, char **);
int main(int argc, char **argv) {
  int ret;
  log_write_msg_init();
  ret = logwrite_main(argc, argv);
  log_write_msg_fini();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <log_write_msg_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <logwrite_main@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <log_write_msg_fini@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <log_write_msg_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <logwrite_main@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <log_write_msg_fini@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @log_write_msg_init()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @logwrite_main(i32 %8, i8** %9)
store i32 %10, i32* %6
%11 = call i32 (...) @log_write_msg_fini()
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @log_write_msg_init()
%4 = tail call i32 @logwrite_main(i32 %0, i8** %1)
%5 = tail call i32 (...) @log_write_msg_fini()
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int lseek(int _fd, off_t offset, int whence) { return -1; }


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_76() {
  Assert_real((isqrt(76) == 8),
              "/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/stdlib/isqrt.c",
              385, ("Integer square root of 76 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_76>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x181,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_76>:
push   %rax
mov    $0x4c,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x181,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 76 should be 8\00"
define void @t_sqrt_76() {
%1 = call i32 @isqrt(i32 76)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 76 should be 8\00"
define void @t_sqrt_76() {
%1 = tail call i32 @isqrt(i32 76)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float foo(float X) { return __builtin_sqrtf(X); }


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

x86 assembly (clang, -O2):
<foo>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <foo+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @foo(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("progname 0|1|2|3 iterations");
  puts("0 - run bare FPU code");
  puts("1 - run simple approach (C implementation)");
  puts("2 - run simple approach (x86 implementation)");
  puts("3 - compare results (for debugging)");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
lea    0xf42(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"progname 0|1|2|3 iterations\00"
@.str.1 = [22 x i8] c"0 - run bare FPU code\00"
@.str.2 = [43 x i8] c"1 - run simple approach (C implementation)\00"
@.str.3 = [45 x i8] c"2 - run simple approach (x86 implementation)\00"
@.str.4 = [36 x i8] c"3 - compare results (for debugging)\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"progname 0|1|2|3 iterations\00"
@.str.1 = [22 x i8] c"0 - run bare FPU code\00"
@.str.2 = [43 x i8] c"1 - run simple approach (C implementation)\00"
@.str.3 = [45 x i8] c"2 - run simple approach (x86 implementation)\00"
@.str.4 = [36 x i8] c"3 - compare results (for debugging)\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
ret void
}
char ichar(char c) {
  if (c >= 'a' && c <= 'z')
    return (char)(c - 32);
  return c;
}


x86 assembly (clang, -O0):
<ichar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <ichar+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <ichar+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <ichar+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ichar>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @ichar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @ichar(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
int isObstext(char *request, int *cursor) {
  if ((request[(*cursor)] >= 0x80) && (request[(*cursor)] <= 0xFF)) {
    (*cursor)++;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isObstext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x80,%eax
jl     1157 <isObstext+0x57>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xff,%eax
jg     1157 <isObstext+0x57>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115e <isObstext+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isObstext(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double __drem(double, double);
double __remainder(double x, double y) { return (__drem(x, y)); }


x86 assembly (clang, -O0):
<__remainder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__drem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__remainder>:
jmp    1030 <__drem@plt>

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

LLVM IR (-O2):
define double @__remainder(double %0, double %1) {
%3 = tail call double @__drem(double %0, double %1)
ret double %3
}
int is_user_authenticated(const char *username, const char *hash) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_user_authenticated(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
size_t const buf_header_size();
__attribute__((always_, pure)) const size_t buf_size(void) {
  return 0x10000 - buf_header_size();
}


x86 assembly (clang, -O0):
<buf_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <buf_header_size@plt>
mov    %rax,%rcx
mov    $0x10000,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_size>:
push   %rax
xor    %eax,%eax
call   1030 <buf_header_size@plt>
mov    $0x10000,%ecx
sub    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @buf_size() {
%1 = call i64 (...) @buf_header_size()
%2 = sub i64 65536, %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @buf_size() {
%1 = tail call i64 (...) @buf_header_size()
%2 = sub i64 65536, %1
ret i64 %2
}
const char *get_file_from_header(void) {
  return "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/andreiw/tinycc/refs/heads/devel/tests/"
         "tcctest.h";
}


x86 assembly (clang, -O0):
<get_file_from_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_from_header>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andreiw/tinycc/refs/heads/devel/tests/tcctest.h\00"
define i8* @get_file_from_header() {
ret i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andreiw/tinycc/refs/heads/devel/tests/tcctest.h\00"
define i8* @get_file_from_header() {
ret i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int trypticdigest();
int main(int argc, char *argv[]) { return (trypticdigest()); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @trypticdigest()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @trypticdigest()
ret i32 %3
}
int integral(c) {
  switch (c) {
  case 'b':
    return -2;
  case 'd':
    return 10;
  case 'o':
    return -8;
  case 'u':
    return -10;
  case 'x':
    return -16;
  }
  return 0;
}


x86 assembly (clang, -O0):
<integral>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x16,%eax
ja     116c <integral+0x6c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xfffffffe,-0x4(%rbp)
jmp    1173 <integral+0x73>
movl   $0xa,-0x4(%rbp)
jmp    1173 <integral+0x73>
movl   $0xfffffff8,-0x4(%rbp)
jmp    1173 <integral+0x73>
movl   $0xfffffff6,-0x4(%rbp)
jmp    1173 <integral+0x73>
movl   $0xfffffff0,-0x4(%rbp)
jmp    1173 <integral+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<integral>:
add    $0xffffff9e,%edi
cmp    $0x16,%edi
ja     1123 <integral+0x23>
mov    $0xfffffffe,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0xa,%eax
ret
xor    %eax,%eax
ret
mov    $0xfffffff8,%eax
ret
mov    $0xfffffff6,%eax
ret
mov    $0xfffffff0,%eax
ret

LLVM IR (-O0):
define i32 @integral(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 98, label %5
i32 100, label %6
i32 111, label %7
i32 117, label %8
i32 120, label %9
]
5: ; preds = %1
store i32 -2, i32* %2
br label %11
6: ; preds = %1
store i32 10, i32* %2
br label %11
7: ; preds = %1
store i32 -8, i32* %2
br label %11
8: ; preds = %1
store i32 -10, i32* %2
br label %11
9: ; preds = %1
store i32 -16, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @integral(i32 %0) {
switch i32 %0, label %6 [
i32 98, label %7
i32 100, label %2
i32 111, label %3
i32 117, label %4
i32 120, label %5
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3, %2
%8 = phi i32 [ 0, %6 ], [ -16, %5 ], [ -10, %4 ], [ -8, %3 ], [ 10, %2 ], [ -2, %1 ]
ret i32 %8
}
/* Type definitions */
struct gdbserv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gdbserv_output_char(struct gdbserv *, int /*<<< orphan*/);
int /*<<< orphan*/ gdbserv_to_hex(int);
void gdbserv_output_byte(struct gdbserv *gdbserv, int h) {
  gdbserv_output_char(gdbserv, gdbserv_to_hex(h >> 4));
  gdbserv_output_char(gdbserv, gdbserv_to_hex(h >> 0));
}


x86 assembly (clang, -O0):
<gdbserv_output_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
sar    $0x4,%edi
call   1030 <gdbserv_to_hex@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <gdbserv_output_char@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sar    $0x0,%edi
call   1030 <gdbserv_to_hex@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <gdbserv_output_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbserv_output_byte>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
sar    $0x4,%edi
call   1030 <gdbserv_to_hex@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <gdbserv_output_char@plt>
mov    %ebx,%edi
call   1030 <gdbserv_to_hex@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <gdbserv_output_char@plt>

LLVM IR (-O0):
%struct.gdbserv = type { i32 }
define void @gdbserv_output_byte(%struct.gdbserv* %0, i32 %1) {
%3 = alloca %struct.gdbserv*
%4 = alloca i32
store %struct.gdbserv* %0, %struct.gdbserv** %3
store i32 %1, i32* %4
%5 = load %struct.gdbserv*, %struct.gdbserv** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 4
%8 = call i32 @gdbserv_to_hex(i32 %7)
%9 = call i32 @gdbserv_output_char(%struct.gdbserv* %5, i32 %8)
%10 = load %struct.gdbserv*, %struct.gdbserv** %3
%11 = load i32, i32* %4
%12 = ashr i32 %11, 0
%13 = call i32 @gdbserv_to_hex(i32 %12)
%14 = call i32 @gdbserv_output_char(%struct.gdbserv* %10, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.gdbserv = type { i32 }
define void @gdbserv_output_byte(%struct.gdbserv* %0, i32 %1) {
%3 = ashr i32 %1, 4
%4 = tail call i32 @gdbserv_to_hex(i32 %3)
%5 = tail call i32 @gdbserv_output_char(%struct.gdbserv* %0, i32 %4)
%6 = tail call i32 @gdbserv_to_hex(i32 %1)
%7 = tail call i32 @gdbserv_output_char(%struct.gdbserv* %0, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RETURN_IF_FALSE(int /*<<< orphan*/);
int /*<<< orphan*/ assert_exit(char *);
int /*<<< orphan*/ config_token_verbose_p();
int /*<<< orphan*/ log_print(char *, char *);
void tk_lang_c_idtr_print(char *buf) {
  assert_exit(buf);
  RETURN_IF_FALSE(config_token_verbose_p());
  log_print("[TK] try identifier on '%s'\n", buf);
}


x86 assembly (clang, -O0):
<tk_lang_c_idtr_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert_exit@plt>
mov    $0x0,%al
call   1060 <config_token_verbose_p@plt>
mov    %eax,%edi
call   1040 <RETURN_IF_FALSE@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <log_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tk_lang_c_idtr_print>:
push   %rbx
mov    %rdi,%rbx
call   1050 <assert_exit@plt>
xor    %eax,%eax
call   1060 <config_token_verbose_p@plt>
mov    %eax,%edi
call   1040 <RETURN_IF_FALSE@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <log_print@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"[TK] try identifier on '%s'\0A\00"
define void @tk_lang_c_idtr_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert_exit(i8* %3)
%5 = call i32 (...) @config_token_verbose_p()
%6 = call i32 @RETURN_IF_FALSE(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @log_print(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"[TK] try identifier on '%s'\0A\00"
define void @tk_lang_c_idtr_print(i8* %0) {
%2 = tail call i32 @assert_exit(i8* %0)
%3 = tail call i32 (...) @config_token_verbose_p()
%4 = tail call i32 @RETURN_IF_FALSE(i32 %3)
%5 = tail call i32 @log_print(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct htable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htable_pop(struct htable *, void *, void **, void **);
void *htable_pop_val(struct htable *ht, void *key) {
  void *old_key, *old_val;
  htable_pop(ht, key, &old_key, &old_val);
  return old_val;
}


x86 assembly (clang, -O0):
<htable_pop_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <htable_pop@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htable_pop_val>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <htable_pop@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.htable = type { i32 }
define i8* @htable_pop_val(%struct.htable* %0, i8* %1) {
%3 = alloca %struct.htable*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store %struct.htable* %0, %struct.htable** %3
store i8* %1, i8** %4
%7 = load %struct.htable*, %struct.htable** %3
%8 = load i8*, i8** %4
%9 = call i32 @htable_pop(%struct.htable* %7, i8* %8, i8** %5, i8** %6)
%10 = load i8*, i8** %6
ret i8* %10
}

LLVM IR (-O2):
%struct.htable = type { i32 }
define i8* @htable_pop_val(%struct.htable* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = call i32 @htable_pop(%struct.htable* %0, i8* %1, i8** %3, i8** %4)
%8 = load i8*, i8** %4
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ OSDPushMessage(int, int, char const *);
void DisplayMessage(const char *str) { OSDPushMessage(1, 120, str); }


x86 assembly (clang, -O0):
<DisplayMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
mov    $0x78,%esi
call   1030 <OSDPushMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayMessage>:
mov    %rdi,%rdx
mov    $0x1,%edi
mov    $0x78,%esi
jmp    1030 <OSDPushMessage@plt>

LLVM IR (-O0):
define void @DisplayMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @OSDPushMessage(i32 1, i32 120, i8* %3)
ret void
}

LLVM IR (-O2):
define void @DisplayMessage(i8* %0) {
%2 = tail call i32 @OSDPushMessage(i32 1, i32 120, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read(unsigned int, char *, int);
int fgetc(unsigned int channel) {
  char c;
  read(channel, &c, 1);
  return c;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fgetc(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ nrf_write(int, unsigned char const *, unsigned int);
void __attribute__((unused))
nrf_set_payload(const unsigned char *buf, unsigned int len) {
  nrf_write(0xA0, buf, len);
}


x86 assembly (clang, -O0):
<nrf_set_payload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0xa0,%edi
call   1030 <nrf_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_set_payload>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xa0,%edi
jmp    1030 <nrf_write@plt>

LLVM IR (-O0):
define void @nrf_set_payload(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 @nrf_write(i32 160, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @nrf_set_payload(i8* %0, i32 %1) {
%3 = tail call i32 @nrf_write(i32 160, i8* %0, i32 %1)
ret void
}
int test_imm_82uint8_reg(unsigned char val) {
  return ((val) & (-0x82 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_82uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff7e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_82uint8_reg>:
test   $0x7e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_82uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -130
%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_82uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 126
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 32; i <= 126; i++) {
    printf("%c [%d]\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jg     1150 <main+0x40>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x20,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%c [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 32, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 126
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%c [%d]\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 32, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 127
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void EVP_get_cipherbyname(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_get_cipherbyname() {
ret void
}
/* Variables and functions */
int SHD_main(int, char **);
int main(int argc, char *argv[]) { return (SHD_main(argc, argv)); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <SHD_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @SHD_main(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct BoolExpr {
  int dummy;
};

/* Variables and functions */
bool _eq(struct BoolExpr *key1, struct BoolExpr *key2) { return key1 == key2; }


x86 assembly (clang, -O0):
<_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eq>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.BoolExpr = type { i32 }
define i32 @_eq(%struct.BoolExpr* %0, %struct.BoolExpr* %1) {
%3 = alloca %struct.BoolExpr*
%4 = alloca %struct.BoolExpr*
store %struct.BoolExpr* %0, %struct.BoolExpr** %3
store %struct.BoolExpr* %1, %struct.BoolExpr** %4
%5 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%6 = load %struct.BoolExpr*, %struct.BoolExpr** %4
%7 = icmp eq %struct.BoolExpr* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.BoolExpr = type { i32 }
define i32 @_eq(%struct.BoolExpr* readnone %0, %struct.BoolExpr* readnone %1) {
%3 = icmp eq %struct.BoolExpr* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void termop_resetmode(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      432, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_resetmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1b0,%r8d
lea    0xf37(%rip),%r9
lea    0xf41(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_resetmode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf68(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1b0,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_resetmode = [17 x i8] c"termop_resetmode\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_resetmode(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 432, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.termop_resetmode, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_resetmode = [17 x i8] c"termop_resetmode\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_resetmode(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 432, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.termop_resetmode, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
void dl_G_SETCIMG() {}


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

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

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

LLVM IR (-O2):
define void @dl_G_SETCIMG() {
ret void
}
void tegra_auto_hotplug_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_auto_hotplug_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *stalloc(size_t);
size_t strlen(char const *);
char *stsavestr(const char *s) {
  char *p;
  size_t len;
  len = strlen(s);
  p = stalloc(len + 1);
  memcpy(p, s, len + 1);
  return p;
}


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

x86 assembly (clang, -O2):
<stsavestr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <stalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stsavestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i8* @stalloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i64 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @stsavestr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @stalloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
int toAscii(int c) { return (c & 0x7f); }


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

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

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

LLVM IR (-O2):
define i32 @toAscii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: captest [ --drop-all | --drop-caps | --id ] [ --lock ] [ "
         "--text ]\n");
}


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

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

LLVM IR (-O0):
@.str = [74 x i8] c"usage: captest [ --drop-all | --drop-caps | --id ] [ --lock ] [ --text ]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [73 x i8] c"usage: captest [ --drop-all | --drop-caps | --id ] [ --lock ] [ --text ]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p2();
int main(int argc, char *argv[]) {
  p2();
  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)
mov    $0x0,%al
call   1030 <p2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <p2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @p2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @p2()
ret i32 0
}
/* Variables and functions */
void init_map(char map[10][20]) {
  int i, j;
  char c;
  for (size_t i = 0; i < 10; i++) {
    for (size_t j = 0; j < 20; j++) {
      c = (map[i][j] = '#');
    }
  }
  return;
}


x86 assembly (clang, -O0):
<init_map>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0xa,-0x20(%rbp)
jae    116d <init_map+0x6d>
movq   $0x0,-0x28(%rbp)
cmpq   $0x14,-0x28(%rbp)
jae    1157 <init_map+0x57>
mov    -0x8(%rbp),%rax
imul   $0x14,-0x20(%rbp),%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
movb   $0x23,(%rax,%rcx,1)
movb   $0x23,-0x11(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1123 <init_map+0x23>
jmp    115c <init_map+0x5c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1110 <init_map+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_map>:
movabs $0x2323232323232323,%rax
23 23 23
mov    %rax,0xc0(%rdi)
movaps 0xee8(%rip),%xmm0
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @init_map([20 x i8]* %0) {
%2 = alloca [20 x i8]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i64
%7 = alloca i64
store [20 x i8]* %0, [20 x i8]** %2
store i64 0, i64* %6
br label %8
8: ; preds = %25, %1
%9 = load i64, i64* %6
%10 = icmp ult i64 %9, 10
br i1 %10, label %11, label %28
11: ; preds = %8
store i64 0, i64* %7
br label %12
12: ; preds = %21, %11
%13 = load i64, i64* %7
%14 = icmp ult i64 %13, 20
br i1 %14, label %15, label %24
15: ; preds = %12
%16 = load [20 x i8]*, [20 x i8]** %2
%17 = load i64, i64* %6
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %16, i64 %17
%19 = load i64, i64* %7
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %18, i64 0, i64 %19
store i8 35, i8* %20
store i8 35, i8* %5
br label %21
21: ; preds = %15
%22 = load i64, i64* %7
%23 = add i64 %22, 1
store i64 %23, i64* %7
br label %12
24: ; preds = %12
br label %25
25: ; preds = %24
%26 = load i64, i64* %6
%27 = add i64 %26, 1
store i64 %27, i64* %6
br label %8
28: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @init_map([20 x i8]* nocapture writeonly %0) {
%2 = getelementptr [20 x i8], [20 x i8]* %0, i64 0, i64 0
ret void
}