xunge/DecIR huggingface dataset:
/* Variables and functions */
int getline(char *, int);
int htoi(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  int len;
  char line[100];
  while ((len = getline(line, 100)) > 0)
    ;
  printf("%s: %d\n", line, htoi(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1161 <main+0x31>
jmp    1142 <main+0x12>
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <htoi@plt>
mov    -0x78(%rbp),%rsi
mov    %eax,%edx
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1140 <main+0x10>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <htoi@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @getline(i8* %2, i32 100)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = call i32 @htoi(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "head"
        " [-n number][file...]\n  -n	Print first number lines on standard "
        "output\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [83 x i8] c"Usage: head [-n number][file...]\0A -n\09Print first number lines on standard output\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [83 x i8] c"Usage: head [-n number][file...]\0A -n\09Print first number lines on standard output\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_hll_sample(int, char **);
int main(int argc, char *argv[]) {
  test_hll_sample(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_hll_sample@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_hll_sample@plt>
xor    %eax,%eax
pop    %rcx
ret

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_hll_sample(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_hll_sample(i32 %0, i8** %1)
ret i32 0
}
int isNaN(float x) { return !(x == x); }


x86 assembly (clang, -O0):
<isNaN>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNaN>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @isNaN(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp oeq float %3, %4
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isNaN(float %0) {
%2 = fcmp uno float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int __ucmpdi2(long long, long long);
int _COM_CMPLE64u(long long a, long long b) { return __ucmpdi2(a, b) != 2; }


x86 assembly (clang, -O0):
<_COM_CMPLE64u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__ucmpdi2@plt>
cmp    $0x2,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CMPLE64u>:
push   %rax
call   1030 <__ucmpdi2@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_COM_CMPLE64u(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 = load i64, i64* %4
%7 = call i32 @__ucmpdi2(i64 %5, i64 %6)
%8 = icmp ne i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_COM_CMPLE64u(i64 %0, i64 %1) {
%3 = tail call i32 @__ucmpdi2(i64 %0, i64 %1)
%4 = icmp ne i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned char ReadMax(int);
unsigned char GetDIP() {
  unsigned char val = ReadMax(2);
  return ~val;
}


x86 assembly (clang, -O0):
<GetDIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <ReadMax@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDIP>:
push   %rax
mov    $0x2,%edi
call   1030 <ReadMax@plt>
not    %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @GetDIP() {
%1 = alloca i8
%2 = call zeroext i8 @ReadMax(i32 2)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = xor i32 %4, -1
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @GetDIP() {
%1 = tail call zeroext i8 @ReadMax(i32 2)
%2 = xor i8 %1, -1
ret i8 %2
}
/* Variables and functions */
int sin(double);
double csc(double x) { return 1 / sin(x); }


x86 assembly (clang, -O0):
<csc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csc>:
push   %rax
call   1030 <sin@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @csc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sin(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @csc(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
int list_equal(void *a, void *b) { return a == b; }


x86 assembly (clang, -O0):
<list_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @list_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @list_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void ath_mci_enable(struct ath_softc *sc) {}


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

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

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

LLVM IR (-O2):
%struct.ath_softc = type opaque
define void @ath_mci_enable(%struct.ath_softc* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GMP_RNDD;
int /*<<< orphan*/ mpfr_set_default_rounding_mode(int /*<<< orphan*/);
double div_lo(double x, double y) {
  double z;
  mpfr_set_default_rounding_mode(GMP_RNDD);
  ;
  z = x / y;
  return (z);
}


x86 assembly (clang, -O0):
<div_lo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_lo>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@GMP_RNDD = global i32 0
define double @div_lo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load i32, i32* @GMP_RNDD
%7 = call i32 @mpfr_set_default_rounding_mode(i32 %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fdiv double %8, %9
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
@GMP_RNDD = global i32 0
define double @div_lo(double %0, double %1) {
%3 = load i32, i32* @GMP_RNDD
%4 = tail call i32 @mpfr_set_default_rounding_mode(i32 %3)
%5 = fdiv double %0, %1
ret double %5
}
void askpass_timeout(int ignore) {}


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

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

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

LLVM IR (-O2):
define void @askpass_timeout(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_htonl();
int /*<<< orphan*/ test_htonll();
int /*<<< orphan*/ test_htons();
int /*<<< orphan*/ test_ntohl();
int /*<<< orphan*/ test_ntohll();
int /*<<< orphan*/ test_ntohs();
int /*<<< orphan*/ test_ntohtonx();
void run_posix_arpa_inet_tests() {
  printf("\nRunning Test Case: %s\n", "Test POSIX arpa/inet.h functions");
  ;
  test_htons();
  test_htonl();
  test_htonll();
  test_ntohs();
  test_ntohl();
  test_ntohll();
  test_ntohtonx();
}


x86 assembly (clang, -O0):
<run_posix_arpa_inet_tests>:
push   %rbp
mov    %rsp,%rbp
lea    0xe75(%rip),%rdi
lea    0xe86(%rip),%rsi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <test_htons@plt>
mov    $0x0,%al
call   1050 <test_htonl@plt>
mov    $0x0,%al
call   1040 <test_htonll@plt>
mov    $0x0,%al
call   1060 <test_ntohs@plt>
mov    $0x0,%al
call   1090 <test_ntohl@plt>
mov    $0x0,%al
call   10a0 <test_ntohll@plt>
mov    $0x0,%al
call   1080 <test_ntohtonx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_posix_arpa_inet_tests>:
push   %rax
lea    0xe78(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1070 <test_htons@plt>
xor    %eax,%eax
call   1050 <test_htonl@plt>
xor    %eax,%eax
call   1040 <test_htonll@plt>
xor    %eax,%eax
call   1060 <test_ntohs@plt>
xor    %eax,%eax
call   1090 <test_ntohl@plt>
xor    %eax,%eax
call   10a0 <test_ntohll@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <test_ntohtonx@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0ARunning Test Case: %s\0A\00"
@.str.1 = [33 x i8] c"Test POSIX arpa/inet.h functions\00"
define void @run_posix_arpa_inet_tests() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @test_htons()
%3 = call i32 (...) @test_htonl()
%4 = call i32 (...) @test_htonll()
%5 = call i32 (...) @test_ntohs()
%6 = call i32 (...) @test_ntohl()
%7 = call i32 (...) @test_ntohll()
%8 = call i32 (...) @test_ntohtonx()
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0ARunning Test Case: %s\0A\00"
@.str.1 = [33 x i8] c"Test POSIX arpa/inet.h functions\00"
define void @run_posix_arpa_inet_tests() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @test_htons()
%3 = tail call i32 (...) @test_htonl()
%4 = tail call i32 (...) @test_htonll()
%5 = tail call i32 (...) @test_ntohs()
%6 = tail call i32 (...) @test_ntohl()
%7 = tail call i32 (...) @test_ntohll()
%8 = tail call i32 (...) @test_ntohtonx()
ret void
}
/* Variables and functions */
int euclidGCD(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("%d\n", euclidGCD(30, 21));
  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)
mov    $0x1e,%edi
mov    $0x15,%esi
call   1040 <euclidGCD@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
mov    $0x15,%esi
call   1040 <euclidGCD@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = call i32 @euclidGCD(i32 30, i32 21)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @euclidGCD(i32 30, i32 21)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ grg_get_ir_grid_map(long *, long ***, long const,
                                       long const *, long const *);
void ksp_get_ir_grgrid_map(long ir_grid_indices[], long (*rotations)[3][3],
                           const long num_rot, const long D_diag[3],
                           const long PS[3]) {
  grg_get_ir_grid_map(ir_grid_indices, rotations, num_rot, D_diag, PS);
}


x86 assembly (clang, -O0):
<ksp_get_ir_grgrid_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <grg_get_ir_grid_map@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksp_get_ir_grgrid_map>:
jmp    1030 <grg_get_ir_grid_map@plt>

LLVM IR (-O0):
define void @ksp_get_ir_grgrid_map(i64* %0, [3 x [3 x i64]]* %1, i64 %2, i64* %3, i64* %4) {
%6 = alloca i64*
%7 = alloca [3 x [3 x i64]]*
%8 = alloca i64
%9 = alloca i64*
%10 = alloca i64*
store i64* %0, i64** %6
store [3 x [3 x i64]]* %1, [3 x [3 x i64]]** %7
store i64 %2, i64* %8
store i64* %3, i64** %9
store i64* %4, i64** %10
%11 = load i64*, i64** %6
%12 = load [3 x [3 x i64]]*, [3 x [3 x i64]]** %7
%13 = bitcast [3 x [3 x i64]]* %12 to i64***
%14 = load i64, i64* %8
%15 = load i64*, i64** %9
%16 = load i64*, i64** %10
%17 = call i32 @grg_get_ir_grid_map(i64* %11, i64*** %13, i64 %14, i64* %15, i64* %16)
ret void
}

LLVM IR (-O2):
define void @ksp_get_ir_grgrid_map(i64* %0, [3 x [3 x i64]]* %1, i64 %2, i64* %3, i64* %4) {
%6 = bitcast [3 x [3 x i64]]* %1 to i64***
%7 = tail call i32 @grg_get_ir_grid_map(i64* %0, i64*** %6, i64 %2, i64* %3, i64* %4)
ret void
}
int enc(int val) {
  val &= 0x3f;
  if (val <= 25)
    return ('A' + val);
  if (val <= 51)
    return ('a' + val - 26);
  if (val <= 61)
    return ('0' + val - 52);
  if (val == 62)
    return '+';
  return '/';
}


x86 assembly (clang, -O0):
<enc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jg     1128 <enc+0x28>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    117b <enc+0x7b>
cmpl   $0x33,-0x8(%rbp)
jg     1143 <enc+0x43>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x1a,%eax
mov    %eax,-0x4(%rbp)
jmp    117b <enc+0x7b>
cmpl   $0x3d,-0x8(%rbp)
jg     115e <enc+0x5e>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
sub    $0x34,%eax
mov    %eax,-0x4(%rbp)
jmp    117b <enc+0x7b>
cmpl   $0x3e,-0x8(%rbp)
jne    1174 <enc+0x74>
movl   $0x2b,-0x4(%rbp)
jmp    117b <enc+0x7b>
movl   $0x2f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc>:
mov    %edi,%eax
and    $0x3f,%eax
cmp    $0x19,%eax
ja     110e <enc+0xe>
add    $0x41,%eax
ret
cmp    $0x33,%eax
ja     1117 <enc+0x17>
add    $0x47,%eax
ret
cmp    $0x3d,%eax
ja     1120 <enc+0x20>
add    $0xfffffffc,%eax
ret
xor    %ecx,%ecx
cmp    $0x3e,%eax
setne  %cl
lea    0x2b(,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @enc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 63
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 25
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 65, %9
store i32 %10, i32* %2
br label %30
11: ; preds = %1
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 51
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 97, %15
%17 = sub nsw i32 %16, 26
store i32 %17, i32* %2
br label %30
18: ; preds = %11
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 61
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %3
%23 = add nsw i32 48, %22
%24 = sub nsw i32 %23, 52
store i32 %24, i32* %2
br label %30
25: ; preds = %18
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 62
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 43, i32* %2
br label %30
29: ; preds = %25
store i32 47, i32* %2
br label %30
30: ; preds = %29, %28, %21, %14, %8
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @enc(i32 %0) {
%2 = and i32 %0, 63
%3 = icmp ult i32 %2, 26
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nuw nsw i32 %2, 65
br label %17
6: ; preds = %1
%7 = icmp ult i32 %2, 52
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = add nuw nsw i32 %2, 71
br label %17
10: ; preds = %6
%11 = icmp ult i32 %2, 62
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = add nsw i32 %2, -4
br label %17
14: ; preds = %10
%15 = icmp eq i32 %2, 62
%16 = select i1 %15, i32 43, i32 47
br label %17
17: ; preds = %14, %12, %8, %4
%18 = phi i32 [ %5, %4 ], [ %9, %8 ], [ %13, %12 ], [ %16, %14 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ write(int, void *, size_t);
void write_to_socket(void *fp, void *mem, size_t s) {
  write(*(int *)fp, mem, s);
}


x86 assembly (clang, -O0):
<write_to_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_socket>:
mov    (%rdi),%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @write_to_socket(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @write(i32 %9, i8* %10, i64 %11)
ret void
}

LLVM IR (-O2):
define void @write_to_socket(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @write(i32 %5, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ git_open_clear();
int /*<<< orphan*/ git_open_filter();
int /*<<< orphan*/ git_open_load();
void git_open_reload(void) {
  git_open_clear();
  git_open_load();
  git_open_filter();
}


x86 assembly (clang, -O0):
<git_open_reload>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <git_open_clear@plt>
mov    $0x0,%al
call   1040 <git_open_load@plt>
mov    $0x0,%al
call   1030 <git_open_filter@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_open_reload>:
push   %rax
xor    %eax,%eax
call   1050 <git_open_clear@plt>
xor    %eax,%eax
call   1040 <git_open_load@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <git_open_filter@plt>

LLVM IR (-O0):
define void @git_open_reload() {
%1 = call i32 (...) @git_open_clear()
%2 = call i32 (...) @git_open_load()
%3 = call i32 (...) @git_open_filter()
ret void
}

LLVM IR (-O2):
define void @git_open_reload() {
%1 = tail call i32 (...) @git_open_clear()
%2 = tail call i32 (...) @git_open_load()
%3 = tail call i32 (...) @git_open_filter()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ *__errno_location();
sem_t *sem_open(const char *name, int oflag, ...) {
  (void)name;
  (void)oflag;
  (*__errno_location()) = ENOSYS;
  return 0;
}


x86 assembly (clang, -O0):
<sem_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
call   1030 <__errno_location@plt>
mov    -0x14(%rbp),%edx
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
mov    %edx,(%rcx)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_open>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <__errno_location@plt>
mov    %ebx,(%rax)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32* @sem_open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @ENOSYS
%8 = call i32* (...) @__errno_location()
store i32 %7, i32* %8
ret i32* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define noalias i32* @sem_open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32* (...) @__errno_location()
store i32 %3, i32* %4
ret i32* null
}
void gtSetCSVFilenameHook(const char *(*pfnNewHook)(const char *)) {}


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

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

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

LLVM IR (-O2):
define void @gtSetCSVFilenameHook(i8* (i8*)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  void *p;
  printf("Hello, world!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int func(void) {
  int n = 3;
  int m = 5;
  n = (m++);
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
store i32 %3, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
int path_028_expected_2(int y) {
  int x;
  for (x = 0; x < y; x++)
    ;
  return x;
}


x86 assembly (clang, -O0):
<path_028_expected_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <path_028_expected_2+0x2d>
jmp    111f <path_028_expected_2+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <path_028_expected_2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_028_expected_2>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @path_028_expected_2(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}
int test_05(short *x, unsigned char y) { return *x & y ? -40 : 60; }


x86 assembly (clang, -O0):
<test_05>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
movzbl -0x9(%rbp),%eax
and    %eax,%edx
mov    $0x3c,%eax
mov    $0xffffffd8,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_05>:
movzwl (%rdi),%eax
test   %esi,%eax
mov    $0x3c,%ecx
mov    $0xffffffd8,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_05(i16* %0, i8 zeroext %1) {
%3 = alloca i16*
%4 = alloca i8
store i16* %0, i16** %3
store i8 %1, i8* %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -40, i32 60
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_05(i16* nocapture %0, i8 zeroext %1) {
%3 = load i16, i16* %0
%4 = zext i16 %3 to i32
%5 = zext i8 %1 to i32
%6 = and i32 %4, %5
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 60, i32 -40
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *);
float *vector(long nl, long nh) {
  float *v;
  v = (float *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(float)));
  if (!v)
    printf("allocation failure in vector");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <vector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <vector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"allocation failure in vector\00"
define float* @vector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to float*
store float* %13, float** %5
%14 = load float*, float** %5
%15 = icmp ne float* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load float*, float** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds float, float* %19, i64 %21
%23 = getelementptr inbounds float, float* %22, i64 1
ret float* %23
}

LLVM IR (-O2):
@.str = [29 x i8] c"allocation failure in vector\00"
define float* @vector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to float*
%12 = sub i64 0, %0
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = getelementptr inbounds float, float* %13, i64 1
ret float* %14
}
int abs(int x) {
  int sign = x >> 31;
  return (x ^ sign) + (1 && sign);
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmpl   $0x0,-0x8(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
shr    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
%4 = lshr i32 %0, 31
%5 = add nsw i32 %3, %4
ret i32 %5
}
long syscall6(long nr, long a1, long a2, long a3, long a4, long a5, long a6) {
  register long r0 asm("rax") = nr;
  register long r1 asm("rdi") = a1;
  register long r2 asm("rsi") = a2;
  register long r3 asm("rdx") = a3;
  register long r4 asm("r10") = a4;
  register long r5 asm("r8") = a5;
  register long r6 asm("r9") = a6;
  asm volatile("syscall"
               : "=r"(r0)
               : "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5), "r"(r6)
               : "rcx", "r11", "memory");
  return r0;
}


x86 assembly (clang, -O0):
<syscall6>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%r10
mov    -0x60(%rbp),%r8
mov    -0x68(%rbp),%r9
syscall
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall6>:
mov    %r9,%r11
mov    %rdi,%rax
mov    0x8(%rsp),%r9
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
mov    %r11,%r8
syscall
ret

LLVM IR (-O0):
define i64 @syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%22 = load i64, i64* %8
store i64 %22, i64* %15
%23 = load i64, i64* %9
store i64 %23, i64* %16
%24 = load i64, i64* %10
store i64 %24, i64* %17
%25 = load i64, i64* %11
store i64 %25, i64* %18
%26 = load i64, i64* %12
store i64 %26, i64* %19
%27 = load i64, i64* %13
store i64 %27, i64* %20
%28 = load i64, i64* %14
store i64 %28, i64* %21
%29 = load i64, i64* %15
%30 = load i64, i64* %16
%31 = load i64, i64* %17
%32 = load i64, i64* %18
%33 = load i64, i64* %19
%34 = load i64, i64* %20
%35 = load i64, i64* %21
%36 = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},{r8},{r9},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %29, i64 %30, i64 %31, i64 %32, i64 %33, i64 %34, i64 %35)
store i64 %36, i64* %15
%37 = load i64, i64* %15
ret i64 %37
}

LLVM IR (-O2):
define i64 @syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},{r8},{r9},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ script_write_byte(int);
void script_wait_sensor(int packet_id) {
  script_write_byte(158);
  script_write_byte(((packet_id & 0xFFFF) >> 8));
  script_write_byte((packet_id & 0xFF));
}


x86 assembly (clang, -O0):
<script_wait_sensor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x9e,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_wait_sensor>:
push   %rbx
mov    %edi,%ebx
mov    $0x9e,%edi
call   1030 <script_write_byte@plt>
movzbl %bh,%edi
call   1030 <script_write_byte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <script_write_byte@plt>

LLVM IR (-O0):
define void @script_wait_sensor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @script_write_byte(i32 158)
%4 = load i32, i32* %2
%5 = and i32 %4, 65535
%6 = ashr i32 %5, 8
%7 = call i32 @script_write_byte(i32 %6)
%8 = load i32, i32* %2
%9 = and i32 %8, 255
%10 = call i32 @script_write_byte(i32 %9)
ret void
}

LLVM IR (-O2):
define void @script_wait_sensor(i32 %0) {
%2 = tail call i32 @script_write_byte(i32 158)
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = tail call i32 @script_write_byte(i32 %4)
%6 = and i32 %0, 255
%7 = tail call i32 @script_write_byte(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kmalloc(size_t);
void *memset(int /*<<< orphan*/, int /*<<< orphan*/, size_t);
void *kcalloc(size_t size) { return memset(kmalloc(size), 0, size); }


x86 assembly (clang, -O0):
<kcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <kmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <kmalloc@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @kcalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @kmalloc(i64 %3)
%5 = load i64, i64* %2
%6 = call i8* @memset(i32 %4, i32 0, i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @kcalloc(i64 %0) {
%2 = tail call i32 @kmalloc(i64 %0)
%3 = tail call i8* @memset(i32 %2, i32 0, i64 %0)
ret i8* %3
}
/* Variables and functions */
double __infer_nondet_double();
double log2(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
unsigned int _uiCommRecvData(unsigned int uiCommType, unsigned char *psRecvData,
                             unsigned int *piRecvLen, unsigned int uiTimeout) {
  return (0x0313);
}


x86 assembly (clang, -O0):
<_uiCommRecvData>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x313,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_uiCommRecvData(i32 %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
ret i32 787
}

LLVM IR (-O2):
define i32 @_uiCommRecvData(i32 %0, i8* nocapture readnone %1, i32* nocapture readnone %2, i32 %3) {
ret i32 787
}
/* Variables and functions */
int /*<<< orphan*/ cos(double);
double log(int /*<<< orphan*/);
int /*<<< orphan*/ track_stats(void *);
double ln_cos_x(double x, void *params) {
  track_stats(params);
  return log(cos(x));
}


x86 assembly (clang, -O0):
<ln_cos_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <track_stats@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,%edi
call   1050 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_cos_x>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <track_stats@plt>
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <log@plt>

LLVM IR (-O0):
define double @ln_cos_x(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @track_stats(i8* %5)
%7 = load double, double* %3
%8 = call i32 @cos(double %7)
%9 = call double @log(i32 %8)
ret double %9
}

LLVM IR (-O2):
define double @ln_cos_x(double %0, i8* %1) {
%3 = tail call i32 @track_stats(i8* %1)
%4 = tail call i32 @cos(double %0)
%5 = tail call double @log(i32 %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *open_file(char *name) {
  FILE *file = fopen(name, "a");
  if (file == NULL) {
    perror("[fatal]: impossible to open file");
    exit(EXIT_FAILURE);
  }
  return file;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <open_file+0x45>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rax
lea    0xec8(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1144 <open_file+0x14>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [33 x i8] c"[fatal]: impossible to open file\00"
@EXIT_FAILURE = global i32 0
define i32* @open_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [33 x i8] c"[fatal]: impossible to open file\00"
@EXIT_FAILURE = global i32 0
define noalias i32* @open_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double *);
void f() {
  double farray[512];
  printf(" farray = %p\n", farray);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1000,%rsp
lea    -0x1000(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x1000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x1008,%rsp
lea    0xee2(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
add    $0x1008,%rsp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c" farray = %p\0A\00"
define void @f() {
%1 = alloca [512 x double]
%2 = bitcast [512 x double]* %1 to i8*
%3 = getelementptr inbounds [512 x double], [512 x double]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double* %3)
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
char *strupr(char *s) {
  int len, i;
  len = strlen(s);
  for (i = 0; i < len; i++)
    s[i] = toupper(s[i]);
  return s;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <strupr+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <strupr+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <strupr+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <strupr+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("I iz an exprimental speling error!\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"I iz an exprimental speling error!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"I iz an exprimental speling error!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}