xunge/DecIR huggingface dataset:
long sum(long n, long z) {
  long x, sum;
  sum = 0;
  for (x = n; x <= z; x++) {
    sum = sum + x;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1147 <sum+0x47>
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <sum+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    %rsi,%rcx
sub    %rdi,%rcx
jge    110e <sum+0xe>
xor    %edx,%edx
mov    %rdx,%rax
ret
lea    0x1(%rdi),%r8
imul   %rcx,%r8
add    %rdi,%r8
not    %rdi
add    %rsi,%rdi
mov    %rdi,%rax
mul    %rcx
shld   $0x3f,%rax,%rdx
add    %r8,%rdx
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @sum(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, %0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = sub i64 %1, %0
%6 = add i64 %0, 1
%7 = mul i64 %5, %6
%8 = xor i64 %0, -1
%9 = add i64 %8, %1
%10 = zext i64 %9 to i65
%11 = zext i64 %5 to i65
%12 = mul i65 %10, %11
%13 = lshr i65 %12, 1
%14 = trunc i65 %13 to i64
%15 = add i64 %7, %0
%16 = add i64 %15, %14
br label %17
17: ; preds = %4, %2
%18 = phi i64 [ 0, %2 ], [ %16, %4 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ A(int);
void B(void) { A(23); }


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <A@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
mov    $0x17,%edi
jmp    1030 <A@plt>

LLVM IR (-O0):
define void @B() {
%1 = call i32 @A(i32 23)
ret void
}

LLVM IR (-O2):
define void @B() {
%1 = tail call i32 @A(i32 23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_hello() { printf("%s", "Hello n9529977!\n"); }


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

x86 assembly (clang, -O2):
<print_hello>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [17 x i8] c"Hello n9529977!\0A\00"
define void @print_hello() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ds9_disconnect(void *p) {}


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

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

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

LLVM IR (-O2):
define void @ds9_disconnect(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void printusage(const char *exename) {
  fprintf(stderr,
          "Usage: %s [options] fd-file clib-file [[-o] output-file]\n"
          "Options:\n"
          "--quiet\t\t\tDon't display warnings\n"
          "--version\t\tPrint version number and exit\n\n",
          exename);
}


x86 assembly (clang, -O0):
<printusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printusage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [142 x i8] c"Usage: %s [options] fd-file clib-file [[-o] output-file]\0AOptions:\0A--quiet\09\09\09Don't display warnings\0A--version\09\09Print version number and exit\0A\0A\00"
define void @printusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [142 x i8] c"Usage: %s [options] fd-file clib-file [[-o] output-file]\0AOptions:\0A--quiet\09\09\09Don't display warnings\0A--version\09\09Print version number and exit\0A\0A\00"
define void @printusage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendLevel1DMAEnd(void) { SendInterrupt(0x4A, 0x6, 0x0400, 0x00000400); }


x86 assembly (clang, -O0):
<ScuSendLevel1DMAEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4a,%edi
mov    $0x6,%esi
mov    $0x400,%ecx
mov    %ecx,%edx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendLevel1DMAEnd>:
mov    $0x4a,%edi
mov    $0x6,%esi
mov    $0x400,%edx
mov    $0x400,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendLevel1DMAEnd() {
%1 = call i32 @SendInterrupt(i32 74, i32 6, i32 1024, i32 1024)
ret void
}

LLVM IR (-O2):
define void @ScuSendLevel1DMAEnd() {
%1 = tail call i32 @SendInterrupt(i32 74, i32 6, i32 1024, i32 1024)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _strcpy(char *, char *);
int _strlen(char *);
void _strcat(char *a, char *b) { _strcpy(a + _strlen(a), b); }


x86 assembly (clang, -O0):
<_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <_strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_strcpy@plt>

LLVM IR (-O0):
define void @_strcat(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** %3
%7 = call i32 @_strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @_strcpy(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @_strcat(i8* %0, i8* %1) {
%3 = tail call i32 @_strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @_strcpy(i8* %5, i8* %1)
ret void
}
short signum_fun_short(short a) { return (a != 0) | (a >> 15); }


x86 assembly (clang, -O0):
<signum_fun_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movswl -0x2(%rbp),%ecx
sar    $0xf,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_short>:
xor    %eax,%eax
test   %di,%di
setne  %al
sar    $0xf,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signum_fun_short(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = ashr i32 %8, 15
%10 = or i32 %6, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @signum_fun_short(i16 signext %0) {
%2 = icmp ne i16 %0, 0
%3 = zext i1 %2 to i16
%4 = ashr i16 %0, 15
%5 = or i16 %4, %3
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s [-n] [<directory>]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [30 x i8] c"Usage: %s [-n] [<directory>]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [30 x i8] c"Usage: %s [-n] [<directory>]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
XRecolorCursor() {}


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

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

LLVM IR (-O0):
define i32 @XRecolorCursor() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XRecolorCursor() {
ret i32 undef
}
double MAXf(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<MAXf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <MAXf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <MAXf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAXf>:
maxss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @MAXf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
%14 = fpext float %13 to double
ret double %14
}

LLVM IR (-O2):
define double @MAXf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
%5 = fpext float %4 to double
ret double %5
}
const char *aeron_loss_stat_usage() {
  return "    -h            Displays help information.\n"
         "    -d basePath   Base Path to shared memory. Default: "
         "/dev/shm/aeron-[user]\n"
         "    -t timeout    Number of milliseconds to wait to see if the "
         "driver metadata is available. Default: 1000\n";
}


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

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

LLVM IR (-O0):
@.str = [230 x i8] c" -h Displays help information.\0A -d basePath Base Path to shared memory. Default: /dev/shm/aeron-[user]\0A -t timeout Number of milliseconds to wait to see if the driver metadata is available. Default: 1000\0A\00"
define i8* @aeron_loss_stat_usage() {
ret i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [230 x i8] c" -h Displays help information.\0A -d basePath Base Path to shared memory. Default: /dev/shm/aeron-[user]\0A -t timeout Number of milliseconds to wait to see if the driver metadata is available. Default: 1000\0A\00"
define i8* @aeron_loss_stat_usage() {
ret i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct group {
  char *gr_name;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
struct group *getgrgid(int /*<<< orphan*/);
char *groupNameFromId(gid_t gid) {
  struct group *g;
  if ((g = getgrgid(gid)) == NULL) {
    return NULL;
  }
  return g->gr_name;
}


x86 assembly (clang, -O0):
<groupNameFromId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getgrgid@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    113e <groupNameFromId+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    1149 <groupNameFromId+0x39>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<groupNameFromId>:
push   %rax
call   1030 <getgrgid@plt>
test   %rax,%rax
je     1120 <groupNameFromId+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type { i8* }
define i8* @groupNameFromId(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.group*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call %struct.group* @getgrgid(i32 %5)
store %struct.group* %6, %struct.group** %4
%7 = icmp eq %struct.group* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %13
9: ; preds = %1
%10 = load %struct.group*, %struct.group** %4
%11 = getelementptr inbounds %struct.group, %struct.group* %10, i32 0, i32 0
%12 = load i8*, i8** %11
store i8* %12, i8** %2
br label %13
13: ; preds = %9, %8
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
%struct.group = type { i8* }
define i8* @groupNameFromId(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookreal16array_(void *x, unsigned int *n) {
  lookNarray((char *)x, (*n * 16));
}


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

x86 assembly (clang, -O2):
<lookreal16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookreal16array_(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 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookreal16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fsitod(int s, int d) {
  assem_debug("fsitod d%d,s%d\n", d, s);
  output_w32(0xeeb80bc0 | ((d & 7) << 12) | ((s & 14) >> 1) | ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_fsitod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xeeb80bc0,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fsitod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
and    $0x7,%ebx
shl    $0xc,%ebx
mov    %ebp,%eax
shr    %eax
and    $0x7,%eax
shl    $0x5,%ebp
movzbl %bpl,%edi
or     %eax,%edi
or     %ebx,%edi
or     $0xeeb80bc0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"fsitod d%d,s%d\0A\00"
define void @emit_fsitod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 7
%10 = shl i32 %9, 12
%11 = or i32 -289928256, %10
%12 = load i32, i32* %3
%13 = and i32 %12, 14
%14 = ashr i32 %13, 1
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 1
%18 = shl i32 %17, 5
%19 = or i32 %15, %18
%20 = call i32 @output_w32(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"fsitod d%d,s%d\0A\00"
define void @emit_fsitod(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 12
%5 = and i32 %4, 28672
%6 = lshr i32 %0, 1
%7 = and i32 %6, 7
%8 = shl i32 %0, 5
%9 = and i32 %8, 32
%10 = or i32 %7, %9
%11 = or i32 %10, %5
%12 = or i32 %11, -289928256
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430InterruptC__0__HplInterrupt__fired();
void HplMsp430InterruptP__Port14__fired(void) {
  Msp430InterruptC__0__HplInterrupt__fired();
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ofpbuf_init(struct ofpbuf *, size_t);
int /*<<< orphan*/ ofpbuf_uninit(struct ofpbuf *);
void ofpbuf_reinit(struct ofpbuf *b, size_t size) {
  ofpbuf_uninit(b);
  ofpbuf_init(b, size);
}


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

x86 assembly (clang, -O2):
<ofpbuf_reinit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <ofpbuf_uninit@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ofpbuf_init@plt>

LLVM IR (-O0):
%struct.ofpbuf = type { i32 }
define void @ofpbuf_reinit(%struct.ofpbuf* %0, i64 %1) {
%3 = alloca %struct.ofpbuf*
%4 = alloca i64
store %struct.ofpbuf* %0, %struct.ofpbuf** %3
store i64 %1, i64* %4
%5 = load %struct.ofpbuf*, %struct.ofpbuf** %3
%6 = call i32 @ofpbuf_uninit(%struct.ofpbuf* %5)
%7 = load %struct.ofpbuf*, %struct.ofpbuf** %3
%8 = load i64, i64* %4
%9 = call i32 @ofpbuf_init(%struct.ofpbuf* %7, i64 %8)
ret void
}

LLVM IR (-O2):
%struct.ofpbuf = type { i32 }
define void @ofpbuf_reinit(%struct.ofpbuf* %0, i64 %1) {
%3 = tail call i32 @ofpbuf_uninit(%struct.ofpbuf* %0)
%4 = tail call i32 @ofpbuf_init(%struct.ofpbuf* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void _badFile(int err_no) {
  fprintf(stderr, "Bad input file (err_no: %d)", err_no);
  exit(1);
}


x86 assembly (clang, -O0):
<_badFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_badFile>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Bad input file (err_no: %d)\00"
define void @_badFile(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Bad input file (err_no: %d)\00"
define void @_badFile(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void BusFault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<BusFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BusFault_Handler+0x9>
jmp    1109 <BusFault_Handler+0x9>

x86 assembly (clang, -O2):
<BusFault_Handler>:
jmp    1100 <BusFault_Handler>

LLVM IR (-O0):
define void @BusFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @BusFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int pid = 0;
  int i;
  pid = atoi(argv[2]);
  for (i = 0; i < 1000000; i++) {
  }
  printf("--Processor %d says hello!--\n", pid);
  return i;
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xf4240,-0x18(%rbp)
jge    1174 <main+0x54>
jmp    1166 <main+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1154 <main+0x34>
mov    -0x14(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x10(%rsi),%rdi
call   1040 <atoi@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xf4240,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"--Processor %d says hello!--\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
store i32 0, i32* %7
br label %12
12: ; preds = %16, %2
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 1000000
br i1 %14, label %15, label %19
15: ; preds = %12
br label %16
16: ; preds = %15
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %12
19: ; preds = %12
%20 = load i32, i32* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
@.str = [30 x i8] c"--Processor %d says hello!--\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 1000000
}
/* Variables and functions */
int /*<<< orphan*/ script_write_byte(int);
void script_arc(int speed, int radius) {
  script_write_byte(((speed & 0xFFFF) >> 8));
  script_write_byte((speed & 0xFF));
  script_write_byte(((radius & 0xFFFF) >> 8));
  script_write_byte((radius & 0xFF));
}


x86 assembly (clang, -O0):
<script_arc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <script_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_arc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
movzbl %bh,%edi
call   1030 <script_write_byte@plt>
movzbl %bl,%edi
call   1030 <script_write_byte@plt>
mov    %ebp,%ebx
movzbl %bh,%edi
call   1030 <script_write_byte@plt>
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <script_write_byte@plt>

LLVM IR (-O0):
define void @script_arc(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 = and i32 %5, 65535
%7 = ashr i32 %6, 8
%8 = call i32 @script_write_byte(i32 %7)
%9 = load i32, i32* %3
%10 = and i32 %9, 255
%11 = call i32 @script_write_byte(i32 %10)
%12 = load i32, i32* %4
%13 = and i32 %12, 65535
%14 = ashr i32 %13, 8
%15 = call i32 @script_write_byte(i32 %14)
%16 = load i32, i32* %4
%17 = and i32 %16, 255
%18 = call i32 @script_write_byte(i32 %17)
ret void
}

LLVM IR (-O2):
define void @script_arc(i32 %0, i32 %1) {
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = tail call i32 @script_write_byte(i32 %4)
%6 = and i32 %0, 255
%7 = tail call i32 @script_write_byte(i32 %6)
%8 = lshr i32 %1, 8
%9 = and i32 %8, 255
%10 = tail call i32 @script_write_byte(i32 %9)
%11 = and i32 %1, 255
%12 = tail call i32 @script_write_byte(i32 %11)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t rfc4175_get_line_number(const uint8_t *buf) {
  return ((buf[2] & 0x7f) << 8) | buf[3];
}


x86 assembly (clang, -O0):
<rfc4175_get_line_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x7f,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_get_line_number>:
mov    0x8(%rdi),%eax
and    $0x7f,%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rfc4175_get_line_number(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 127
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 3
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rfc4175_get_line_number(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 32512
%6 = getelementptr inbounds i32, i32* %0, i64 3
%7 = load i32, i32* %6
%8 = or i32 %5, %7
ret i32 %8
}
int cfs_cpt_table_print(struct cfs_cpt_table *cptab, char *buf, int len) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.cfs_cpt_table = type opaque
define i32 @cfs_cpt_table_print(%struct.cfs_cpt_table* %0, i8* %1, i32 %2) {
%4 = alloca %struct.cfs_cpt_table*
%5 = alloca i8*
%6 = alloca i32
store %struct.cfs_cpt_table* %0, %struct.cfs_cpt_table** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.cfs_cpt_table = type opaque
define i32 @cfs_cpt_table_print(%struct.cfs_cpt_table* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_shellcode(int /*<<< orphan*/);
int main() {
  test_shellcode(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_shellcode(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
float get_num(int a) {
  if (a == 1)
    printf("Ingrese el primer numero: ");
  else
    printf("Ingrese el segundo numero: ");
  float f;
  scanf("%f", &f);
  return f;
}


x86 assembly (clang, -O0):
<get_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1146 <get_num+0x26>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <get_num+0x32>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num>:
push   %rax
cmp    $0x1,%edi
lea    0xed5(%rip),%rax
lea    0xee9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Ingrese el primer numero: \00"
@.str.1 = [28 x i8] c"Ingrese el segundo numero: \00"
@.str.2 = [3 x i8] c"%f\00"
define float @get_num(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
@.str = [27 x i8] c"Ingrese el primer numero: \00"
@.str.1 = [28 x i8] c"Ingrese el segundo numero: \00"
@.str.2 = [3 x i8] c"%f\00"
define float @get_num(i32 %0) {
%2 = alloca float
%3 = icmp eq i32 %0, 1
%4 = select i1 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
%6 = bitcast float* %2 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%8 = load float, float* %2
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
void check_intInput(int *a) {
  if ((scanf("%d%*c", a)) != 1) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_intInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     116f <check_intInput+0x3f>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_intInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <check_intInput+0x17>
pop    %rax
ret
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d%*c\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @check_intInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d%*c\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @check_intInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
int func11() {
#pragma critTer : 42 :../../ test / resources / functionNumber.c:
  return 0;
#pragma critTer : 43 :../../ test / resources / functionNumber.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func11() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_2138() {
  Assert_real((isqrt(2138) == 46),
              "/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",
              1310, ("Integer square root of 2138 should be 46"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_2138>:
push   %rax
mov    $0x85a,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x2e,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x51e,%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 = [41 x i8] c"Integer square root of 2138 should be 46\00"
define void @t_sqrt_2138() {
%1 = call i32 @isqrt(i32 2138)
%2 = icmp eq i32 %1, 46
%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 1310, i8* getelementptr inbounds ([41 x i8], [41 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 = [41 x i8] c"Integer square root of 2138 should be 46\00"
define void @t_sqrt_2138() {
%1 = tail call i32 @isqrt(i32 2138)
%2 = icmp eq i32 %1, 46
%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 1310, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ connect_to_irc(int *, struct sockaddr_in *);
int /*<<< orphan*/ disconnect(int);
int /*<<< orphan*/ main_loop(int);
int main(void) {
  int socket;
  struct sockaddr_in socket_conf;
  connect_to_irc(&socket, &socket_conf);
  main_loop(socket);
  disconnect(socket);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <connect_to_irc@plt>
mov    -0x8(%rbp),%edi
call   1030 <main_loop@plt>
mov    -0x8(%rbp),%edi
call   1050 <disconnect@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <connect_to_irc@plt>
mov    0xc(%rsp),%edi
call   1030 <main_loop@plt>
mov    0xc(%rsp),%edi
call   1050 <disconnect@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
store i32 0, i32* %1
%4 = call i32 @connect_to_irc(i32* %2, %struct.sockaddr_in* %3)
%5 = load i32, i32* %2
%6 = call i32 @main_loop(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @disconnect(i32 %7)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sockaddr_in
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = call i32 @connect_to_irc(i32* %1, %struct.sockaddr_in* %2)
%6 = load i32, i32* %1
%7 = call i32 @main_loop(i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @disconnect(i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ heapify_node(int, int);
void heapify_array(int last) {
  int i;
  for (i = (last - 1) / 2; i >= 0; i--) {
    heapify_node(i, last);
  }
}


x86 assembly (clang, -O0):
<heapify_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114f <heapify_array+0x3f>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <heapify_node@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <heapify_array+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify_array>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     113e <heapify_array+0x2e>
mov    %edi,%ebx
lea    -0x1(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xffffffff,%ebp
sar    %ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <heapify_node@plt>
add    $0xffffffff,%ebp
jb     1130 <heapify_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @heapify_array(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = sdiv i32 %5, 2
store i32 %6, i32* %3
br label %7
7: ; preds = %14, %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = call i32 @heapify_node(i32 %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @heapify_array(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = sdiv i32 %4, 2
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %5, %3 ]
%8 = tail call i32 @heapify_node(i32 %7, i32 %0)
%9 = add nsw i32 %7, -1
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %1
ret void
}
void msg_print(msg) char msg[200];
{ printf("%s", msg); }


x86 assembly (clang, -O0):
<msg_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @msg_print(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct ZONE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ZONE *);
void zones_destroy(struct ZONE *zone) { free(zone); }


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

x86 assembly (clang, -O2):
<zones_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ZONE = type { i32 }
define void @zones_destroy(%struct.ZONE* nocapture %0) {
%2 = tail call i32 @free(%struct.ZONE* %0)
ret void
}
/* Variables and functions */
int RSA2048_load(int, char *, unsigned char *, int);
int RSA2048_load_prikey_qInv(int fd, unsigned char *RSA2048_qInv) {
  int ret;
  ret = RSA2048_load(fd, "BF51030480", RSA2048_qInv, 128);
  if (ret != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<RSA2048_load_prikey_qInv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
mov    $0x80,%ecx
call   1030 <RSA2048_load@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1150 <RSA2048_load_prikey_qInv+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1157 <RSA2048_load_prikey_qInv+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA2048_load_prikey_qInv>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
mov    $0x80,%ecx
call   1030 <RSA2048_load@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"BF51030480\00"
define i32 @RSA2048_load_prikey_qInv(i32 %0, i8* %1) {
%3 = tail call i32 @RSA2048_load(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i32 128)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double drand48();
double log(double);
double exponential(double average) {
  double d;
  d = drand48();
  if (d < 1.0E-8)
    d = 1.0E-8;
  return -log(d) * average;
}


x86 assembly (clang, -O0):
<exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <drand48@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xebf(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1159 <exponential+0x39>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <drand48@plt>
movsd  0xecb(%rip),%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
xorpd  0xec6(%rip),%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @exponential(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @drand48()
store double %4, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 1.000000e-08
br i1 %6, label %7, label %8
7: ; preds = %1
store double 1.000000e-08, double* %3
br label %8
8: ; preds = %7, %1
%9 = load double, double* %3
%10 = call double @log(double %9)
%11 = fneg double %10
%12 = load double, double* %2
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @exponential(double %0) {
%2 = tail call double (...) @drand48()
%3 = fcmp olt double %2, 1.000000e-08
%4 = select i1 %3, double 1.000000e-08, double %2
%5 = tail call double @log(double %4)
%6 = fneg double %5
%7 = fmul double %6, %0
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(char *);
void *pthread_proc(void *args) {
  int *pnum = (int *)args;
  printf("this is %d thread\n", *pnum);
  pthread_exit("thread exit...");
}


x86 assembly (clang, -O0):
<pthread_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_proc>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"this is %d thread\0A\00"
@.str.1 = [15 x i8] c"thread exit...\00"
define i8* @pthread_proc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @pthread_exit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"this is %d thread\0A\00"
@.str.1 = [15 x i8] c"thread exit...\00"
define noalias i8* @pthread_proc(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i8* undef
}