xunge/DecIR huggingface dataset:
/* Type definitions */
struct yyproto_unpacker {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct yyproto_unpacker *);
void yyproto_unpacker_free(struct yyproto_unpacker *unpacker) {
  free(unpacker);
}


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

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

LLVM IR (-O2):
%struct.yyproto_unpacker = type { i32 }
define void @yyproto_unpacker_free(%struct.yyproto_unpacker* nocapture %0) {
%2 = tail call i32 @free(%struct.yyproto_unpacker* %0)
ret void
}
/* Type definitions */
struct tgl_state {
  int dummy;
};
struct tgl_message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tglm_message_add_peer(struct tgl_state *,
                                         struct tgl_message *);
int /*<<< orphan*/ tglm_message_add_use(struct tgl_state *,
                                        struct tgl_message *);
void tglm_message_insert(struct tgl_state *TLS, struct tgl_message *M) {
  tglm_message_add_use(TLS, M);
  tglm_message_add_peer(TLS, M);
}


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

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

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
%struct.tgl_message = type { i32 }
define void @tglm_message_insert(%struct.tgl_state* %0, %struct.tgl_message* %1) {
%3 = alloca %struct.tgl_state*
%4 = alloca %struct.tgl_message*
store %struct.tgl_state* %0, %struct.tgl_state** %3
store %struct.tgl_message* %1, %struct.tgl_message** %4
%5 = load %struct.tgl_state*, %struct.tgl_state** %3
%6 = load %struct.tgl_message*, %struct.tgl_message** %4
%7 = call i32 @tglm_message_add_use(%struct.tgl_state* %5, %struct.tgl_message* %6)
%8 = load %struct.tgl_state*, %struct.tgl_state** %3
%9 = load %struct.tgl_message*, %struct.tgl_message** %4
%10 = call i32 @tglm_message_add_peer(%struct.tgl_state* %8, %struct.tgl_message* %9)
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
%struct.tgl_message = type { i32 }
define void @tglm_message_insert(%struct.tgl_state* %0, %struct.tgl_message* %1) {
%3 = tail call i32 @tglm_message_add_use(%struct.tgl_state* %0, %struct.tgl_message* %1)
%4 = tail call i32 @tglm_message_add_peer(%struct.tgl_state* %0, %struct.tgl_message* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa3(int, char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int n1 = 32;
  char s1[50];
  itoa3(n1, s1, 16);
  printf("%d, %s\n\n", n1, s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x10,%edx
call   1040 <itoa3@plt>
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    $0x20,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itoa3@plt>
lea    0xebf(%rip),%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d, %s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i8]
store i32 0, i32* %1
store i32 32, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%6 = call i32 @itoa3(i32 %4, i8* %5, i32 16)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d, %s\0A\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa3(i32 32, i8* %2, i32 16)
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 32, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dtx_substring(char const *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void dtx_string(const char *str) { dtx_substring(str, 0, strlen(str)); }


x86 assembly (clang, -O0):
<dtx_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1040 <dtx_substring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtx_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <dtx_substring@plt>

LLVM IR (-O0):
define void @dtx_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @dtx_substring(i8* %3, i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @dtx_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @dtx_substring(i8* %0, i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mission1(int, int);
int /*<<< orphan*/ moveDist(int, int);
void mission5() {
  moveDist(10, 15);
  mission1(-60, 600);
  mission1(10, 500);
}


x86 assembly (clang, -O0):
<mission5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0xf,%esi
call   1030 <moveDist@plt>
mov    $0xffffffc4,%edi
mov    $0x258,%esi
call   1040 <mission1@plt>
mov    $0xa,%edi
mov    $0x1f4,%esi
call   1040 <mission1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mission5>:
push   %rax
mov    $0xa,%edi
mov    $0xf,%esi
call   1030 <moveDist@plt>
mov    $0xffffffc4,%edi
mov    $0x258,%esi
call   1040 <mission1@plt>
mov    $0xa,%edi
mov    $0x1f4,%esi
pop    %rax
jmp    1040 <mission1@plt>

LLVM IR (-O0):
define void @mission5() {
%1 = call i32 @moveDist(i32 10, i32 15)
%2 = call i32 @mission1(i32 -60, i32 600)
%3 = call i32 @mission1(i32 10, i32 500)
ret void
}

LLVM IR (-O2):
define void @mission5() {
%1 = tail call i32 @moveDist(i32 10, i32 15)
%2 = tail call i32 @mission1(i32 -60, i32 600)
%3 = tail call i32 @mission1(i32 10, i32 500)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HandleInterrupt(int);
void INT_P3(void) { HandleInterrupt(3); }


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

x86 assembly (clang, -O2):
<INT_P3>:
mov    $0x3,%edi
jmp    1030 <HandleInterrupt@plt>

LLVM IR (-O0):
define void @INT_P3() {
%1 = call i32 @HandleInterrupt(i32 3)
ret void
}

LLVM IR (-O2):
define void @INT_P3() {
%1 = tail call i32 @HandleInterrupt(i32 3)
ret void
}
/* Variables and functions */
double garan2();
double GARandomFloat(double low, double high) {
  double val = high - low;
  val *= garan2();
  return val + low;
}


x86 assembly (clang, -O0):
<GARandomFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <garan2@plt>
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GARandomFloat>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <garan2@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @GARandomFloat(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
store double %8, double* %5
%9 = call double (...) @garan2()
%10 = load double, double* %5
%11 = fmul double %10, %9
store double %11, double* %5
%12 = load double, double* %5
%13 = load double, double* %3
%14 = fadd double %12, %13
ret double %14
}

LLVM IR (-O2):
define double @GARandomFloat(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @garan2()
%5 = fmul double %3, %4
%6 = fadd double %5, %0
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
void skip_line(FILE *infile) {
  int in_char;
  while (1) {
    in_char = fgetc(infile);
    if (in_char == EOF || in_char == 10)
      return;
  }
}


x86 assembly (clang, -O0):
<skip_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
je     1144 <skip_line+0x34>
cmpl   $0xa,-0xc(%rbp)
jne    114a <skip_line+0x3a>
add    $0x10,%rsp
pop    %rbp
ret
jmp    111c <skip_line+0xc>

x86 assembly (clang, -O2):
<skip_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1132 <skip_line+0x22>
cmp    (%r14),%eax
jne    1120 <skip_line+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_line(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %1, %14
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %10, %4
ret void
14: ; preds = %10
br label %4
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_line(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = icmp eq i32 %3, 10
%7 = or i1 %6, %5
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
char *peak_malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *peak_strdup(const char *s1) {
  size_t size;
  char *s2;
  size = (strlen(s1) + 1);
  s2 = peak_malloc(size);
  if (s2) {
    strcpy(s2, s1);
  }
  return (s2);
}


x86 assembly (clang, -O0):
<peak_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <peak_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <peak_strdup+0x43>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peak_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rdi
call   1050 <peak_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115a <peak_strdup+0x2a>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @peak_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @peak_malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help12(void) {
  printf("  mh                show memory halfword at PC\n");
  printf("  mh <addr>         show memory halfword at <addr>\n");
  printf("  mh <addr> <data>  set memory halfword at <addr> to <data>\n");
}


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

x86 assembly (clang, -O2):
<help12>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf32(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c" mh show memory halfword at PC\0A\00"
@.str.1 = [52 x i8] c" mh <addr> show memory halfword at <addr>\0A\00"
@.str.2 = [61 x i8] c" mh <addr> <data> set memory halfword at <addr> to <data>\0A\00"
define void @help12() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c" mh show memory halfword at PC\00"
@str.3 = [51 x i8] c" mh <addr> show memory halfword at <addr>\00"
@str.4 = [60 x i8] c" mh <addr> <data> set memory halfword at <addr> to <data>\00"
define void @help12() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long SSL_pthreads_thread_id(void) {
  unsigned long ret;
  ret = (unsigned long)pthread_self();
  return (ret);
}


x86 assembly (clang, -O0):
<SSL_pthreads_thread_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pthread_self@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @SSL_pthreads_thread_id() {
%1 = alloca i64
%2 = call i64 (...) @pthread_self()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @SSL_pthreads_thread_id() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
void do_tests(void) {}


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

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

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

LLVM IR (-O2):
define void @do_tests() {
ret void
}
int list_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @list_init() {
ret i32 0
}
void rpmv2_(dx, dy) float *dx, *dy;
{ rpmv2(*dx, *dy); }


x86 assembly (clang, -O0):
<rpmv2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rpmv2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmv2_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
jmp    1030 <rpmv2@plt>

LLVM IR (-O0):
define void @rpmv2_(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* %5
%7 = fpext float %6 to double
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (double, double, ...) bitcast (i32 (...)* @rpmv2 to i32 (double, double, ...)*)(double %7, double %10)
ret void
}

LLVM IR (-O2):
define void @rpmv2_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rpmv2 to i32 (double, double, ...)*)(double %4, double %6)
ret void
}
void PendSV_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @PendSV_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x40() {
  Assert_real((isalnum(64) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              325, ("isalnum should be 0 for @"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x40>:
push   %rax
mov    $0x40,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x145,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for @\00"
define void @t_isalnum_0x40() {
%1 = call i64 @isalnum(i32 64)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for @\00"
define void @t_isalnum_0x40() {
%1 = tail call i64 @isalnum(i32 64)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int r_strcmp(const char *s1, const char *s2) { return strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<r_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @r_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int compat_osname(char *buffer, size_t length) {
  strncpy(buffer, "libretro", length);
  buffer[length - 1] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<compat_osname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_osname>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"libretro\00"
define i32 @compat_osname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"libretro\00"
define i32 @compat_osname(i8* %0, i64 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %1)
%4 = add i64 %1, -1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret i32 0
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int /*<<< orphan*/ __libc_sendmsg(int, struct msghdr const *, int);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
ssize_t __attribute__((weak))
sendmsg(int fd, const struct msghdr *message, int flags) {
  ssize_t result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_sendmsg(fd, message, flags);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<sendmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__libc_sendmsg@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendmsg>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <__libc_sendmsg@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.msghdr = type { i32 }
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @sendmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%9 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* %8)
%11 = load i32, i32* %4
%12 = load %struct.msghdr*, %struct.msghdr** %5
%13 = load i32, i32* %6
%14 = call i32 @__libc_sendmsg(i32 %11, %struct.msghdr* %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @pthread_setcanceltype(i32 %15, i32* null)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @sendmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* %4)
%8 = call i32 @__libc_sendmsg(i32 %0, %struct.msghdr* %1, i32 %2)
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
ret i32 %8
}
/* Variables and functions */
scalar_t__ Pmember();
scalar_t__ PnameRef();
PinstanceNameRef() {
  int b = -1;
  ;
  b = PnameRef() || Pmember();
  return (b);
}


x86 assembly (clang, -O0):
<PinstanceNameRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1040 <PnameRef@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1159 <PinstanceNameRef+0x39>
mov    $0x0,%al
call   1030 <Pmember@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PinstanceNameRef>:
push   %rax
xor    %eax,%eax
call   1040 <PnameRef@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <PinstanceNameRef+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <Pmember@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PinstanceNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i64 (...) @PnameRef()
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @Pmember()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ true, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @PinstanceNameRef() {
%1 = tail call i64 (...) @PnameRef()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Pmember()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
int d_blt_rm1(double a1, double *a2) { return (__builtin_isless(a1, *a2)); }


x86 assembly (clang, -O0):
<d_blt_rm1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blt_rm1>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_blt_rm1(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = fcmp olt double %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_blt_rm1(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ogt double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_24(void *dest, void *src) {
  memcpy(dest, src, 24);
}


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

x86 assembly (clang, -O2):
<memcpy_24>:
mov    $0x18,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_24(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 24)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void switch_s1_right(const uint32_t repeat_count) { (void)repeat_count; }


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

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

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

LLVM IR (-O2):
define void @switch_s1_right(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, char *);
void version(FILE *fp, const char *argv0) {
  fprintf(fp, "%s (Firekylin) %s\n", argv0, "0.1");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
lea    0xedd(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
lea    0xef2(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s (Firekylin) %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @version(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 i32 @fprintf(i32* %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s (Firekylin) %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
define void @version(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void set_checksum(unsigned char *img, unsigned short sum) {
  img[0x3dfffc] = sum & 0xff;
  img[0x3dfffd] = (sum >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<set_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3dfffc(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3dfffd(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_checksum>:
mov    %si,0x3dfffc(%rdi)
ret

LLVM IR (-O0):
define void @set_checksum(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 4063228
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 4063229
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @set_checksum(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 4063228
store i8 %3, i8* %4
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 4063229
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
scalar_t__ log10(int /*<<< orphan*/);
int n_digits(int n) {
  return (n == 0 ? 1 : ((int)(log10(abs(n)) + 1) + (n < 0 ? 1 : 0)));
}


x86 assembly (clang, -O0):
<n_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1142 <n_digits+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <n_digits+0x4a>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
add    $0x1,%rax
mov    -0x4(%rbp),%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovl  %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_digits>:
test   %edi,%edi
je     112b <n_digits+0x1b>
push   %rbx
mov    %edi,%ebx
neg    %edi
cmovs  %ebx,%edi
call   1030 <log10@plt>
shr    $0x1f,%ebx
add    %ebx,%eax
add    $0x1,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @n_digits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @abs(i32 %7)
%9 = call i64 @log10(i32 %8)
%10 = add nsw i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
%16 = add nsw i32 %11, %15
br label %17
17: ; preds = %6, %5
%18 = phi i32 [ 1, %5 ], [ %16, %6 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @n_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = tail call i64 @log10(i32 %4)
%6 = trunc i64 %5 to i32
%7 = lshr i32 %0, 31
%8 = add nuw nsw i32 %7, 1
%9 = add i32 %8, %6
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ 1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void h264avcc_set_level(uint8_t *p, uint8_t val) { p[3] = val; }


x86 assembly (clang, -O0):
<h264avcc_set_level>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264avcc_set_level>:
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @h264avcc_set_level(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 = getelementptr inbounds i32, i32* %6, i64 3
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @h264avcc_set_level(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, char *);
int strlen(char const *);
char *strtok(char *, char *);
int trouveIdentite(const char *ligne, char *identite) {
  char finLigne[300];
  int position, longueurChaine;
  ;
  longueurChaine = strlen(ligne);
  sscanf(ligne, "To: %s", identite);
  identite = strtok(identite, "@");
}


x86 assembly (clang, -O0):
<trouveIdentite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x158(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <sscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trouveIdentite>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <sscanf@plt>
lea    0xeaf(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strtok@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"To: %s\00"
@.str.1 = [2 x i8] c"@\00"
define i32 @trouveIdentite(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [300 x i8]
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %8
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %5
%15 = call i8* @strtok(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %15, i8** %5
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"To: %s\00"
@.str.1 = [2 x i8] c"@\00"
define i32 @trouveIdentite(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i8* @strtok(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_xch_atRi(char *str, unsigned char i) {
  sprintf(str, "XCH   A, @R%X                    ", i);
}


x86 assembly (clang, -O0):
<sprint_xch_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_xch_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"XCH A, @R%X \00"
define void @sprint_xch_atRi(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"XCH A, @R%X \00"
define void @sprint_xch_atRi(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Variables and functions */
int f1(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", f1(0));
  printf("%d\n", f1(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <f1@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <f1@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <f1@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <f1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f1(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @f1(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_error(char *);
int /*<<< orphan*/ read_input(char *, int);
int /*<<< orphan*/ start_vet(char *, int);
int main(void) {
  char vet[10000];
  start_vet(vet, 10000);
  read_input(vet, 10000);
  check_error(vet);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
mov    $0x2710,%esi
call   1040 <start_vet@plt>
lea    -0x2720(%rbp),%rdi
mov    $0x2710,%esi
call   1050 <read_input@plt>
lea    -0x2720(%rbp),%rdi
call   1030 <check_error@plt>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x2710,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1040 <start_vet@plt>
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1050 <read_input@plt>
mov    %rbx,%rdi
call   1030 <check_error@plt>
xor    %eax,%eax
add    $0x2710,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = call i32 @start_vet(i8* %2, i32 10000)
%4 = call i32 @read_input(i8* %2, i32 10000)
%5 = call i32 @check_error(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int geopm_region_id_hint_is_equal(uint64_t hint_type, uint64_t rid) {
  return (rid & hint_type) ? 1 : 0;
}


x86 assembly (clang, -O0):
<geopm_region_id_hint_is_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<geopm_region_id_hint_is_equal>:
xor    %eax,%eax
test   %edi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @geopm_region_id_hint_is_equal(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 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @geopm_region_id_hint_is_equal(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TEST_atribute_values();
int /*<<< orphan*/ TEST_check_value_exist();
int /*<<< orphan*/ TEST_entropy();
int /*<<< orphan*/ TEST_information_gain();
int /*<<< orphan*/ TEST_position_values();
int /*<<< orphan*/ printf(char *);
int main(void) {
  TEST_check_value_exist();
  TEST_atribute_values();
  TEST_position_values();
  TEST_entropy();
  TEST_information_gain();
  printf("ok main_test\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <TEST_check_value_exist@plt>
mov    $0x0,%al
call   1070 <TEST_atribute_values@plt>
mov    $0x0,%al
call   1060 <TEST_position_values@plt>
mov    $0x0,%al
call   1050 <TEST_entropy@plt>
mov    $0x0,%al
call   1030 <TEST_information_gain@plt>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <TEST_check_value_exist@plt>
xor    %eax,%eax
call   1070 <TEST_atribute_values@plt>
xor    %eax,%eax
call   1060 <TEST_position_values@plt>
xor    %eax,%eax
call   1050 <TEST_entropy@plt>
xor    %eax,%eax
call   1040 <TEST_information_gain@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"ok main_test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @TEST_check_value_exist()
%3 = call i32 (...) @TEST_atribute_values()
%4 = call i32 (...) @TEST_position_values()
%5 = call i32 (...) @TEST_entropy()
%6 = call i32 (...) @TEST_information_gain()
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"ok main_test\00"
define i32 @main() {
%1 = tail call i32 (...) @TEST_check_value_exist()
%2 = tail call i32 (...) @TEST_atribute_values()
%3 = tail call i32 (...) @TEST_position_values()
%4 = tail call i32 (...) @TEST_entropy()
%5 = tail call i32 (...) @TEST_information_gain()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FlushAllCaches();
int /*<<< orphan*/ Reboot(int /*<<< orphan*/);
int /*<<< orphan*/ delay(int);
int main() {
  FlushAllCaches();
  delay(1000);
  Reboot(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <FlushAllCaches@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
xor    %edi,%edi
call   1050 <Reboot@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <FlushAllCaches@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
xor    %edi,%edi
call   1050 <Reboot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @FlushAllCaches()
%2 = call i32 @delay(i32 1000)
%3 = call i32 @Reboot(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @FlushAllCaches()
%2 = tail call i32 @delay(i32 1000)
%3 = tail call i32 @Reboot(i32 0)
ret i32 0
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
char *poolallocn(struct mempool *, scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *poolstring(struct mempool *mp, const char *str) {
  char *dest = poolallocn(mp, strlen(str) + 1);
  strcpy(dest, str);
  return dest;
}


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

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

LLVM IR (-O0):
%struct.mempool = type { i32 }
define i8* @poolstring(%struct.mempool* %0, i8* %1) {
%3 = alloca %struct.mempool*
%4 = alloca i8*
%5 = alloca i8*
store %struct.mempool* %0, %struct.mempool** %3
store i8* %1, i8** %4
%6 = load %struct.mempool*, %struct.mempool** %3
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @poolallocn(%struct.mempool* %6, i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @poolstring(%struct.mempool* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @poolallocn(%struct.mempool* %0, i64 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %5
}