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

/* Variables and functions */
int /*<<< orphan*/ print_indent(struct traversal_algorithm *);
int /*<<< orphan*/ printf(char *, struct statement_list *);
void print_sl(struct statement_list *sl, struct traversal_algorithm *algo) {
  (void)(sl);
  print_indent(algo);
  printf("\x1B[35m"
         "<Statement List Item %p>\n"
         "\x1B[0m",
         sl);
}


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

x86 assembly (clang, -O2):
<print_sl>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <print_indent@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.statement_list = type { i32 }
%struct.traversal_algorithm = type { i32 }
@.str = [35 x i8] c"\1B[35m<Statement List Item %p>\0A\1B[0m\00"
define void @print_sl(%struct.statement_list* %0, %struct.traversal_algorithm* %1) {
%3 = alloca %struct.statement_list*
%4 = alloca %struct.traversal_algorithm*
store %struct.statement_list* %0, %struct.statement_list** %3
store %struct.traversal_algorithm* %1, %struct.traversal_algorithm** %4
%5 = load %struct.statement_list*, %struct.statement_list** %3
%6 = load %struct.traversal_algorithm*, %struct.traversal_algorithm** %4
%7 = call i32 @print_indent(%struct.traversal_algorithm* %6)
%8 = load %struct.statement_list*, %struct.statement_list** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), %struct.statement_list* %8)
ret void
}

LLVM IR (-O2):
%struct.statement_list = type { i32 }
%struct.traversal_algorithm = type { i32 }
@.str = [35 x i8] c"\1B[35m<Statement List Item %p>\0A\1B[0m\00"
define void @print_sl(%struct.statement_list* %0, %struct.traversal_algorithm* %1) {
%3 = tail call i32 @print_indent(%struct.traversal_algorithm* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), %struct.statement_list* %0)
ret void
}
/* Variables and functions */
double CheckInventory(char *);
int GetEliteBonusDamage() { return 0.02 * CheckInventory("MonsterLevel"); }


x86 assembly (clang, -O0):
<GetEliteBonusDamage>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
call   1030 <CheckInventory@plt>
movaps %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEliteBonusDamage>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <CheckInventory@plt>
mulsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"MonsterLevel\00"
define i32 @GetEliteBonusDamage() {
%1 = call double @CheckInventory(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = fmul double 2.000000e-02, %1
%3 = fptosi double %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"MonsterLevel\00"
define i32 @GetEliteBonusDamage() {
%1 = tail call double @CheckInventory(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = fmul double %1, 2.000000e-02
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Type definitions */
struct input_plugin_data {
  int dummy;
};

/* Variables and functions */
char *wav_codec_profile(struct input_plugin_data *ip_data) { return NULL; }


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

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

LLVM IR (-O0):
%struct.input_plugin_data = type { i32 }
define i8* @wav_codec_profile(%struct.input_plugin_data* %0) {
%2 = alloca %struct.input_plugin_data*
store %struct.input_plugin_data* %0, %struct.input_plugin_data** %2
ret i8* null
}

LLVM IR (-O2):
%struct.input_plugin_data = type { i32 }
define noalias i8* @wav_codec_profile(%struct.input_plugin_data* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_card_profile_by_name() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_card_profile_by_name"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_set_card_profile_by_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [53 x i8] c"NOT IMPLEMENTED:pa_context_set_card_profile_by_name\0A\00"
define i32 @pa_context_set_card_profile_by_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [52 x i8] c"NOT IMPLEMENTED:pa_context_set_card_profile_by_name\00"
define i32 @pa_context_set_card_profile_by_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t raw_get_length(void *id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raw_get_length(i8* nocapture readnone %0) {
ret i32 0
}
int HelpItem36(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem36() {
ret i32 0
}
/* Variables and functions */
int atof(char const *);
double soru_3(const char s1[], const char s2[]) {
  int sum = atof(s1) + atof(s2);
  return sum;
}


x86 assembly (clang, -O0):
<soru_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_3>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <atof@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <atof@plt>
add    %ebp,%eax
cvtsi2sd %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @soru_3(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @atof(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @atof(i8* %8)
%10 = add nsw i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @soru_3(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atof(i8* %0)
%4 = tail call i32 @atof(i8* %1)
%5 = add nsw i32 %4, %3
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
char *strchr(char const *, char const);
int getFirstIndexOfChar(const char *string, const char c) {
  const char *pointerToC = strchr(string, c);
  if (pointerToC) {
    return pointerToC - string;
  }
  return -1;
}


x86 assembly (clang, -O0):
<getFirstIndexOfChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1151 <getFirstIndexOfChar+0x41>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1158 <getFirstIndexOfChar+0x48>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFirstIndexOfChar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getFirstIndexOfChar(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos3f(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void RasterPos3f(GLfloat x, GLfloat y, GLfloat z) { glRasterPos3f(x, y, z); }


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

x86 assembly (clang, -O2):
<RasterPos3f>:
jmp    1030 <glRasterPos3f@plt>

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

LLVM IR (-O2):
define void @RasterPos3f(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glRasterPos3f(i32 %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int get_key(int /*<<< orphan*/ *, int, int, int, unsigned char *);
int get_RSA2048_dQ(FILE *fp, int *key_off, int *key_name_off,
                   unsigned char *RSA2048_dQ) {
  return get_key(fp, key_off[6] + 5, key_name_off[7], 128, RSA2048_dQ);
}


x86 assembly (clang, -O0):
<get_RSA2048_dQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%esi
add    $0x5,%esi
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%edx
mov    -0x20(%rbp),%r8
mov    $0x80,%ecx
call   1030 <get_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_RSA2048_dQ>:
mov    %rcx,%r8
mov    0x18(%rsi),%esi
add    $0x5,%esi
mov    0x1c(%rdx),%edx
mov    $0x80,%ecx
jmp    1030 <get_key@plt>

LLVM IR (-O0):
define i32 @get_RSA2048_dQ(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 6
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 5
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 7
%16 = load i32, i32* %15
%17 = load i8*, i8** %8
%18 = call i32 @get_key(i32* %9, i32 %13, i32 %16, i32 128, i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_RSA2048_dQ(i32* %0, i32* nocapture %1, i32* nocapture %2, i8* %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 6
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 5
%8 = getelementptr inbounds i32, i32* %2, i64 7
%9 = load i32, i32* %8
%10 = tail call i32 @get_key(i32* %0, i32 %7, i32 %9, i32 128, i8* %3)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
#define BIO_CTRL_SET 128
int /*<<< orphan*/ xcloselog(int /*<<< orphan*/ *);
int /*<<< orphan*/ xopenlog(int /*<<< orphan*/ *, void *, long);
long slg_ctrl(BIO *b, int cmd, long num, void *ptr) {
  switch (cmd) {
  case BIO_CTRL_SET:
    xcloselog(b);
    xopenlog(b, ptr, num);
    break;
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<slg_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    1169 <slg_ctrl+0x49>
jmp    114a <slg_ctrl+0x2a>
mov    -0x8(%rbp),%rdi
call   1040 <xcloselog@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <xopenlog@plt>
jmp    116e <slg_ctrl+0x4e>
jmp    116e <slg_ctrl+0x4e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slg_ctrl>:
cmp    $0x80,%esi
jne    114e <slg_ctrl+0x2e>
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%rbx
call   1040 <xcloselog@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <xopenlog@plt>
pop    %rbx
pop    %r14
pop    %r15
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @slg_ctrl(i32* %0, i32 %1, i64 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
switch i32 %9, label %17 [
i32 128, label %10
]
10: ; preds = %4
%11 = load i32*, i32** %5
%12 = call i32 @xcloselog(i32* %11)
%13 = load i32*, i32** %5
%14 = load i8*, i8** %8
%15 = load i64, i64* %7
%16 = call i32 @xopenlog(i32* %13, i8* %14, i64 %15)
br label %18
17: ; preds = %4
br label %18
18: ; preds = %17, %10
ret i64 0
}

LLVM IR (-O2):
define i64 @slg_ctrl(i32* %0, i32 %1, i64 %2, i8* %3) {
%5 = icmp eq i32 %1, 128
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32 @xcloselog(i32* %0)
%8 = tail call i32 @xopenlog(i32* %0, i8* %3, i64 %2)
br label %9
9: ; preds = %4, %6
ret i64 0
}
void gtk_text_buffer_get_iter_at_child_anchor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_iter_at_child_anchor() {
ret void
}
/* Variables and functions */
size_t freebsd_strnlen(const char *s, size_t maxlen) {
  size_t len;
  for (len = 0; len < maxlen; len++, s++) {
    if (!*s)
      break;
  }
  return (len);
}


x86 assembly (clang, -O0):
<freebsd_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1156 <freebsd_strnlen+0x56>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1134 <freebsd_strnlen+0x34>
jmp    1156 <freebsd_strnlen+0x56>
jmp    1139 <freebsd_strnlen+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <freebsd_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freebsd_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <freebsd_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <freebsd_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <freebsd_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @freebsd_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = phi i8* [ %11, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i64 %10, %1
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %2
%14 = phi i64 [ 0, %2 ], [ %5, %4 ], [ %1, %9 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ expecti(int, int);
int call2(int a, ...) { expecti(a, 1); }


x86 assembly (clang, -O0):
<call2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <expecti@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call2>:
mov    $0x1,%esi
jmp    1030 <expecti@plt>

LLVM IR (-O0):
define i32 @call2(i32 %0, ...) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @expecti(i32 %4, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @call2(i32 %0, ...) {
%2 = tail call i32 @expecti(i32 %0, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ lseek(int, int, int /*<<< orphan*/);
int read(int, char *, int);
int read_data(int fd, char *buff, int len) {
  if (lseek(fd, 0xb000, SEEK_SET) < 0)
    return -1;
  return read(fd, buff, len);
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    $0xb000,%esi
call   1030 <lseek@plt>
cmp    $0x0,%rax
jge    115e <read_data+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <read_data+0x50>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    $0xb000,%esi
call   1030 <lseek@plt>
test   %rax,%rax
js     1155 <read_data+0x35>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <read@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @read_data(i32 %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @lseek(i32 %0, i32 45056, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}
int chDir(path)
char *path;
{ return (chdir(path)); }


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

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

LLVM IR (-O0):
define i32 @chDir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @chDir(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("\n"
       "****************************************************************\n"
       "  This example program was compiled without libsndfile \n"
       "  (http://www.mega-nerd.com/libsndfile/).\n"
       "  It is therefore completely broken and non-functional.\n"
       "****************************************************************\n"
       "\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [287 x i8] c"\0A****************************************************************\0A This example program was compiled without libsndfile \0A (http://www.mega-nerd.com/libsndfile/).\0A It is therefore completely broken and non-functional.\0A****************************************************************\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [287 x i8] c"\0A****************************************************************\0A This example program was compiled without libsndfile \0A (http://www.mega-nerd.com/libsndfile/).\0A It is therefore completely broken and non-functional.\0A****************************************************************\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([287 x i8], [287 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hide(struct graph *, int);
void hide3(struct graph *g, int a, int b, int c) {
  hide(g, a);
  hide(g, b);
  hide(g, c);
}


x86 assembly (clang, -O0):
<hide3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <hide@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <hide@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <hide@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide3>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <hide@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <hide@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <hide@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define void @hide3(%struct.graph* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.graph*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.graph* %0, %struct.graph** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.graph*, %struct.graph** %5
%10 = load i32, i32* %6
%11 = call i32 @hide(%struct.graph* %9, i32 %10)
%12 = load %struct.graph*, %struct.graph** %5
%13 = load i32, i32* %7
%14 = call i32 @hide(%struct.graph* %12, i32 %13)
%15 = load %struct.graph*, %struct.graph** %5
%16 = load i32, i32* %8
%17 = call i32 @hide(%struct.graph* %15, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @hide3(%struct.graph* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @hide(%struct.graph* %0, i32 %1)
%6 = tail call i32 @hide(%struct.graph* %0, i32 %2)
%7 = tail call i32 @hide(%struct.graph* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kernel_call_7_a11_deinit();
void kernel_call_deinit() { kernel_call_7_a11_deinit(); }


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

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

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

LLVM IR (-O2):
define void @kernel_call_deinit() {
%1 = tail call i32 (...) @kernel_call_7_a11_deinit()
ret void
}
void termop_savecurattr(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      328, __func__, "unhandled");
  ansiseq_dump(s);
}


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

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

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

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_savecurattr = [19 x i8] c"termop_savecurattr\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_savecurattr(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 328, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.termop_savecurattr, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
void SysCtlPowerOffPLL(void) {
  unsigned long ulMWRAllow;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  (*((volatile unsigned long *)(0x400FB800))) &= ~(0x00000001 | 0x00000002);
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}


x86 assembly (clang, -O0):
<SysCtlPowerOffPLL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    $0x400fb800,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffc,%rcx
mov    $0x400fb800,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPowerOffPLL>:
mov    0x400fb980,%rax
40
mov    $0xa5a5a5a5,%ecx
mov    %rcx,0x400fb980
40
andq   $0xfffffffffffffffc,0x400fb800
40 fc
mov    %rax,0x400fb980
40
ret

LLVM IR (-O0):
define void @SysCtlPowerOffPLL() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %2, i64* %1
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1074771968 to i64*)
%4 = and i64 %3, -4
store volatile i64 %4, i64* inttoptr (i64 1074771968 to i64*)
%5 = load i64, i64* %1
store volatile i64 %5, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlPowerOffPLL() {
%1 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 1074771968 to i64*)
%3 = and i64 %2, -4
store volatile i64 %3, i64* inttoptr (i64 1074771968 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074772352 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int printType(void *data, void *user_data) {
  int i = *(int *)data;
  printf("FUNCTION:%d\n", i);
  return 1;
}


x86 assembly (clang, -O0):
<printType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printType>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"FUNCTION:%d\0A\00"
define i32 @printType(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"FUNCTION:%d\0A\00"
define i32 @printType(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}
void MARK_TIMER(void) {}


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

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

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

LLVM IR (-O2):
define void @MARK_TIMER() {
ret void
}
int clamp_index_fast(int i, int n) {
  if (i < 0) {
    return 0;
  } else if (i >= n) {
    return n - 1;
  };
  return i;
}


x86 assembly (clang, -O0):
<clamp_index_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1120 <clamp_index_fast+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1145 <clamp_index_fast+0x45>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     113a <clamp_index_fast+0x3a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <clamp_index_fast+0x45>
jmp    113f <clamp_index_fast+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_index_fast>:
lea    -0x1(%rsi),%ecx
cmp    %esi,%edi
cmovl  %edi,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clamp_index_fast(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 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %19
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %3
br label %19
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %13, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @clamp_index_fast(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = icmp slt i32 %0, %1
%5 = add nsw i32 %1, -1
%6 = select i1 %4, i32 %0, i32 %5
%7 = select i1 %3, i32 0, i32 %6
ret i32 %7
}
int is_len_2(const char *alpha2) {
  if (alpha2[0] == '\0' || (alpha2[1] == '\0'))
    return 0;
  if (alpha2[2] == '\0')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_len_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1129 <is_len_2+0x29>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1135 <is_len_2+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1159 <is_len_2+0x59>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    1152 <is_len_2+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <is_len_2+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_len_2>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1116 <is_len_2+0x16>
cmpb   $0x0,0x1(%rdi)
je     1116 <is_len_2+0x16>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_len_2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %1, %4
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int x;
  printf("Digite um numero: ");
  scanf("%d", &x);
  if (x == 1) {
    printf("Você digitou 1");
  } else {
    printf("Você NAO digitou 1");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1166 <main+0x46>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <main+0x52>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Voc\C3\AA digitou 1\00"
@.str.3 = [20 x i8] c"Voc\C3\AA NAO digitou 1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Voc\C3\AA digitou 1\00"
@.str.3 = [20 x i8] c"Voc\C3\AA NAO digitou 1\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
int mykeycmp(const void *s1, const void *s2) {
  if (*((int *)s1) < *((int *)s2))
    return -1;
  else if (*((int *)s1) > *((int *)s2))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mykeycmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <mykeycmp+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <mykeycmp+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1148 <mykeycmp+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <mykeycmp+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mykeycmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mykeycmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct xc_die {
  int dummy;
};

/* Variables and functions */
scalar_t__ xc6_get_bram_data_len(struct xc_die const *);
scalar_t__ xc6_get_bram_start(struct xc_die const *);
uint32_t xc6_get_iob_start(const struct xc_die *die) {
  return xc6_get_bram_start(die) + xc6_get_bram_data_len(die);
}


x86 assembly (clang, -O0):
<xc6_get_iob_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xc6_get_bram_start@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xc6_get_bram_data_len@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.xc_die = type { i32 }
define i64 @xc6_get_iob_start(%struct.xc_die* %0) {
%2 = alloca %struct.xc_die*
store %struct.xc_die* %0, %struct.xc_die** %2
%3 = load %struct.xc_die*, %struct.xc_die** %2
%4 = call i64 @xc6_get_bram_start(%struct.xc_die* %3)
%5 = load %struct.xc_die*, %struct.xc_die** %2
%6 = call i64 @xc6_get_bram_data_len(%struct.xc_die* %5)
%7 = add nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.xc_die = type { i32 }
define i64 @xc6_get_iob_start(%struct.xc_die* %0) {
%2 = tail call i64 @xc6_get_bram_start(%struct.xc_die* %0)
%3 = tail call i64 @xc6_get_bram_data_len(%struct.xc_die* %0)
%4 = add nsw i64 %3, %2
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int output_end(FILE *pOutput) {
  int iRetval = 0;
  if (EOF == fputs("\n"
                   "!endif"
                   "\n",
                   pOutput)) {
    fprintf(stderr, "MANTOMAK:  Error writing to file....\n");
    iRetval = 1;
  }
  return (iRetval);
}


x86 assembly (clang, -O0):
<output_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <fputs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jne    117d <output_end+0x5d>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_end>:
push   %rbx
mov    %rdi,%rsi
mov    0x2ebd(%rip),%rax
mov    (%rax),%rbx
lea    0xecb(%rip),%rdi
call   1030 <fputs@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
jne    115e <output_end+0x3e>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [9 x i8] c"\0A!endif\0A\00"
@stderr = global i32 0
@.str.1 = [38 x i8] c"MANTOMAK: Error writing to file....\0A\00"
define i32 @output_end(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i64, i64* @EOF
%5 = load i32*, i32** %2
%6 = call i64 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = icmp eq i64 %4, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [9 x i8] c"\0A!endif\0A\00"
@stderr = global i32 0
@.str.1 = [38 x i8] c"MANTOMAK: Error writing to file....\0A\00"
define i32 @output_end(i32* nocapture %0) {
%2 = load i64, i64* @EOF
%3 = tail call i64 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
%9 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %9
}
int security_socket_connect(struct socket *sock, struct sockaddr *address,
                            int addrlen) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.socket = type opaque
%struct.sockaddr = type opaque
define i32 @security_socket_connect(%struct.socket* nocapture readnone %0, %struct.sockaddr* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x9a() {
  Assert_real((isdigit(154) == 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_isdigit.c",
              775, ("isdigit should be 0 for 0x9a"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x9a>:
push   %rax
mov    $0x9a,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x307,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x9a\00"
define void @t_isdigit_0x9a() {
%1 = call i64 @isdigit(i32 154)
%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 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x9a\00"
define void @t_isdigit_0x9a() {
%1 = tail call i64 @isdigit(i32 154)
%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 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}