xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main() {
  int a;
  printf("%p\n", &a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ signalFaultInterrupt();
void HardFaultISR() {
  signalFaultInterrupt();
  while (true) {
  }
}


x86 assembly (clang, -O0):
<HardFaultISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <signalFaultInterrupt@plt>
jmp    111b <HardFaultISR+0xb>

x86 assembly (clang, -O2):
<HardFaultISR>:
push   %rax
xor    %eax,%eax
call   1030 <signalFaultInterrupt@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <HardFaultISR+0x10>

LLVM IR (-O0):
define void @HardFaultISR() {
%1 = call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @HardFaultISR() {
%1 = tail call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}
get_magic_number() { return 123456; }


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

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

LLVM IR (-O0):
define i32 @get_magic_number() {
ret i32 123456
}

LLVM IR (-O2):
define i32 @get_magic_number() {
ret i32 123456
}
/* Variables and functions */
char *malloc(size_t);
scalar_t__ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
                    char const *, char const *);
int /*<<< orphan*/ sprintf(char *, char const *, char const *, char const *);
char *build_file_name(const char *pattern, const char *file_basepath,
                      const char *identify_name) {
  char *file_name = malloc(
      (size_t)snprintf(NULL, 0, pattern, file_basepath, identify_name) + 1);
  sprintf(file_name, pattern, file_basepath, identify_name);
  return file_name;
}


x86 assembly (clang, -O0):
<build_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <snprintf@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_file_name>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %edi,%edi
xor    %esi,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <snprintf@plt>
lea    0x1(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @build_file_name(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i64 @snprintf(i32* null, i32 0, i8* %8, i8* %9, i8* %10)
%12 = add i64 %11, 1
%13 = call i8* @malloc(i64 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = call i32 @sprintf(i8* %14, i8* %15, i8* %16, i8* %17)
%19 = load i8*, i8** %7
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @build_file_name(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @snprintf(i32* null, i32 0, i8* %0, i8* %1, i8* %2)
%5 = add i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0, i8* %1, i8* %2)
ret i8* %6
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int countlib(int);
int offset(int, int, int, int);
int autohelperowl_attackpat121(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int A;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(-2, -1, move, transformation);
  return countlib(A) > 1;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat121>:
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    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xfffffffe,%edi
mov    $0xffffffff,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <countlib@plt>
cmp    $0x1,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat121>:
push   %rax
mov    %esi,%ecx
mov    $0xfffffffe,%edi
mov    $0xffffffff,%esi
call   1030 <offset@plt>
mov    %eax,%edi
call   1040 <countlib@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat121(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 -2, i32 -1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i32 @countlib(i32 %18)
%20 = icmp sgt i32 %19, 1
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat121(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 -2, i32 -1, i32 %2, i32 %1)
%7 = tail call i32 @countlib(i32 %6)
%8 = icmp sgt i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
int atsas_int_parse_header(struct saxs_document *doc,
                           const struct line *firstline,
                           const struct line *lastline) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.saxs_document = type opaque
%struct.line = type opaque
define i32 @atsas_int_parse_header(%struct.saxs_document* nocapture readnone %0, %struct.line* nocapture readnone %1, %struct.line* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ make_disk(char *);
int /*<<< orphan*/ stderr;
int make_fs(char *disk_name) {
  if (make_disk(disk_name)) {
    fprintf(stderr, "make_fs: Could not create disk.\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<make_fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <make_disk@plt>
cmp    $0x0,%rax
je     1160 <make_fs+0x40>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <make_fs+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_fs>:
push   %rax
call   1040 <make_disk@plt>
test   %rax,%rax
je     1147 <make_fs+0x27>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"make_fs: Could not create disk.\0A\00"
define i32 @make_fs(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @make_disk(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"make_fs: Could not create disk.\0A\00"
define i32 @make_fs(i8* %0) {
%2 = tail call i64 @make_disk(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %8
}
int chirp_fs_do_acl_check() { return 1; }


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

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

LLVM IR (-O0):
define i32 @chirp_fs_do_acl_check() {
ret i32 1
}

LLVM IR (-O2):
define i32 @chirp_fs_do_acl_check() {
ret i32 1
}
int sdt_rewrite_copy_descriptor(int descriptor_tag) {
  int allowed_descriptors[] = {0x47, 0x48, 0x50, 0x51, 0x53, 0x5D, 0x6E};
  int num_allowed = sizeof(allowed_descriptors) / sizeof(int);
  for (int i = 0; i < num_allowed; i++)
    if (descriptor_tag == allowed_descriptors[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<sdt_rewrite_copy_descriptor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeea(%rip),%eax
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    117b <sdt_rewrite_copy_descriptor+0x7b>
mov    -0x8(%rbp),%eax
movslq -0x38(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    1168 <sdt_rewrite_copy_descriptor+0x68>
movl   $0x1,-0x4(%rbp)
jmp    1182 <sdt_rewrite_copy_descriptor+0x82>
jmp    116d <sdt_rewrite_copy_descriptor+0x6d>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    113f <sdt_rewrite_copy_descriptor+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdt_rewrite_copy_descriptor>:
add    $0xffffffb9,%edi
cmp    $0x27,%edi
ja     111e <sdt_rewrite_copy_descriptor+0x1e>
mov    $0x1,%eax
movabs $0x8000401603,%rcx
bt     %rdi,%rcx
jae    111e <sdt_rewrite_copy_descriptor+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.sdt_rewrite_copy_descriptor.allowed_descriptors = [7 x i32] [i32 71, i32 72, i32 80, i32 81, i32 83, i32 93, i32 110]
define i32 @sdt_rewrite_copy_descriptor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [7 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
%7 = bitcast [7 x i32]* %4 to i8*
store i32 7, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %21, %1
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %13, %17
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 1, i32* %2
br label %25
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %8
24: ; preds = %8
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @sdt_rewrite_copy_descriptor(i32 %0) {
switch i32 %0, label %2 [
i32 71, label %3
i32 72, label %3
i32 80, label %3
i32 81, label %3
i32 83, label %3
i32 93, label %3
i32 110, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __startup_data_init();
int /*<<< orphan*/ _start();
void __main(void) {
  __startup_data_init();
  _start();
}


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

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

LLVM IR (-O0):
define void @__main() {
%1 = call i32 (...) @__startup_data_init()
%2 = call i32 (...) @_start()
ret void
}

LLVM IR (-O2):
define void @__main() {
%1 = tail call i32 (...) @__startup_data_init()
%2 = tail call i32 (...) @_start()
ret void
}
/* Variables and functions */
int GPTLerror(char *, char const *);
int init_read_real_time() {
  static const char *thisfunc = "init_read_real_time";
  return GPTLerror("%s: not enabled\n", thisfunc);
}


x86 assembly (clang, -O0):
<init_read_real_time>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rsi
lea    0xef2(%rip),%rdi
call   1030 <GPTLerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_read_real_time>:
lea    0xefd(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <GPTLerror@plt>

LLVM IR (-O0):
@init_read_real_time.thisfunc = internal global i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0)
@.str = [20 x i8] c"init_read_real_time\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define i32 @init_read_real_time() {
%1 = load i8*, i8** @init_read_real_time.thisfunc
%2 = call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [20 x i8] c"init_read_real_time\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define i32 @init_read_real_time() {
%1 = tail call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
void *try_lookup_symbol(char const *, int /*<<< orphan*/);
void *lookup_symbol(const char *sym) { return try_lookup_symbol(sym, 0); }


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

x86 assembly (clang, -O2):
<lookup_symbol>:
xor    %esi,%esi
jmp    1030 <try_lookup_symbol@plt>

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

LLVM IR (-O2):
define i8* @lookup_symbol(i8* %0) {
%2 = tail call i8* @try_lookup_symbol(i8* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Rmain(char **, char **, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc != 4)
    printf("ERROR: Correct program useage: ./QtoEcalc [data filelist] [peptide "
           "filelist] [parameter file] \n");
  else {
    Rmain(&(argv[1]), &(argv[2]), &(argv[3]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x4e>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
call   1040 <Rmain@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x4,%edi
jne    113c <main+0x1c>
mov    %rsi,%rdx
lea    0x8(%rsi),%rdi
add    $0x10,%rsi
add    $0x18,%rdx
call   1040 <Rmain@plt>
jmp    1148 <main+0x28>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [96 x i8] c"ERROR: Correct program useage: ./QtoEcalc [data filelist] [peptide filelist] [parameter file] \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
br label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 3
%17 = call i32 @Rmain(i8** %12, i8** %14, i8** %16)
br label %18
18: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@str = [95 x i8] c"ERROR: Correct program useage: ./QtoEcalc [data filelist] [peptide filelist] [parameter file] \00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = tail call i32 @Rmain(i8** %7, i8** %8, i8** %9)
br label %11
11: ; preds = %6, %4
ret i32 0
}
yyerror() { ; }


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

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

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

LLVM IR (-O2):
define i32 @yyerror() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void putword(const char *s) {
  static int first = 1;
  if (!first)
    putchar(' ');
  fputs(s, stdout);
  first = 0;
}


x86 assembly (clang, -O0):
<putword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2efd(%rip)
jne    1143 <putword+0x23>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
movl   $0x0,0x2ed1(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putword>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x1,0x2f09(%rip)
jne    1137 <putword+0x17>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <fputs@plt>
movb   $0x1,0x2ee5(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@putword.first = internal global i32 1
@stdout = global i32 0
define void @putword(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @putword.first
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @putchar(i8 signext 32)
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* %8, i32 %9)
store i32 0, i32* @putword.first
ret void
}

LLVM IR (-O2):
@putword.first = internal unnamed_addr global i1 false
@stdout = global i32 0
define void @putword(i8* %0) {
%2 = load i1, i1* @putword.first
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putchar(i8 signext 32)
br label %5
5: ; preds = %3, %1
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputs(i8* %0, i32 %6)
store i1 true, i1* @putword.first
ret void
}
void null_deref(int *a) {
  if (a)
    return;
  *a = 1;
}


x86 assembly (clang, -O0):
<null_deref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <null_deref+0x18>
jmp    1122 <null_deref+0x22>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_deref(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32*, i32** %2
store i32 1, i32* %7
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @null_deref(i32* readnone %0) {
%2 = icmp ne i32* %0, null
tail call void @llvm.assume(i1 %2)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strrev1(char *);
int plndrm(char a[]) {
  char b[100006];
  strcpy(b, a);
  strrev1(b);
  if (strcmp(a, b) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<plndrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186c0,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x186c0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x186c0(%rbp),%rdi
call   1050 <strrev1@plt>
mov    -0x10(%rbp),%rdi
lea    -0x186c0(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1181 <plndrm+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1188 <plndrm+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x186c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plndrm>:
push   %r14
push   %rbx
sub    $0x186a8,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <strrev1@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x186a8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @plndrm(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [100006 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [100006 x i8], [100006 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [100006 x i8], [100006 x i8]* %4, i64 0, i64 0
%9 = call i32 @strrev1(i8* %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [100006 x i8], [100006 x i8]* %4, i64 0, i64 0
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @plndrm(i8* %0) {
%2 = alloca [100006 x i8]
%3 = getelementptr inbounds [100006 x i8], [100006 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @strrev1(i8* %3)
%6 = call i64 @strcmp(i8* %0, i8* %3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f3(void *ass_t) { puts("Kviz cislo 8"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Kviz cislo 8\00"
define void @f3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Kviz cislo 8\00"
define void @f3(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ exp(scalar_t__);
scalar_t__ factln(int);
float floor(scalar_t__);
float bico(int n, int k) {
  return floor(0.5 + exp(factln(n) - factln(k) - factln(n - k)));
}


x86 assembly (clang, -O0):
<bico>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factln@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factln@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factln@plt>
mov    -0x10(%rbp),%rdi
sub    %rax,%rdi
call   1040 <exp@plt>
cvtsi2sd %rax,%xmm1
movsd  0xe7c(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <floor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bico>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <factln@plt>
mov    %rax,%rbx
mov    %r14d,%edi
call   1030 <factln@plt>
mov    %rax,%r15
sub    %r14d,%ebp
mov    %ebp,%edi
call   1030 <factln@plt>
add    %r15,%rax
sub    %rax,%rbx
mov    %rbx,%rdi
call   1040 <exp@plt>
cvtsi2sd %rax,%xmm0
addsd  0xe8c(%rip),%xmm0
cvttsd2si %xmm0,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <floor@plt>

LLVM IR (-O0):
define float @bico(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i64 @factln(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @factln(i32 %7)
%9 = sub nsw i64 %6, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = call i64 @factln(i32 %12)
%14 = sub nsw i64 %9, %13
%15 = call i64 @exp(i64 %14)
%16 = sitofp i64 %15 to double
%17 = fadd double 5.000000e-01, %16
%18 = fptosi double %17 to i64
%19 = call float @floor(i64 %18)
ret float %19
}

LLVM IR (-O2):
define float @bico(i32 %0, i32 %1) {
%3 = tail call i64 @factln(i32 %0)
%4 = tail call i64 @factln(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i64 @factln(i32 %5)
%7 = add i64 %4, %6
%8 = sub i64 %3, %7
%9 = tail call i64 @exp(i64 %8)
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i64
%13 = tail call float @floor(i64 %12)
ret float %13
}
int test_imm_EAuint32_reg(unsigned int val) {
  return ((val) & (0xEA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EAuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xea,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EAuint32_reg>:
test   $0xea,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EAuint32_reg(i32 %0) {
%2 = and i32 %0, 234
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ outb(int, int);
unsigned char fb_get_cursor_start() {
  outb(0x3D4, 0x0A);
  return inb(0x3D5);
}


x86 assembly (clang, -O0):
<fb_get_cursor_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_get_cursor_start>:
push   %rax
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @fb_get_cursor_start() {
%1 = call i32 @outb(i32 980, i32 10)
%2 = call zeroext i8 @inb(i32 981)
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @fb_get_cursor_start() {
%1 = tail call i32 @outb(i32 980, i32 10)
%2 = tail call zeroext i8 @inb(i32 981)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ proc_yield();
void aeron_idle_strategy_busy_spinning_idle(void *state, int work_count) {
  if (work_count > 0) {
    return;
  }
  proc_yield();
}


x86 assembly (clang, -O0):
<aeron_idle_strategy_busy_spinning_idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    112e <aeron_idle_strategy_busy_spinning_idle+0x1e>
jmp    1135 <aeron_idle_strategy_busy_spinning_idle+0x25>
mov    $0x0,%al
call   1030 <proc_yield@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_idle_strategy_busy_spinning_idle>:
test   %esi,%esi
jle    1115 <aeron_idle_strategy_busy_spinning_idle+0x5>
ret
xor    %eax,%eax
jmp    1030 <proc_yield@plt>

LLVM IR (-O0):
define void @aeron_idle_strategy_busy_spinning_idle(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = call i32 (...) @proc_yield()
br label %10
10: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @aeron_idle_strategy_busy_spinning_idle(i8* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @proc_yield()
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x6a() {
  Assert_real((islower(106)),
              "/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_islower.c",
              535, ("islower should be 1 for j"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x6a>:
push   %rax
mov    $0x6a,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x217,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for j\00"
define void @t_islower_0x6a() {
%1 = call i32 @islower(i32 106)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for j\00"
define void @t_islower_0x6a() {
%1 = tail call i32 @islower(i32 106)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int judget(int x) {
  int temp;
  int a, b, c;
  a = x / 100;
  b = (x / 10) % 10;
  c = x % 10;
  if ((x % 7) && (a != 7) && (b != 7) && (c != 7))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<judget>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1177 <judget+0x77>
cmpl   $0x7,-0x10(%rbp)
je     1177 <judget+0x77>
cmpl   $0x7,-0x14(%rbp)
je     1177 <judget+0x77>
cmpl   $0x7,-0x18(%rbp)
je     1177 <judget+0x77>
movl   $0x1,-0x4(%rbp)
jmp    117e <judget+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<judget>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
imul   $0xb6db6db7,%eax,%ecx
add    $0x12492492,%ecx
cmp    $0x24924925,%ecx
setae  %cl
add    $0xfffffce0,%eax
cmp    $0xffffff9c,%eax
setb   %al
and    %cl,%al
cmp    $0x7,%esi
setne  %cl
cmp    $0x7,%edx
setne  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @judget(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = srem i32 %2, 10
%4 = srem i32 %0, 10
%5 = srem i32 %0, 7
%6 = icmp ne i32 %5, 0
%7 = add i32 %0, -800
%8 = icmp ult i32 %7, -100
%9 = and i1 %6, %8
%10 = icmp ne i32 %3, 7
%11 = and i1 %9, %10
%12 = icmp ne i32 %4, 7
%13 = and i1 %12, %11
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
double kub(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Vnesete eden priroden broj: ");
  scanf("%d", &n);
  double rezultat = kub(n);
  printf("Kubot na brojot %d e %.2f\n", n, rezultat);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <kub@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <kub@plt>
mov    0x4(%rsp),%esi
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Vnesete eden priroden broj: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Kubot na brojot %d e %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call double @kub(i32 %6)
store double %7, double* %3
%8 = load i32, i32* %2
%9 = load double, double* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Vnesete eden priroden broj: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Kubot na brojot %d e %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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 = call double @kub(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %7, double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ATKprintf(char *);
void Prindent(int d) {
  int i;
  for (i = 0; i < d; i++)
    ATKprintf(" ");
}


x86 assembly (clang, -O0):
<Prindent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <Prindent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <ATKprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <Prindent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Prindent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <Prindent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <ATKprintf@plt>
add    $0xffffffff,%ebx
jne    1130 <Prindent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @Prindent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @ATKprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
double timespec2dtime(int /*<<< orphan*/, int /*<<< orphan*/);
double getdtime(void) {
  struct timespec tp;
  if (clock_gettime(CLOCK_MONOTONIC, &tp) == -1)
    return (-1);
  return timespec2dtime(tp.tv_sec, tp.tv_nsec);
}


x86 assembly (clang, -O0):
<getdtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
jne    1155 <getdtime+0x35>
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <getdtime+0x45>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <timespec2dtime@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdtime>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
je     1145 <getdtime+0x25>
mov    (%rsp),%esi
mov    0x4(%rsp),%edi
call   1040 <timespec2dtime@plt>
pop    %rax
ret
movsd  0xeb3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @getdtime() {
%1 = alloca double
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store double -1.000000e+00, double* %1
br label %13
7: ; preds = %0
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call double @timespec2dtime(i32 %9, i32 %11)
store double %12, double* %1
br label %13
13: ; preds = %7, %6
%14 = load double, double* %1
ret double %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @getdtime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call double @timespec2dtime(i32 %8, i32 %10)
br label %12
12: ; preds = %0, %6
%13 = phi double [ %11, %6 ], [ -1.000000e+00, %0 ]
ret double %13
}
/* Variables and functions */
int veidtcall_util_read_dxfeed(int /*<<< orphan*/ *, int, char *, size_t);
int dsm_dxfeed_read(char *buf, size_t len) {
  int retval = veidtcall_util_read_dxfeed(NULL, 1, buf, len);
  return retval;
}


x86 assembly (clang, -O0):
<dsm_dxfeed_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <veidtcall_util_read_dxfeed@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsm_dxfeed_read>:
mov    %rsi,%rcx
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <veidtcall_util_read_dxfeed@plt>

LLVM IR (-O0):
define i32 @dsm_dxfeed_read(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @veidtcall_util_read_dxfeed(i32* null, i32 1, i8* %6, i64 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @dsm_dxfeed_read(i8* %0, i64 %1) {
%3 = tail call i32 @veidtcall_util_read_dxfeed(i32* null, i32 1, i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
double pow(double, float);
float g1Dash(float x) { return 1.0 / 4 * pow(2.718281828, x / 2); }


x86 assembly (clang, -O0):
<g1Dash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xee6(%rip),%xmm0
divss  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1Dash>:
push   %rax
movaps %xmm0,%xmm1
mulss  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
call   1030 <pow@plt>
mulsd  0xedf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @g1Dash(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+00
%5 = call double @pow(double 0x4005BF0A8B04919B, float %4)
%6 = fmul double 2.500000e-01, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @g1Dash(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call double @pow(double 0x4005BF0A8B04919B, float %2)
%4 = fmul double %3, 2.500000e-01
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ uppercase(char *);
int main() {
  char c1 = 'a';
  printf("c1 = '%c'\n", c1);
  printf("making c1 uppercase..\n");
  uppercase(&c1);
  printf("c1 = '%c'\n", c1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x5(%rbp),%rdi
call   1040 <uppercase@plt>
movsbl -0x5(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x61,0xf(%rsp)
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf(%rsp),%rdi
call   1050 <uppercase@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"c1 = '%c'\0A\00"
@.str.1 = [23 x i8] c"making c1 uppercase..\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @uppercase(i8* %2)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"c1 = '%c'\0A\00"
@str = [22 x i8] c"making c1 uppercase..\00"
define i32 @main() {
%1 = alloca i8
store i8 97, i8* %1
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 97)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @uppercase(i8* %1)
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int syscall(int, unsigned int, int);
int eventfd(unsigned int count, int flags) {
  return syscall(flags ? 290 : 284, count, flags);
}


x86 assembly (clang, -O0):
<eventfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x11c,%edi
mov    $0x122,%eax
cmp    $0x0,%ecx
cmovne %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd>:
mov    %esi,%edx
mov    %edi,%esi
test   %edx,%edx
mov    $0x11c,%eax
mov    $0x122,%edi
cmove  %eax,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @eventfd(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 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 290, i32 284
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @syscall(i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @eventfd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 284, i32 290
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1)
ret i32 %5
}
void LIS3DSH_DeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @LIS3DSH_DeInit() {
ret void
}