xunge/DecIR huggingface dataset:
int scandir(char const *__restrict __dir,
            struct dirent ***__restrict __namelist,
            int (*__selector)(struct dirent const *),
            int (*__cmp)(struct dirent const **, struct dirent const **)) {
  { return (-1); }
}


x86 assembly (clang, -O0):
<scandir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.dirent = type opaque
define i32 @scandir(i8* noalias %0, %struct.dirent*** noalias %1, i32 (%struct.dirent*)* %2, i32 (%struct.dirent**, %struct.dirent**)* %3) {
%5 = alloca i8*
%6 = alloca %struct.dirent***
%7 = alloca i32 (%struct.dirent*)*
%8 = alloca i32 (%struct.dirent**, %struct.dirent**)*
store i8* %0, i8** %5
store %struct.dirent*** %1, %struct.dirent**** %6
store i32 (%struct.dirent*)* %2, i32 (%struct.dirent*)** %7
store i32 (%struct.dirent**, %struct.dirent**)* %3, i32 (%struct.dirent**, %struct.dirent**)** %8
ret i32 -1
}

LLVM IR (-O2):
%struct.dirent = type opaque
define i32 @scandir(i8* noalias nocapture readnone %0, %struct.dirent*** noalias nocapture readnone %1, i32 (%struct.dirent*)* nocapture readnone %2, i32 (%struct.dirent**, %struct.dirent**)* nocapture readnone %3) {
ret i32 -1
}
/* Variables and functions */
int soinitfunc(char const *, char const *);
int so_startupWithSSL(const char *pathtocertificate, const char *pathtokey) {
  return soinitfunc(pathtocertificate, pathtokey);
}


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

x86 assembly (clang, -O2):
<so_startupWithSSL>:
jmp    1030 <soinitfunc@plt>

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

LLVM IR (-O2):
define i32 @so_startupWithSSL(i8* %0, i8* %1) {
%3 = tail call i32 @soinitfunc(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int, int);
void version(char *name) { printf("%s version %d.%d.%d\n", name, 0, 1, 9); }


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

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x9,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 1, i32 9)
ret void
}
char ccnl_debugLevelToChar(int level) {
  if (level == 0)
    return 'F';
  if (level == 1)
    return 'E';
  if (level == 2)
    return 'W';
  if (level == 3)
    return 'I';
  if (level == 4)
    return 'D';
  if (level == 5)
    return 'V';
  if (level == 6)
    return 'T';
  return '?';
}


x86 assembly (clang, -O0):
<ccnl_debugLevelToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111a <ccnl_debugLevelToChar+0x1a>
movb   $0x46,-0x1(%rbp)
jmp    1190 <ccnl_debugLevelToChar+0x90>
cmpl   $0x1,-0x8(%rbp)
jne    112d <ccnl_debugLevelToChar+0x2d>
movb   $0x45,-0x1(%rbp)
jmp    1190 <ccnl_debugLevelToChar+0x90>
cmpl   $0x2,-0x8(%rbp)
jne    1140 <ccnl_debugLevelToChar+0x40>
movb   $0x57,-0x1(%rbp)
jmp    1190 <ccnl_debugLevelToChar+0x90>
cmpl   $0x3,-0x8(%rbp)
jne    1153 <ccnl_debugLevelToChar+0x53>
movb   $0x49,-0x1(%rbp)
jmp    1190 <ccnl_debugLevelToChar+0x90>
cmpl   $0x4,-0x8(%rbp)
jne    1166 <ccnl_debugLevelToChar+0x66>
movb   $0x44,-0x1(%rbp)
jmp    1190 <ccnl_debugLevelToChar+0x90>
cmpl   $0x5,-0x8(%rbp)
jne    1179 <ccnl_debugLevelToChar+0x79>
movb   $0x56,-0x1(%rbp)
jmp    1190 <ccnl_debugLevelToChar+0x90>
cmpl   $0x6,-0x8(%rbp)
jne    118c <ccnl_debugLevelToChar+0x8c>
movb   $0x54,-0x1(%rbp)
jmp    1190 <ccnl_debugLevelToChar+0x90>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnl_debugLevelToChar>:
lea    0x0(,%rdi,8),%ecx
movabs $0x54564449574546,%rdx
shr    %cl,%rdx
cmp    $0x7,%edi
mov    $0x3f,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @ccnl_debugLevelToChar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 70, i8* %2
br label %32
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 69, i8* %2
br label %32
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 87, i8* %2
br label %32
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 73, i8* %2
br label %32
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %19
store i8 68, i8* %2
br label %32
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %27
26: ; preds = %23
store i8 86, i8* %2
br label %32
27: ; preds = %23
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 6
br i1 %29, label %30, label %31
30: ; preds = %27
store i8 84, i8* %2
br label %32
31: ; preds = %27
store i8 63, i8* %2
br label %32
32: ; preds = %31, %30, %26, %22, %18, %14, %10, %6
%33 = load i8, i8* %2
ret i8 %33
}

LLVM IR (-O2):
define signext i8 @ccnl_debugLevelToChar(i32 %0) {
%2 = icmp ult i32 %0, 7
%3 = zext i32 %0 to i56
%4 = shl nuw nsw i56 %3, 3
%5 = lshr i56 23738749331916102, %4
%6 = trunc i56 %5 to i8
%7 = select i1 %2, i8 %6, i8 63
ret i8 %7
}
int compare(int a, int b, int c, int d) {
  int result = 0;
  if (a < c) {
    result = 1;
  } else if (a == c && b < d) {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    112f <compare+0x2f>
movl   $0x1,-0x14(%rbp)
jmp    1153 <compare+0x53>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    114e <compare+0x4e>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    114e <compare+0x4e>
movl   $0x1,-0x14(%rbp)
jmp    1153 <compare+0x53>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
cmp    %edx,%edi
setl   %al
sete   %dl
cmp    %ecx,%esi
setl   %cl
and    %dl,%cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, %2
%6 = icmp eq i32 %0, %2
%7 = icmp slt i32 %1, %3
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void fh_shr_cfg_cmd_usage(const char *program_name, const char *fh_name) {
  fprintf(
      stderr,
      "Usage: %s [OPTION]...\n"
      "Start the %s feed handler\n\n"
      " -h, -?            Print this usage message\n"
      " -d                Debugging mode (prints all log messages to console)\n"
      " -s                Standalone mode (do not attach to central FH "
      "manager)\n"
      " -p <process>      Process configuration to use\n"
      " -v                Display the version information\n"
      "\n",
      program_name, fh_name);
  exit(1);
}


x86 assembly (clang, -O0):
<fh_shr_cfg_cmd_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fh_shr_cfg_cmd_usage>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [338 x i8] c"Usage: %s [OPTION]...\0AStart the %s feed handler\0A\0A -h, -? Print this usage message\0A -d Debugging mode (prints all log messages to console)\0A -s Standalone mode (do not attach to central FH manager)\0A -p <process> Process configuration to use\0A -v Display the version information\0A\0A\00"
define void @fh_shr_cfg_cmd_usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([338 x i8], [338 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [338 x i8] c"Usage: %s [OPTION]...\0AStart the %s feed handler\0A\0A -h, -? Print this usage message\0A -d Debugging mode (prints all log messages to console)\0A -s Standalone mode (do not attach to central FH manager)\0A -p <process> Process configuration to use\0A -v Display the version information\0A\0A\00"
define void @fh_shr_cfg_cmd_usage(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([338 x i8], [338 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int d2uiz(double a) { return (unsigned int)a; }


x86 assembly (clang, -O0):
<d2uiz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2uiz>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @d2uiz(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptoui double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @d2uiz(double %0) {
%2 = fptoui double %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ jstp_tx_char(char);
int /*<<< orphan*/ jstp_tx_str(char *);
void jstp_tx_begin() {
  jstp_tx_char('{');
  jstp_tx_str("OK");
  jstp_tx_char(':');
}


x86 assembly (clang, -O0):
<jstp_tx_begin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1040 <jstp_tx_char@plt>
lea    0xecb(%rip),%rdi
call   1030 <jstp_tx_str@plt>
mov    $0x3a,%edi
call   1040 <jstp_tx_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jstp_tx_begin>:
push   %rax
mov    $0x7b,%edi
call   1040 <jstp_tx_char@plt>
lea    0xece(%rip),%rdi
call   1030 <jstp_tx_str@plt>
mov    $0x3a,%edi
pop    %rax
jmp    1040 <jstp_tx_char@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
define void @jstp_tx_begin() {
%1 = call i32 @jstp_tx_char(i8 signext 123)
%2 = call i32 @jstp_tx_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @jstp_tx_char(i8 signext 58)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define void @jstp_tx_begin() {
%1 = tail call i32 @jstp_tx_char(i8 signext 123)
%2 = tail call i32 @jstp_tx_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @jstp_tx_char(i8 signext 58)
ret void
}
char *strcat(s1, s2)
register char *s1, *s2;
{
  char *original = s1;
  while (*s1 != 0)
    s1++;
  while (*s1++ = *s2++)
    ;
  return (original);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1169 <strcat+0x69>
jmp    113a <strcat+0x3a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
float __nv_fsqrt_rz(float);
float __fsqrt_rz(float __a) { return __nv_fsqrt_rz(__a); }


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

x86 assembly (clang, -O2):
<__fsqrt_rz>:
jmp    1030 <__nv_fsqrt_rz@plt>

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

LLVM IR (-O2):
define float @__fsqrt_rz(float %0) {
%2 = tail call float @__nv_fsqrt_rz(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
void sample2() {
  char a[] = "abcd";
  printf("\n--- Permutations for %s: \n", a);
  permute(a, 0, 3);
}


x86 assembly (clang, -O0):
<sample2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <permute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample2>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0xecc(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <permute@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.sample2.a = [5 x i8] c"abcd\00"
@.str = [28 x i8] c"\0A--- Permutations for %s: \0A\00"
define void @sample2() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i32 @permute(i8* %5, i32 0, i32 3)
ret void
}

LLVM IR (-O2):
@__const.sample2.a = [5 x i8] c"abcd\00"
@.str = [28 x i8] c"\0A--- Permutations for %s: \0A\00"
define void @sample2() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @permute(i8* %2, i32 0, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf(".........................\n");
  printf("right justified: %8d\n", 123);
  printf(".........................\n");
  printf(" left justified: %-8d\n", 123);
  printf(".........................\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x7b,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x7b,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf05(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    $0x7b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
mov    $0x7b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c".........................\0A\00"
@.str.1 = [22 x i8] c"right justified: %8d\0A\00"
@.str.2 = [23 x i8] c" left justified: %-8d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 123)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 123)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"right justified: %8d\0A\00"
@.str.2 = [23 x i8] c" left justified: %-8d\0A\00"
@str.4 = [26 x i8] c".........................\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 123)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 123)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
void LedDriverDeinit(void) {}


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

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

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

LLVM IR (-O2):
define void @LedDriverDeinit() {
ret void
}
float q(int i, float r, int (*ff)(int), float (*f1f)(float)) {
  return ff(i) + f1f(r);
}


x86 assembly (clang, -O0):
<q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  -0x8(%rbp),%xmm0
call   *%rax
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movss  %xmm0,0xc(%rsp)
call   *%rsi
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
call   *%rbx
addss  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @q(i32 %0, float %1, i32 (i32)* %2, float (float)* %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca i32 (i32)*
%8 = alloca float (float)*
store i32 %0, i32* %5
store float %1, float* %6
store i32 (i32)* %2, i32 (i32)** %7
store float (float)* %3, float (float)** %8
%9 = load i32 (i32)*, i32 (i32)** %7
%10 = load i32, i32* %5
%11 = call i32 %9(i32 %10)
%12 = sitofp i32 %11 to float
%13 = load float (float)*, float (float)** %8
%14 = load float, float* %6
%15 = call float %13(float %14)
%16 = fadd float %12, %15
ret float %16
}

LLVM IR (-O2):
define float @q(i32 %0, float %1, i32 (i32)* nocapture %2, float (float)* nocapture %3) {
%5 = tail call i32 %2(i32 %0)
%6 = sitofp i32 %5 to float
%7 = tail call float %3(float %1)
%8 = fadd float %7, %6
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ gmx_velacc(int, char **);
int main(int argc, char *argv[]) {
  gmx_velacc(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_velacc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_velacc@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_velacc(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_velacc(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
double cos(double);
double cos_wrapper(double *arg_list) { return (cos(arg_list[0])); }


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

x86 assembly (clang, -O2):
<cos_wrapper>:
movsd  (%rdi),%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @cos_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @cos(double %5)
ret double %6
}

LLVM IR (-O2):
define double @cos_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @cos(double %2)
ret double %3
}
int msm_xo_print_voters(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_xo_print_voters() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
char socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int Create_Socket(void) {
  char socket_desc;
  if ((socket_desc = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
    printf("Could not create socket\n");
    exit(1);
  } else {
    return socket_desc;
  }
}


x86 assembly (clang, -O0):
<Create_Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
jne    1176 <Create_Socket+0x46>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Create_Socket>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
cmp    $0xff,%al
je     1153 <Create_Socket+0x23>
movsbl %al,%eax
pop    %rcx
ret
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [25 x i8] c"Could not create socket\0A\00"
define i32 @Create_Socket() {
%1 = alloca i8
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call signext i8 @socket(i32 %2, i32 %3, i32 0)
store i8 %4, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i8, i8* %1
%12 = sext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@str = [24 x i8] c"Could not create socket\00"
define i32 @Create_Socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call signext i8 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i8 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = sext i8 %3 to i32
ret i32 %9
}
double nextA(double a, double b) { return (a + b) / 2; }


x86 assembly (clang, -O0):
<nextA>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextA>:
addsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @nextA(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 = fadd double %5, %6
%8 = fdiv double %7, 2.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @nextA(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fmul double %3, 5.000000e-01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_srand_time();
void nlosrt_(void) { nlopt_srand_time(); }


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

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

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

LLVM IR (-O2):
define void @nlosrt_() {
%1 = tail call i32 (...) @nlopt_srand_time()
ret void
}
/* Type definitions */
struct dat {
  int dummy;
};

/* Variables and functions */
void *__match_dat(struct dat *, unsigned char *, unsigned long, int, int *,
                  int);
void *reverse_match_dat(struct dat *d, unsigned char *target,
                        unsigned long targetlen, int option, int *found) {
  return __match_dat(d, target, targetlen, option, found, 1);
}


x86 assembly (clang, -O0):
<reverse_match_dat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <__match_dat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_match_dat>:
mov    $0x1,%r9d
jmp    1030 <__match_dat@plt>

LLVM IR (-O0):
%struct.dat = type { i32 }
define i8* @reverse_match_dat(%struct.dat* %0, i8* %1, i64 %2, i32 %3, i32* %4) {
%6 = alloca %struct.dat*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32*
store %struct.dat* %0, %struct.dat** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load %struct.dat*, %struct.dat** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i8* @__match_dat(%struct.dat* %11, i8* %12, i64 %13, i32 %14, i32* %15, i32 1)
ret i8* %16
}

LLVM IR (-O2):
%struct.dat = type { i32 }
define i8* @reverse_match_dat(%struct.dat* %0, i8* %1, i64 %2, i32 %3, i32* %4) {
%6 = tail call i8* @__match_dat(%struct.dat* %0, i8* %1, i64 %2, i32 %3, i32* %4, i32 1)
ret i8* %6
}
int az_paragraph_num_lines(const char *paragraph) {
  int num_lines = 1;
  for (const char *ch = paragraph; *ch != '\0'; ++ch) {
    if (*ch == '\n')
      ++num_lines;
  }
  return num_lines;
}


x86 assembly (clang, -O0):
<az_paragraph_num_lines>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <az_paragraph_num_lines+0x56>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1140 <az_paragraph_num_lines+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <az_paragraph_num_lines+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <az_paragraph_num_lines+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_paragraph_num_lines>:
mov    $0x1,%eax
jmp    1117 <az_paragraph_num_lines+0x17>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xa,%cl
je     1110 <az_paragraph_num_lines+0x10>
test   %cl,%cl
jne    1113 <az_paragraph_num_lines+0x13>
ret

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

LLVM IR (-O2):
define i32 @az_paragraph_num_lines(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i32 [ 1, %1 ], [ %10, %9 ]
%4 = phi i8* [ %0, %1 ], [ %11, %9 ]
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %6
i8 10, label %7
]
6: ; preds = %2
ret i32 %3
7: ; preds = %2
%8 = add nsw i32 %3, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %3, %2 ]
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
}
void goo() {}


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

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

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

LLVM IR (-O2):
define void @goo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x08() {
  Assert_real((isalnum(8) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              45, ("isalnum should be 0 for 0x08"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x08>:
push   %rax
mov    $0x8,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x08\00"
define void @t_isalnum_0x08() {
%1 = call i64 @isalnum(i32 8)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x08\00"
define void @t_isalnum_0x08() {
%1 = tail call i64 @isalnum(i32 8)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void Initialize_Fast_IDCT(void) {
  signed int i;
  signed int j;
  double s;
}


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

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

LLVM IR (-O0):
define void @Initialize_Fast_IDCT() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
ret void
}

LLVM IR (-O2):
define void @Initialize_Fast_IDCT() {
ret void
}
/* Variables and functions */
char *fh_str_slice(char *, unsigned int, unsigned int);
int /*<<< orphan*/ free(char *);
char *slice_with_free(char *input, unsigned start, unsigned end) {
  char *tmp = input;
  input = fh_str_slice(input, start, end);
  free(tmp);
  return input;
}


x86 assembly (clang, -O0):
<slice_with_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <fh_str_slice@plt>
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slice_with_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <fh_str_slice@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @slice_with_free(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i8* @fh_str_slice(i8* %9, i32 %10, i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %7
%14 = call i32 @free(i8* %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @slice_with_free(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @fh_str_slice(i8* %0, i32 %1, i32 %2)
%5 = tail call i32 @free(i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t listxattr(const char *path, char *list, size_t size) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<listxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<listxattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @listxattr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @listxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clear_screen(void) { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @clear_screen() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @clear_screen() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void RasterStandbyModeConfig(unsigned int baseAddr, unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x54)))) &= 0xffffffcf;
  (*((volatile unsigned int *)(baseAddr + (0x54)))) |= flag;
}


x86 assembly (clang, -O0):
<RasterStandbyModeConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffcf,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterStandbyModeConfig>:
add    $0x54,%edi
andl   $0xffffffcf,(%rdi)
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @RasterStandbyModeConfig(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 = add i32 %5, 84
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -49
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add i32 %12, 84
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, %11
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @RasterStandbyModeConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 84
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -49
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = or i32 %8, %1
store volatile i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char p[16];
  p[-1] = 0;
  printf(p);
  return 0;
}


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)
movb   $0x0,-0x21(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,-0x1(%rsp)
mov    %rsp,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 -1
store i8 0, i8* %7
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 -1
store i8 0, i8* %5
%6 = call i32 @printf(i8* %4)
ret i32 0
}
int simple_rand(unsigned int *seed) {
  *seed = *seed * 1664525 + 1013904223;
  return ((unsigned)(*seed / 65536) % 32768);
}


x86 assembly (clang, -O0):
<simple_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x19660d,(%rax),%ecx
add    $0x3c6ef35f,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shr    $0x10,%eax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_rand>:
imul   $0x19660d,(%rdi),%eax
add    $0x3c6ef35f,%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
define i32 @simple_rand(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul i32 %4, 1664525
%6 = add i32 %5, 1013904223
%7 = load i32*, i32** %2
store i32 %6, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = udiv i32 %9, 65536
%11 = urem i32 %10, 32768
ret i32 %11
}

LLVM IR (-O2):
define i32 @simple_rand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1664525
%4 = add i32 %3, 1013904223
store i32 %4, i32* %0
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ TransformAlarmC__1__AlarmFrom__fired();
void Msp430AlarmC__1__Alarm__fired(void) {
  TransformAlarmC__1__AlarmFrom__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__1__Alarm__fired() {
%1 = tail call i32 (...) @TransformAlarmC__1__AlarmFrom__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_to_le16(unsigned short);
int /*<<< orphan*/ outw(int /*<<< orphan*/, unsigned int);
void nsp32_write2(unsigned int base, unsigned int index, unsigned short val) {
  outw(cpu_to_le16(val), (base + index));
}


x86 assembly (clang, -O0):
<nsp32_write2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
call   1040 <outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp32_write2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <cpu_to_le16@plt>
add    %ebp,%ebx
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outw@plt>

LLVM IR (-O0):
define void @nsp32_write2(i32 %0, i32 %1, i16 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
store i32 %0, i32* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i16, i16* %6
%8 = call i32 @cpu_to_le16(i16 zeroext %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add i32 %9, %10
%12 = call i32 @outw(i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
define void @nsp32_write2(i32 %0, i32 %1, i16 zeroext %2) {
%4 = tail call i32 @cpu_to_le16(i16 zeroext %2)
%5 = add i32 %1, %0
%6 = tail call i32 @outw(i32 %4, i32 %5)
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
scalar_t__ ns_format_ttl(int, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *p_time(u_int32_t value) {
  static char nbuf[40];
  if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0)
    sprintf(nbuf, "%u", value);
  return (nbuf);
}


x86 assembly (clang, -O0):
<p_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
mov    $0x28,%edx
call   1030 <ns_format_ttl@plt>
cmp    $0x0,%rax
jge    115f <p_time+0x3f>
mov    -0x4(%rbp),%edx
lea    0x2eed(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2eda(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_time>:
push   %rbx
mov    %edi,%ebx
lea    0x2f16(%rip),%rsi
mov    $0x28,%edx
call   1030 <ns_format_ttl@plt>
test   %rax,%rax
jns    114e <p_time+0x2e>
lea    0x2f00(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    %ebx,%edx
call   1040 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@p_time.nbuf = internal global [40 x i8] zeroinitializer
@.str = [3 x i8] c"%u\00"
define i8* @p_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ns_format_ttl(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @p_time.nbuf, i64 0, i64 0), i32 40)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @p_time.nbuf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @p_time.nbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@p_time.nbuf = internal global [40 x i8] zeroinitializer
@.str = [3 x i8] c"%u\00"
define i8* @p_time(i32 %0) {
%2 = tail call i64 @ns_format_ttl(i32 %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @p_time.nbuf, i64 0, i64 0), i32 40)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @p_time.nbuf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @p_time.nbuf, i64 0, i64 0)
}