xunge/DecIR huggingface dataset:
char *get_kernel() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @get_kernel() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  int y;
  scanf("%d", &x);
  y = x;
  assert(x == y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, int);
int main(void) {
  int sommaInteri = 0;
  int contatoreControlli = 0;
  for (contatoreControlli = 2; contatoreControlli <= (int)30;
       contatoreControlli += 2) {
    sommaInteri += contatoreControlli;
  }
  printf("La somma degli interi pari da %u a %u e' pari a: %d", (unsigned int)2,
         (unsigned int)30, (int)sommaInteri);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jg     1155 <main+0x45>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%ecx
lea    0xea1(%rip),%rdi
mov    $0x2,%esi
mov    $0x1e,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1e,%edx
mov    $0xf0,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"La somma degli interi pari da %u a %u e' pari a: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 2, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 30
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 2, i32 30, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"La somma degli interi pari da %u a %u e' pari a: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 2, i32 30, i32 240)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STFlash_sendByte(int);
int /*<<< orphan*/ STchip_deselect();
int /*<<< orphan*/ STchip_select();
void STFlash_WriteEnable(void) {
  STchip_select();
  STFlash_sendByte(0x06);
  STchip_deselect();
}


x86 assembly (clang, -O0):
<STFlash_WriteEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <STchip_select@plt>
mov    $0x6,%edi
call   1050 <STFlash_sendByte@plt>
mov    $0x0,%al
call   1040 <STchip_deselect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<STFlash_WriteEnable>:
push   %rax
xor    %eax,%eax
call   1030 <STchip_select@plt>
mov    $0x6,%edi
call   1050 <STFlash_sendByte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <STchip_deselect@plt>

LLVM IR (-O0):
define void @STFlash_WriteEnable() {
%1 = call i32 (...) @STchip_select()
%2 = call i32 @STFlash_sendByte(i32 6)
%3 = call i32 (...) @STchip_deselect()
ret void
}

LLVM IR (-O2):
define void @STFlash_WriteEnable() {
%1 = tail call i32 (...) @STchip_select()
%2 = tail call i32 @STFlash_sendByte(i32 6)
%3 = tail call i32 (...) @STchip_deselect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void c_mem_free(void *p) { free(p); }


x86 assembly (clang, -O0):
<c_mem_free>:
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):
<c_mem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @c_mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int sound_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sound_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float const);
int main(void) {
  int a = 1;
  const float b = 1.1;
  a = (int)b;
  printf("%d\n", a);
  printf("%f\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
movss  0xea6(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 1, i32* %2
store float 0x3FF19999A0000000, float* %3
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x3FF19999A0000000)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x3FF19999A0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ S_IFDIR;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int mkdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void dirs_mkdir(char *path) {
  if (!path) {
    fprintf(stderr, "Cannot have empty directory name.\n");
    return;
  }
  if (mkdir(path, S_IFDIR) == -1) {
    perror("mkdir");
  }
}


x86 assembly (clang, -O0):
<dirs_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1161 <dirs_mkdir+0x31>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1188 <dirs_mkdir+0x58>
mov    -0x8(%rbp),%rdi
mov    0x2e64(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    1188 <dirs_mkdir+0x58>
lea    0xea0(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirs_mkdir>:
push   %rax
test   %rdi,%rdi
je     114b <dirs_mkdir+0x1b>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
je     1161 <dirs_mkdir+0x31>
pop    %rax
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>
lea    0xebb(%rip),%rdi
pop    %rax
jmp    1050 <perror@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Cannot have empty directory name.\0A\00"
@S_IFDIR = global i32 0
@.str.1 = [6 x i8] c"mkdir\00"
define void @dirs_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i32, i32* @S_IFDIR
%11 = call i32 @mkdir(i8* %9, i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %5, %13, %8
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Cannot have empty directory name.\0A\00"
@S_IFDIR = global i32 0
@.str.1 = [6 x i8] c"mkdir\00"
define void @dirs_mkdir(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %1
%7 = load i32, i32* @S_IFDIR
%8 = tail call i32 @mkdir(i8* %0, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %3, %10, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlashPBInit(int, int, int);
int /*<<< orphan*/ ParamLoad();
int /*<<< orphan*/ ParamLoadDefault();
void ParamInit(void) {
  FlashPBInit((0x20000 - 0x800), 0x20000, 64);
  ParamLoadDefault();
  ParamLoad();
}


x86 assembly (clang, -O0):
<ParamInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f800,%edi
mov    $0x20000,%esi
mov    $0x40,%edx
call   1040 <FlashPBInit@plt>
mov    $0x0,%al
call   1030 <ParamLoadDefault@plt>
mov    $0x0,%al
call   1050 <ParamLoad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParamInit>:
push   %rax
mov    $0x1f800,%edi
mov    $0x20000,%esi
mov    $0x40,%edx
call   1040 <FlashPBInit@plt>
xor    %eax,%eax
call   1030 <ParamLoadDefault@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ParamLoad@plt>

LLVM IR (-O0):
define void @ParamInit() {
%1 = call i32 @FlashPBInit(i32 129024, i32 131072, i32 64)
%2 = call i32 (...) @ParamLoadDefault()
%3 = call i32 (...) @ParamLoad()
ret void
}

LLVM IR (-O2):
define void @ParamInit() {
%1 = tail call i32 @FlashPBInit(i32 129024, i32 131072, i32 64)
%2 = tail call i32 (...) @ParamLoadDefault()
%3 = tail call i32 (...) @ParamLoad()
ret void
}
/* Type definitions */
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ ns_ev_mgr_epoll_ctl(struct ns_connection *,
                                       int /*<<< orphan*/);
void ns_ev_mgr_add_conn(struct ns_connection *nc) {
  ns_ev_mgr_epoll_ctl(nc, EPOLL_CTL_ADD);
}


x86 assembly (clang, -O0):
<ns_ev_mgr_add_conn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <ns_ev_mgr_epoll_ctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_ev_mgr_add_conn>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ns_ev_mgr_epoll_ctl@plt>

LLVM IR (-O0):
%struct.ns_connection = type { i32 }
@EPOLL_CTL_ADD = global i32 0
define void @ns_ev_mgr_add_conn(%struct.ns_connection* %0) {
%2 = alloca %struct.ns_connection*
store %struct.ns_connection* %0, %struct.ns_connection** %2
%3 = load %struct.ns_connection*, %struct.ns_connection** %2
%4 = load i32, i32* @EPOLL_CTL_ADD
%5 = call i32 @ns_ev_mgr_epoll_ctl(%struct.ns_connection* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
@EPOLL_CTL_ADD = global i32 0
define void @ns_ev_mgr_add_conn(%struct.ns_connection* %0) {
%2 = load i32, i32* @EPOLL_CTL_ADD
%3 = tail call i32 @ns_ev_mgr_epoll_ctl(%struct.ns_connection* %0, i32 %2)
ret void
}
extern __attribute__((visibility("default"))) double
call_d(double (*func)(double), double arg) {
  return func(arg);
}


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

x86 assembly (clang, -O2):
<call_d>:
jmp    *%rdi

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

LLVM IR (-O2):
define double @call_d(double (double)* nocapture %0, double %1) {
%3 = tail call double %0(double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *normalize(char *);
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void serv_remove_buddy(char *name) {
  char buf[1024];
  snprintf(buf, sizeof(buf), "toc_remove_buddy %s", normalize(name));
  sflap_send(buf, -1, 2);
}


x86 assembly (clang, -O0):
<serv_remove_buddy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <normalize@plt>
mov    -0x418(%rbp),%rdi
mov    %rax,%rcx
mov    $0x400,%esi
lea    0xe94(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_remove_buddy>:
push   %rbx
sub    $0x400,%rsp
call   1040 <normalize@plt>
lea    0xebc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"toc_remove_buddy %s\00"
define void @serv_remove_buddy(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i8* @normalize(i8* %5)
%7 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @sflap_send(i8* %8, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"toc_remove_buddy %s\00"
define void @serv_remove_buddy(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @normalize(i8* %0)
%5 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @sflap_send(i8* %3, i32 -1, i32 2)
ret void
}
/* Variables and functions */
const void *extension_data(const char *uri) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @extension_data(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void Upper_chars(char *buffer) {
  unsigned int c;
  for (c = 0; c <= strlen(buffer) - 1; c++)
    *(buffer + c) = toupper(*(buffer + c));
}


x86 assembly (clang, -O0):
<Upper_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
ja     117c <Upper_chars+0x5c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <Upper_chars+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Upper_chars>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %ebp,%ebx
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cmp    %eax,%ebp
jbe    1130 <Upper_chars+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Upper_chars(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %9, %3 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add i32 %4, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = add nsw i32 %10, -1
%12 = icmp ugt i32 %9, %11
br i1 %12, label %13, label %3
13: ; preds = %3
ret void
}
char *TrimLeft(const char *S) {
  int i;
  i = 0;
  while (S[i] == ' ') {
    i++;
  }
  return (char *)(S + i);
}


x86 assembly (clang, -O0):
<TrimLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1132 <TrimLeft+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <TrimLeft+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrimLeft>:
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax,%rcx,1)
lea    0x1(%rcx),%rcx
je     1110 <TrimLeft+0x10>
mov    %ecx,%ecx
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @TrimLeft(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
ret i8* %10
}
/* Variables and functions */
int __dns_decodename(unsigned char const *, int, unsigned char *, int,
                     unsigned char const *);
int dn_expand(const unsigned char *msg, const unsigned char *eomorig,
              const unsigned char *comp_dn, unsigned char *exp_dn, int length) {
  return __dns_decodename(msg, comp_dn - msg, exp_dn, length, eomorig) -
         (comp_dn - msg);
}


x86 assembly (clang, -O0):
<dn_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%r8
call   1030 <__dns_decodename@plt>
cltq
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
sub    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dn_expand>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rax
sub    %edi,%ebx
mov    %ebx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %rax,%r8
call   1030 <__dns_decodename@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dn_expand(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %8
%13 = load i8*, i8** %6
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
%18 = load i8*, i8** %9
%19 = load i32, i32* %10
%20 = load i8*, i8** %7
%21 = call i32 @__dns_decodename(i8* %11, i32 %17, i8* %18, i32 %19, i8* %20)
%22 = sext i32 %21 to i64
%23 = load i8*, i8** %8
%24 = load i8*, i8** %6
%25 = ptrtoint i8* %23 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
%28 = sub nsw i64 %22, %27
%29 = trunc i64 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @dn_expand(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = ptrtoint i8* %2 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = tail call i32 @__dns_decodename(i8* %0, i32 %9, i8* %3, i32 %4, i8* %1)
%11 = sub i32 %10, %9
ret i32 %11
}
void test_max_with_posneg_numbers(void) {
  do {
    seatest_assert_int_equal(146719, ({
                               typeof(146719) _a = (146719);
                               typeof(-1951) _b = (-1951);
                               (_a > _b) ? _a : _b;
                             }),
                             __FUNCTION__, 52);
  } while (0);
}


x86 assembly (clang, -O0):
<test_max_with_posneg_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x23d1f,-0x4(%rbp)
movl   $0xfffff861,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <test_max_with_posneg_numbers+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <test_max_with_posneg_numbers+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x23d1f,%edi
lea    0xea8(%rip),%rdx
mov    $0x34,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_max_with_posneg_numbers>:
lea    0xee9(%rip),%rdx
mov    $0x23d1f,%edi
mov    $0x23d1f,%esi
mov    $0x34,%ecx
xor    %eax,%eax
jmp    1030 <seatest_assert_int_equal@plt>

LLVM IR (-O0):
@__FUNCTION__.test_max_with_posneg_numbers = [29 x i8] c"test_max_with_posneg_numbers\00"
define void @test_max_with_posneg_numbers() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
store i32 146719, i32* %1
store i32 -1951, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i32, i32* %1
br label %12
10: ; preds = %4
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 146719, i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_max_with_posneg_numbers, i64 0, i64 0), i32 52)
br label %16
16: ; preds = %12
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_max_with_posneg_numbers = [29 x i8] c"test_max_with_posneg_numbers\00"
define void @test_max_with_posneg_numbers() {
%1 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 146719, i32 146719, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_max_with_posneg_numbers, i64 0, i64 0), i32 52)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ pthread_join(int /*<<< orphan*/, void **);
int /*<<< orphan*/ stderr;
void sirius_pthread_join(pthread_t thread, void **retval) {
  if (pthread_join(thread, retval)) {
    fprintf(stderr, "pthread_join() failed.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<sirius_pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_join@plt>
cmp    $0x0,%rax
je     1174 <sirius_pthread_join+0x44>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sirius_pthread_join>:
push   %rax
call   1050 <pthread_join@plt>
test   %rax,%rax
jne    113d <sirius_pthread_join+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"pthread_join() failed.\0A\00"
define void @sirius_pthread_join(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i64 @pthread_join(i32 %5, i8** %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"pthread_join() failed.\0A\00"
define void @sirius_pthread_join(i32 %0, i8** %1) {
%3 = tail call i64 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
void s2e_disable_timer_interrupt() {
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x50, 0x01, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n");
}


x86 assembly (clang, -O0):
<s2e_disable_timer_interrupt>:
push   %rbp
mov    %rsp,%rbp
(bad)
add    %dl,0x1(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %bl,-0x3d(%rbp)

x86 assembly (clang, -O2):
<s2e_disable_timer_interrupt>:
(bad)
add    %dl,0x1(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,%bl

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

LLVM IR (-O2):
define void @s2e_disable_timer_interrupt() {
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x50, 0x01, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x4f() {
  Assert_real((isalpha(79)),
              "/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_isalpha.c",
              400, ("isalpha should be 1 for O"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x4f>:
push   %rax
mov    $0x4f,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x190,%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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for O\00"
define void @t_isalpha_0x4f() {
%1 = call i32 @isalpha(i32 79)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for O\00"
define void @t_isalpha_0x4f() {
%1 = tail call i32 @isalpha(i32 79)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long r_charhigh(unsigned long c) {
  return (((c) >= 'a' && (c) <= 'z') ? (c) + ('A' - 'a') : (c));
}


x86 assembly (clang, -O0):
<r_charhigh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x61,-0x8(%rbp)
jb     112f <r_charhigh+0x2f>
cmpq   $0x7a,-0x8(%rbp)
ja     112f <r_charhigh+0x2f>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffe0,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <r_charhigh+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_charhigh>:
lea    -0x61(%rdi),%rcx
lea    -0x20(%rdi),%rax
cmp    $0x1a,%rcx
cmovae %rdi,%rax
ret

LLVM IR (-O0):
define i64 @r_charhigh(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ule i64 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i64, i64* %2
%10 = add i64 %9, -32
br label %13
11: ; preds = %5, %1
%12 = load i64, i64* %2
br label %13
13: ; preds = %11, %8
%14 = phi i64 [ %10, %8 ], [ %12, %11 ]
ret i64 %14
}

LLVM IR (-O2):
define i64 @r_charhigh(i64 %0) {
%2 = add i64 %0, -97
%3 = icmp ult i64 %2, 26
%4 = add i64 %0, -32
%5 = select i1 %3, i64 %4, i64 %0
ret i64 %5
}
int ClampInt(int val, int min, int max) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<ClampInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <ClampInt+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <ClampInt+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <ClampInt+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <ClampInt+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClampInt>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ClampInt(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
int ROUN(statlink, a)
int *statlink;
register double a;
{ return (ENTIER(statlink, a + 0.5)); }


x86 assembly (clang, -O0):
<ROUN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xed3(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <ENTIER@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROUN>:
addsd  0xee8(%rip),%xmm0
mov    $0x1,%al
jmp    1030 <ENTIER@plt>

LLVM IR (-O0):
define i32 @ROUN(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load i32*, i32** %3
%6 = load double, double* %4
%7 = fadd double %6, 5.000000e-01
%8 = call i32 (i32*, double, ...) bitcast (i32 (...)* @ENTIER to i32 (i32*, double, ...)*)(i32* %5, double %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @ROUN(i32* %0, double %1) {
%3 = fadd double %1, 5.000000e-01
%4 = tail call i32 (i32*, double, ...) bitcast (i32 (...)* @ENTIER to i32 (i32*, double, ...)*)(i32* %0, double %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
double ext_dev_read_double(uint32_t addr, void *ctxt) { return 0.0; }


x86 assembly (clang, -O0):
<ext_dev_read_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_dev_read_double>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ext_dev_read_double(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @ext_dev_read_double(i32 %0, i8* nocapture readnone %1) {
ret double 0.000000e+00
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ die(int /*<<< orphan*/, char *);
void *emallocz(size_t size) {
  void *p;
  if (!(p = calloc(1, size)))
    die(0, "tabbed: cannot malloc");
  return p;
}


x86 assembly (clang, -O0):
<emallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1156 <emallocz+0x36>
xor    %edi,%edi
lea    0xeaf(%rip),%rsi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emallocz>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <emallocz+0x24>
lea    0xec3(%rip),%rsi
xor    %edi,%edi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"tabbed: cannot malloc\00"
define i8* @emallocz(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @die(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [22 x i8] c"tabbed: cannot malloc\00"
define i8* @emallocz(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int iks_strncmp(const char *a, const char *b, size_t n) {
  if (!a || !b)
    return -1;
  return strncmp(a, b, n);
}


x86 assembly (clang, -O0):
<iks_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <iks_strncmp+0x2a>
cmpq   $0x0,-0x18(%rbp)
jne    1146 <iks_strncmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <iks_strncmp+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iks_strncmp>:
test   %rdi,%rdi
je     111f <iks_strncmp+0xf>
test   %rsi,%rsi
je     111f <iks_strncmp+0xf>
jmp    1030 <strncmp@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @iks_strncmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr(int /*<<< orphan*/);
int /*<<< orphan*/ shr();
void shr_by_ptr(uint32_t x) {
  by_ptr(x);
  shr();
}


x86 assembly (clang, -O0):
<shr_by_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <by_ptr@plt>
mov    $0x0,%al
call   1030 <shr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @shr_by_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr(i32 %3)
%5 = call i32 (...) @shr()
ret void
}

LLVM IR (-O2):
define void @shr_by_ptr(i32 %0) {
%2 = tail call i32 @by_ptr(i32 %0)
%3 = tail call i32 (...) @shr()
ret void
}
void mbed_sdk_init() {
  char *debug_date = "Mar 17 2022";
  char *debug_time = "05:44:22";
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Mar 17 2022\00"
@.str.1 = [9 x i8] c"05:44:22\00"
define void @mbed_sdk_init() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
ret void
}

LLVM IR (-O2):
define void @mbed_sdk_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emsStune(char const *, int const, int *);
void emsTune(const char *key, const int value, int *status) {
  (void)emsStune(key, value, status);
}


x86 assembly (clang, -O0):
<emsTune>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <emsStune@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emsTune>:
jmp    1030 <emsStune@plt>

LLVM IR (-O0):
define void @emsTune(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @emsStune(i8* %7, i32 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @emsTune(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @emsStune(i8* %0, i32 %1, i32* %2)
ret void
}
int test_imm_57uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x57,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_57uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5701632
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
int write(int, char *, int);
void test_failure(char *fifo_name, int fd, pid_t odp_app) {
  int status;
  char result;
  int nb_char __attribute__((unused));
  result = 'F';
  nb_char = write(fd, &result, sizeof(char));
  close(fd);
  waitpid(odp_app, &status, 0);
  unlink(fifo_name);
  exit(1);
}


x86 assembly (clang, -O0):
<test_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movb   $0x46,-0x15(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x15(%rbp),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
mov    -0x10(%rbp),%edi
lea    -0x14(%rbp),%rsi
xor    %edx,%edx
call   1060 <waitpid@plt>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<test_failure>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
movb   $0x46,0xb(%rsp)
lea    0xb(%rsp),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
call   1040 <write@plt>
mov    %ebp,%edi
call   1050 <close@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1060 <waitpid@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define void @test_failure(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i8 70, i8* %8
%10 = load i32, i32* %5
%11 = call i32 @write(i32 %10, i8* %8, i32 1)
store i32 %11, i32* %9
%12 = load i32, i32* %5
%13 = call i32 @close(i32 %12)
%14 = load i32, i32* %6
%15 = call i32 @waitpid(i32 %14, i32* %7, i32 0)
%16 = load i8*, i8** %4
%17 = call i32 @unlink(i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @test_failure(i8* nocapture %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8
%6 = bitcast i32* %4 to i8*
store i8 70, i8* %5
%7 = call i32 @write(i32 %1, i8* %5, i32 1)
%8 = tail call i32 @close(i32 %1)
%9 = call i32 @waitpid(i32 %2, i32* %4, i32 0)
%10 = call i32 @unlink(i8* %0)
%11 = call i32 @exit(i32 1)
unreachable
}
int absdiff(int x, int y) {
  if (x < y)
    return y - x;
  else
    return x - y;
}


x86 assembly (clang, -O0):
<absdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <absdiff+0x24>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <absdiff+0x2d>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absdiff>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absdiff(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = sub nsw i32 %1, %0
%5 = sub nsw i32 %0, %1
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a = 1, X;
  scanf("%d", &X);
  while (a <= X) {
    printf("%d\n", a);
    a = a + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1163 <main+0x43>
mov    $0x1,%ebx
lea    0xebb(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
cmp    0x4(%rsp),%ebx
jle    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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