xunge/DecIR huggingface dataset:
/* Variables and functions */
int ksft_exit_fail();
int ksft_exit_pass();
scalar_t__ validate_freq();
int main(int argc, char **argv) {
  if (validate_freq())
    return ksft_exit_fail();
  return ksft_exit_pass();
}


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)
mov    $0x0,%al
call   1050 <validate_freq@plt>
cmp    $0x0,%rax
je     1166 <main+0x36>
mov    $0x0,%al
call   1040 <ksft_exit_fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1170 <main+0x40>
mov    $0x0,%al
call   1030 <ksft_exit_pass@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <validate_freq@plt>
test   %rax,%rax
je     1145 <main+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ksft_exit_fail@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ksft_exit_pass@plt>

LLVM IR (-O0):
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 = call i64 (...) @validate_freq()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @ksft_exit_fail()
store i32 %9, i32* %3
br label %12
10: ; preds = %2
%11 = call i32 (...) @ksft_exit_pass()
store i32 %11, i32* %3
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @validate_freq()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @ksft_exit_fail()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ksft_exit_pass()
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
int num_to_roman(char c) {
  switch (c) {
  case 'I':
    return (1);
  case 'V':
    return (5);
  case 'X':
    return (10);
  case 'L':
    return (50);
  case 'C':
    return (100);
  case 'D':
    return (500);
  case 'M':
    return (1000);
  }
  return (0);
}


x86 assembly (clang, -O0):
<num_to_roman>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1188 <num_to_roman+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118f <num_to_roman+0x8f>
movl   $0x5,-0x4(%rbp)
jmp    118f <num_to_roman+0x8f>
movl   $0xa,-0x4(%rbp)
jmp    118f <num_to_roman+0x8f>
movl   $0x32,-0x4(%rbp)
jmp    118f <num_to_roman+0x8f>
movl   $0x64,-0x4(%rbp)
jmp    118f <num_to_roman+0x8f>
movl   $0x1f4,-0x4(%rbp)
jmp    118f <num_to_roman+0x8f>
movl   $0x3e8,-0x4(%rbp)
jmp    118f <num_to_roman+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_to_roman>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1129 <num_to_roman+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1f4,%eax
ret
xor    %eax,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret
mov    $0x3e8,%eax
ret

LLVM IR (-O0):
define i32 @num_to_roman(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 68, label %11
i32 77, label %12
]
6: ; preds = %1
store i32 1, i32* %2
br label %14
7: ; preds = %1
store i32 5, i32* %2
br label %14
8: ; preds = %1
store i32 10, i32* %2
br label %14
9: ; preds = %1
store i32 50, i32* %2
br label %14
10: ; preds = %1
store i32 100, i32* %2
br label %14
11: ; preds = %1
store i32 500, i32* %2
br label %14
12: ; preds = %1
store i32 1000, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @num_to_roman(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 73, label %10
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
i32 68, label %7
i32 77, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i32 [ 0, %9 ], [ 1000, %8 ], [ 500, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void gotonextline(FILE *fp) {
  char c;
  do {
    c = fgetc(fp);
  } while (c != '\n');
}


x86 assembly (clang, -O0):
<gotonextline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    111c <gotonextline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotonextline>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1120 <gotonextline+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @gotonextline(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
br label %4
4: ; preds = %7, %1
%5 = load i32*, i32** %2
%6 = call signext i8 @fgetc(i32* %5)
store i8 %6, i8* %3
br label %7
7: ; preds = %4
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %4, label %11
11: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @gotonextline(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 @fgetc(i32* %0)
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void dummy_idle(void *user) { fprintf(stderr, "GCodeParser: input idle\n"); }


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

x86 assembly (clang, -O2):
<dummy_idle>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"GCodeParser: input idle\0A\00"
define void @dummy_idle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"GCodeParser: input idle\0A\00"
define void @dummy_idle(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
int getHeading() { return 181; }


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

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

LLVM IR (-O0):
define i32 @getHeading() {
ret i32 181
}

LLVM IR (-O2):
define i32 @getHeading() {
ret i32 181
}
double bnabs(double a) { return a > 0 ? a : -a; }


x86 assembly (clang, -O0):
<bnabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <bnabs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <bnabs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnabs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @bnabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @bnabs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int party_check_conflict(int, int, char *);
int mapif_parse_PartyCheck(int fd, int party_id, int account_id, char *nick) {
  return party_check_conflict(party_id, account_id, nick);
}


x86 assembly (clang, -O0):
<mapif_parse_PartyCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <party_check_conflict@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_parse_PartyCheck>:
mov    %esi,%edi
mov    %edx,%esi
mov    %rcx,%rdx
jmp    1030 <party_check_conflict@plt>

LLVM IR (-O0):
define i32 @mapif_parse_PartyCheck(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* %6
%10 = load i32, i32* %7
%11 = load i8*, i8** %8
%12 = call i32 @party_check_conflict(i32 %9, i32 %10, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @mapif_parse_PartyCheck(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @party_check_conflict(i32 %1, i32 %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ xml_deinit();
void xol_rd_deinit(void) { xml_deinit(); }


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

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

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

LLVM IR (-O2):
define void @xol_rd_deinit() {
%1 = tail call i32 (...) @xml_deinit()
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *Basename(const char *path) {
  const char *cp;
  cp = strrchr(path, '/');
  if (cp == NULL)
    return (path);
  return (cp + 1);
}


x86 assembly (clang, -O0):
<Basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <Basename+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <Basename+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @Basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int ilog2(int n) {
  int r = 0;
  n--;
  while (n) {
    n >>= 1;
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <ilog2+0x38>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <ilog2+0x17>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
xor    %eax,%eax
add    $0xffffffff,%edi
je     111c <ilog2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = ashr i32 %6, 1
%8 = add nuw nsw i32 %5, 1
%9 = icmp ult i32 %6, 2
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x85() {
  Assert_real((isbdigit(133) == 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_isbdigit.c",
              670, ("isbdigit should be 0 for 0x85"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x85>:
push   %rax
mov    $0x85,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x29e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x85\00"
define void @t_isbdigit_0x85() {
%1 = call i64 @isbdigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x85\00"
define void @t_isbdigit_0x85() {
%1 = tail call i64 @isbdigit(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
const char *Joint_CopyString(const char *str) {
  char *tmp = malloc(strlen(str) + 1);
  strcpy(tmp, str);
  return tmp;
}


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

x86 assembly (clang, -O2):
<Joint_CopyString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Joint_CopyString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @Joint_CopyString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int map_lock(struct map_ent **melp) { return 0; }


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

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

LLVM IR (-O0):
%struct.map_ent = type opaque
define i32 @map_lock(%struct.map_ent** %0) {
%2 = alloca %struct.map_ent**
store %struct.map_ent** %0, %struct.map_ent*** %2
ret i32 0
}

LLVM IR (-O2):
%struct.map_ent = type opaque
define i32 @map_lock(%struct.map_ent** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_format0(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print_format1(char *, int /*<<< orphan*/, char *);
void printf2(char *s, char *a1, char *a2) {
  print_format0(s, print_format1(s, print_format1(s, 0, a1), a2));
}


x86 assembly (clang, -O0):
<printf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <print_format1@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1030 <print_format1@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <print_format0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <print_format1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
call   1030 <print_format1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <print_format0@plt>

LLVM IR (-O0):
define void @printf2(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @print_format1(i8* %9, i32 0, i8* %10)
%12 = load i8*, i8** %6
%13 = call i32 @print_format1(i8* %8, i32 %11, i8* %12)
%14 = call i32 @print_format0(i8* %7, i32 %13)
ret void
}

LLVM IR (-O2):
define void @printf2(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @print_format1(i8* %0, i32 0, i8* %1)
%5 = tail call i32 @print_format1(i8* %0, i32 %4, i8* %2)
%6 = tail call i32 @print_format0(i8* %0, i32 %5)
ret void
}
void RTStrValidateEncodingEx(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @actuator_filelogger_cleanup() {
ret void
}
int main() {
  if (1) {
    return 4;
  }
  return 5;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void pthread_yield(void) { (void)sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @pthread_yield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ unlink(char const *);
void f2b_csocket_disconnect(int sock, const char *cpath) {
  unlink(cpath);
  if (sock >= 0)
    close(sock);
  return;
}


x86 assembly (clang, -O0):
<f2b_csocket_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmpl   $0x0,-0x4(%rbp)
jl     114a <f2b_csocket_disconnect+0x2a>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2b_csocket_disconnect>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <unlink@plt>
test   %ebx,%ebx
js     1137 <f2b_csocket_disconnect+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @f2b_csocket_disconnect(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @unlink(i8* %1)
%4 = icmp sgt i32 %0, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @close(i32 %0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_shm_cleanup() {
  printf("NOT IMPLEMENTED:"
         "pa_shm_cleanup"
         "\n");
}


x86 assembly (clang, -O0):
<pa_shm_cleanup>:
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_shm_cleanup>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_shm_cleanup\00"
define i32 @pa_shm_cleanup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ irc_core_deinit();
int /*<<< orphan*/ irc_dcc_deinit();
int /*<<< orphan*/ irc_flood_deinit();
int /*<<< orphan*/ irc_notifylist_deinit();
void irc_deinit(void) {
  irc_notifylist_deinit();
  irc_flood_deinit();
  irc_dcc_deinit();
  irc_core_deinit();
}


x86 assembly (clang, -O0):
<irc_deinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <irc_notifylist_deinit@plt>
mov    $0x0,%al
call   1030 <irc_flood_deinit@plt>
mov    $0x0,%al
call   1050 <irc_dcc_deinit@plt>
mov    $0x0,%al
call   1060 <irc_core_deinit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_deinit>:
push   %rax
xor    %eax,%eax
call   1040 <irc_notifylist_deinit@plt>
xor    %eax,%eax
call   1030 <irc_flood_deinit@plt>
xor    %eax,%eax
call   1050 <irc_dcc_deinit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <irc_core_deinit@plt>

LLVM IR (-O0):
define void @irc_deinit() {
%1 = call i32 (...) @irc_notifylist_deinit()
%2 = call i32 (...) @irc_flood_deinit()
%3 = call i32 (...) @irc_dcc_deinit()
%4 = call i32 (...) @irc_core_deinit()
ret void
}

LLVM IR (-O2):
define void @irc_deinit() {
%1 = tail call i32 (...) @irc_notifylist_deinit()
%2 = tail call i32 (...) @irc_flood_deinit()
%3 = tail call i32 (...) @irc_dcc_deinit()
%4 = tail call i32 (...) @irc_core_deinit()
ret void
}
void files_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @files_cleanup() {
ret void
}
void strzalka(int szerokosc, int wysokosc) {}


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

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

LLVM IR (-O0):
define void @strzalka(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @strzalka(i32 %0, i32 %1) {
ret void
}
void RTAvlrPVRangeGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrPVRangeGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void network_close(int fd) { close(fd); }


x86 assembly (clang, -O0):
<network_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @network_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ f();
int g();
int main(void) {
  int x = g();
  x += f();
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <g@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <f@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @g()
store i32 %3, i32* %2
%4 = call i64 (...) @f()
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, %4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @g()
%2 = tail call i64 (...) @f()
%3 = trunc i64 %2 to i32
%4 = add i32 %1, %3
ret i32 %4
}
/* Variables and functions */
int syscall(int);
int select() { return syscall(3); }


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

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

LLVM IR (-O0):
define i32 @select() {
%1 = call i32 @syscall(i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @select() {
%1 = tail call i32 @syscall(i32 3)
ret i32 %1
}
void kolibri_get_bitmap_opaque(void *bitmap) {}


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

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

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

LLVM IR (-O2):
define void @kolibri_get_bitmap_opaque(i8* nocapture %0) {
ret void
}
long long f5(long long x, long long y) {
  return (x & ~0xffffffffull) | (y & 0xffffffff);
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xffffffff00000000,%rax
ff ff ff
and    -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rdi,%rcx
mov    %esi,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @f5(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, -4294967296
%7 = load i64, i64* %4
%8 = and i64 %7, 4294967295
%9 = or i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @f5(i64 %0, i64 %1) {
%3 = and i64 %0, -4294967296
%4 = and i64 %1, 4294967295
%5 = or i64 %4, %3
ret i64 %5
}
void g_DUMMY_menu_destroy_floating(int win_id) { win_id = win_id; }


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

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

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

LLVM IR (-O2):
define void @g_DUMMY_menu_destroy_floating(i32 %0) {
ret void
}
int main() {
  int a[5];
  int b[5];
  int i;
  for (i = 0; i < 5; ++i) {
    a[i] += b[i];
    b[i] += a[i];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    1152 <main+0x52>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
movslq -0x44(%rbp),%rax
add    -0x20(%rbp,%rax,4),%ecx
mov    %ecx,-0x20(%rbp,%rax,4)
movslq -0x44(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%ecx
movslq -0x44(%rbp),%rax
add    -0x40(%rbp,%rax,4),%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %27, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %30
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %16, %12
store i32 %17, i32* %15
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %25, %21
store i32 %26, i32* %24
br label %27
27: ; preds = %8
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %5
30: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dbg_set_chain(int /*<<< orphan*/);
int /*<<< orphan*/ get_response_from_vpi();
int /*<<< orphan*/ get_word_from_vpi(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ send_address_to_vpi(int);
int /*<<< orphan*/ send_command_to_vpi(int);
int dbg_wb_read32(uint32_t adr, uint32_t *data) {
  if (0)
    printf("dbg_wb_read32: adr 0x%.8x \n", adr);
  dbg_set_chain(0);
  send_command_to_vpi(0x8);
  send_address_to_vpi(adr);
  get_word_from_vpi(data);
  get_response_from_vpi();
  return 0;
}


x86 assembly (clang, -O0):
<dbg_wb_read32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1060 <dbg_set_chain@plt>
mov    $0x8,%edi
call   1030 <send_command_to_vpi@plt>
mov    -0x4(%rbp),%edi
call   1040 <send_address_to_vpi@plt>
mov    -0x10(%rbp),%rdi
call   1050 <get_word_from_vpi@plt>
mov    $0x0,%al
call   1070 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_wb_read32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   1060 <dbg_set_chain@plt>
mov    $0x8,%edi
call   1030 <send_command_to_vpi@plt>
mov    %ebp,%edi
call   1040 <send_address_to_vpi@plt>
mov    %rbx,%rdi
call   1050 <get_word_from_vpi@plt>
xor    %eax,%eax
call   1070 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dbg_wb_read32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @dbg_set_chain(i32 0)
%6 = call i32 @send_command_to_vpi(i32 8)
%7 = load i32, i32* %3
%8 = call i32 @send_address_to_vpi(i32 %7)
%9 = load i32*, i32** %4
%10 = call i32 @get_word_from_vpi(i32* %9)
%11 = call i32 (...) @get_response_from_vpi()
ret i32 0
}

LLVM IR (-O2):
define i32 @dbg_wb_read32(i32 %0, i32* %1) {
%3 = tail call i32 @dbg_set_chain(i32 0)
%4 = tail call i32 @send_command_to_vpi(i32 8)
%5 = tail call i32 @send_address_to_vpi(i32 %0)
%6 = tail call i32 @get_word_from_vpi(i32* %1)
%7 = tail call i32 (...) @get_response_from_vpi()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerPrescaleGet(uint32_t ui32Base, uint32_t ui32Timer) {
  ;

  ;
  return ((ui32Timer == 0x000000ff)
              ? (*((volatile unsigned long *)(ui32Base + 0x00000038)))
              : (*((volatile unsigned long *)(ui32Base + 0x0000003C))));
}


x86 assembly (clang, -O0):
<TimerPrescaleGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    112b <TimerPrescaleGet+0x2b>
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    113a <TimerPrescaleGet+0x3a>
mov    -0x4(%rbp),%eax
add    $0x3c,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleGet>:
xor    %eax,%eax
cmp    $0xff,%esi
setne  %al
lea    0x38(,%rax,4),%eax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%rax
ret

LLVM IR (-O0):
define i32 @TimerPrescaleGet(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 eq i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 56
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
br label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 60
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
br label %19
19: ; preds = %13, %7
%20 = phi i64 [ %12, %7 ], [ %18, %13 ]
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @TimerPrescaleGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 56, i32 60
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
size_t golden_growth_ceil(size_t n) {
  n = (n * 207) >> 6;
  n = (n >> 1) + (n & 1);
  return n;
}


x86 assembly (clang, -O0):
<golden_growth_ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0xcf,-0x8(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<golden_growth_ceil>:
imul   $0xcf,%rdi,%rax
mov    %eax,%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
shr    $0x7,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @golden_growth_ceil(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 207
%5 = lshr i64 %4, 6
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = lshr i64 %6, 1
%8 = load i64, i64* %2
%9 = and i64 %8, 1
%10 = add i64 %7, %9
store i64 %10, i64* %2
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
define i64 @golden_growth_ceil(i64 %0) {
%2 = mul i64 %0, 207
%3 = lshr i64 %2, 6
%4 = lshr i64 %2, 7
%5 = and i64 %3, 1
%6 = add nuw nsw i64 %5, %4
ret i64 %6
}
/* Variables and functions */
float __racosd(float);
float r_acosd(float *x) { return (__racosd(*x)); }


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

x86 assembly (clang, -O2):
<r_acosd>:
movss  (%rdi),%xmm0
jmp    1030 <__racosd@plt>

LLVM IR (-O0):
define float @r_acosd(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @__racosd(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_acosd(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @__racosd(float %2)
ret float %3
}
int right_symbol_identation(char *line) {
  return !(line[0] == ' ' || line[0] == '\t');
}


x86 assembly (clang, -O0):
<right_symbol_identation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <right_symbol_identation+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_symbol_identation>:
mov    (%rdi),%al
cmp    $0x20,%al
setne  %cl
cmp    $0x9,%al
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @right_symbol_identation(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 32
%4 = icmp ne i8 %2, 9
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int *malloc(int);
int pdbg_spr_by_name(char const *);
int *parse_spr(const char *argv) {
  int *spr = malloc(sizeof(*spr));
  if (!argv)
    return NULL;
  *spr = pdbg_spr_by_name(argv);
  if (*spr == -1)
    return NULL;
  return spr;
}


x86 assembly (clang, -O0):
<parse_spr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <parse_spr+0x32>
movq   $0x0,-0x8(%rbp)
jmp    1185 <parse_spr+0x65>
mov    -0x10(%rbp),%rdi
call   1040 <pdbg_spr_by_name@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    117d <parse_spr+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    1185 <parse_spr+0x65>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_spr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rbx,%rbx
je     1151 <parse_spr+0x31>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <pdbg_spr_by_name@plt>
mov    %eax,%ecx
mov    %eax,(%r14)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
cmovne %r14,%rax
jmp    1153 <parse_spr+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i32* @parse_spr(i8* %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @pdbg_spr_by_name(i8* %0)
store i32 %5, i32* %2
%6 = icmp eq i32 %5, -1
%7 = select i1 %6, i32* null, i32* %2
br label %8
8: ; preds = %4, %1
%9 = phi i32* [ null, %1 ], [ %7, %4 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_init_proplist() {
  printf("NOT IMPLEMENTED:"
         "pa_init_proplist"
         "\n");
}


x86 assembly (clang, -O0):
<pa_init_proplist>:
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_init_proplist>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_init_proplist\00"
define i32 @pa_init_proplist() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int read(int, char *, int);
int main(int argc, char *argv[]) {
  char buffer[8];
  int fd = 0;
  fd = open("test.txt", O_RDONLY);
  int count = read(fd, buffer, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1030 <read@plt>
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x8,%edx
call   1030 <read@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%9 = load i32, i32* @O_RDONLY
%10 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%13 = call i32 @read(i32 %11, i8* %12, i32 8)
store i32 %13, i32* %8
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @read(i32 %6, i8* %4, i32 8)
ret i32 0
}
void fn_pragma_1(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_pragma_1() {
ret void
}
void rop3_192_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T & S;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_192_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_192_0_1>:
mov    %edx,%eax
and    %sil,%al
not    %sil
and    %dl,%sil
and    (%rdi),%sil
or     %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_192_0_1(i8* %0, i8 zeroext %1, i8 zeroext %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* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = and i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = or i32 %18, %24
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = and i32 %31, %34
%36 = or i32 %25, %35
%37 = trunc i32 %36 to i8
%38 = load i8*, i8** %4
store i8 %37, i8* %38
ret void
}

LLVM IR (-O2):
define void @rop3_192_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %1, -1
%6 = and i8 %5, %2
%7 = load i8, i8* %0
%8 = and i8 %6, %7
%9 = or i8 %8, %4
store i8 %9, i8* %0
ret void
}