xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ creerDossierNecessaireSauvegardeNiveau();
scalar_t__ estNouvellePartie();
int /*<<< orphan*/ sauvegarderInventaire();
int /*<<< orphan*/ sauvegarderPersonnage();
int /*<<< orphan*/ sauvegarderPositionJoueurNiveau();
int /*<<< orphan*/ sauvegarderSalleNiveau();
void sauvegarderNiveauActuel(void) {
  if (estNouvellePartie())
    creerDossierNecessaireSauvegardeNiveau();
  sauvegarderSalleNiveau();
  sauvegarderPositionJoueurNiveau();
  sauvegarderPersonnage();
  sauvegarderInventaire();
}


x86 assembly (clang, -O0):
<sauvegarderNiveauActuel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <estNouvellePartie@plt>
cmp    $0x0,%rax
je     117c <sauvegarderNiveauActuel+0x1c>
mov    $0x0,%al
call   1030 <creerDossierNecessaireSauvegardeNiveau@plt>
mov    $0x0,%al
call   1050 <sauvegarderSalleNiveau@plt>
mov    $0x0,%al
call   1080 <sauvegarderPositionJoueurNiveau@plt>
mov    $0x0,%al
call   1070 <sauvegarderPersonnage@plt>
mov    $0x0,%al
call   1060 <sauvegarderInventaire@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sauvegarderNiveauActuel>:
push   %rax
xor    %eax,%eax
call   1040 <estNouvellePartie@plt>
test   %rax,%rax
je     1174 <sauvegarderNiveauActuel+0x14>
xor    %eax,%eax
call   1030 <creerDossierNecessaireSauvegardeNiveau@plt>
xor    %eax,%eax
call   1050 <sauvegarderSalleNiveau@plt>
xor    %eax,%eax
call   1080 <sauvegarderPositionJoueurNiveau@plt>
xor    %eax,%eax
call   1070 <sauvegarderPersonnage@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <sauvegarderInventaire@plt>

LLVM IR (-O0):
define void @sauvegarderNiveauActuel() {
%1 = call i64 (...) @estNouvellePartie()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @creerDossierNecessaireSauvegardeNiveau()
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @sauvegarderSalleNiveau()
%7 = call i32 (...) @sauvegarderPositionJoueurNiveau()
%8 = call i32 (...) @sauvegarderPersonnage()
%9 = call i32 (...) @sauvegarderInventaire()
ret void
}

LLVM IR (-O2):
define void @sauvegarderNiveauActuel() {
%1 = tail call i64 (...) @estNouvellePartie()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @creerDossierNecessaireSauvegardeNiveau()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @sauvegarderSalleNiveau()
%7 = tail call i32 (...) @sauvegarderPositionJoueurNiveau()
%8 = tail call i32 (...) @sauvegarderPersonnage()
%9 = tail call i32 (...) @sauvegarderInventaire()
ret void
}
/* Variables and functions */
bool is_category_Cs(unsigned int ch) { return (ch >= 0xd800 && ch < 0xe000); }


x86 assembly (clang, -O0):
<is_category_Cs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xd800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1126 <is_category_Cs+0x26>
cmpl   $0xe000,-0x4(%rbp)
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_category_Cs>:
and    $0xfffff800,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_category_Cs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 55296
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, 57344
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_category_Cs(i32 %0) {
%2 = and i32 %0, -2048
%3 = icmp eq i32 %2, 55296
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glXWaitGL(int /*<<< orphan*/ *);
void glXWaitGL() {
  { mock_push(pack_glXWaitGL(NULL)); };
}


x86 assembly (clang, -O0):
<glXWaitGL>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pack_glXWaitGL@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glXWaitGL>:
push   %rax
xor    %edi,%edi
call   1040 <pack_glXWaitGL@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <mock_push@plt>

LLVM IR (-O0):
define void @glXWaitGL() {
%1 = call i32 @pack_glXWaitGL(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @glXWaitGL() {
%1 = tail call i32 @pack_glXWaitGL(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Eternal Passsion,\vEternal Pain.\vBy- Mathew Arnold.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%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 = [51 x i8] c"Eternal Passsion,\0BEternal Pain.\0BBy- Mathew Arnold.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Eternal Passsion,\0BEternal Pain.\0BBy- Mathew Arnold.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
void *getpwnam() {
  errno = ENOSYS;
  return 0;
}


x86 assembly (clang, -O0):
<getpwnam>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwnam>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @getpwnam() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @getpwnam() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}
/* Variables and functions */
double ceiling(double);
double floor(double d) {
  if (d >= 0)
    return (double)(int)d;
  else
    return -ceiling(-d);
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1142 <floor+0x32>
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117f <floor+0x6f>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <ceiling@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1135 <floor+0x25>
push   %rax
xorpd  0xedd(%rip),%xmm0
call   1030 <ceiling@plt>
xorpd  0xed0(%rip),%xmm0
add    $0x8,%rsp
ret
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fptosi double %7 to i32
%9 = sitofp i32 %8 to double
store double %9, double* %2
br label %15
10: ; preds = %1
%11 = load double, double* %3
%12 = fneg double %11
%13 = call double @ceiling(double %12)
%14 = fneg double %13
store double %14, double* %2
br label %15
15: ; preds = %10, %6
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fptosi double %0 to i32
%5 = sitofp i32 %4 to double
br label %10
6: ; preds = %1
%7 = fneg double %0
%8 = tail call double @ceiling(double %7)
%9 = fneg double %8
br label %10
10: ; preds = %6, %3
%11 = phi double [ %5, %3 ], [ %9, %6 ]
ret double %11
}
/* Variables and functions */
double randmtzig_gv_randn();
double norm_rand(void) { return randmtzig_gv_randn(); }


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

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

LLVM IR (-O0):
define double @norm_rand() {
%1 = call double (...) @randmtzig_gv_randn()
ret double %1
}

LLVM IR (-O2):
define double @norm_rand() {
%1 = tail call double (...) @randmtzig_gv_randn()
ret double %1
}
int search(int arr[], int strt, int end, char value) {
  int i;
  for (i = strt; i <= end; i++) {
    if (arr[i] == value)
      return i;
  }
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     115a <search+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <search+0x47>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <search+0x5a>
jmp    114c <search+0x4c>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1119 <search+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %esi,%eax
cmp    %edx,%esi
jg     1131 <search+0x31>
movsbl %cl,%ecx
movslq %eax,%rsi
add    $0x1,%edx
lea    (%rdi,%rsi,4),%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %ecx,(%rsi)
je     1131 <search+0x31>
add    $0x1,%eax
add    $0x4,%rsi
cmp    %eax,%edx
jne    1120 <search+0x20>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2, i8 signext %3) {
%5 = icmp sgt i32 %1, %2
br i1 %5, label %21, label %6
6: ; preds = %4
%7 = sext i8 %3 to i32
%8 = sext i32 %1 to i64
%9 = add i32 %2, 1
br label %10
10: ; preds = %6, %15
%11 = phi i64 [ %8, %6 ], [ %16, %15 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, %7
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = add nsw i64 %11, 1
%17 = trunc i64 %16 to i32
%18 = icmp eq i32 %9, %17
br i1 %18, label %21, label %10
19: ; preds = %10
%20 = trunc i64 %11 to i32
br label %21
21: ; preds = %15, %19, %4
%22 = phi i32 [ %1, %4 ], [ %20, %19 ], [ %9, %15 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ SYS_socket;
int syscall(int /*<<< orphan*/, int, int, int);
int xsocket(int domain, int type, int protocol) {
  return syscall((SYS_socket), domain, type, protocol);
}


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

x86 assembly (clang, -O2):
<xsocket>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_socket = global i32 0
define i32 @xsocket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @SYS_socket
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@SYS_socket = global i32 0
define i32 @xsocket(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SYS_socket
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
int my_len(char *str) {
  int i = 0;
  while (str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int test_imm_B9uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xb9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B9uint64_midword_mem>:
testb  $0xb9,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B9uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12124160
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIBaseValid(scalar_t__ volatile);
void SSIDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ASSERT(_SSIBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000024))) |= ui32DMAFlags;
}


x86 assembly (clang, -O0):
<SSIDMAEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x24(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDMAEnable>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
or     %rax,0x24(%rcx)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @SSIDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = call i32 @_SSIBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = load volatile i64, i64* %3
%10 = add nsw i64 %9, 36
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @SSIDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = tail call i32 @_SSIBaseValid(i64 %5)
%7 = tail call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = load volatile i64, i64* %3
%10 = add nsw i64 %9, 36
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 1;
  assert(0 < a);
  assert(1 <= a);
  assert(0 != a);
  assert(1 == a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 0, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = icmp sle i32 1, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = icmp ne i32 0, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %2
%16 = icmp eq i32 1, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
void handle_PROF(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_PROF(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int myvariable;
  scanf("%d", &myvariable);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
void mem_leak() {
  int *i = (int *)malloc(sizeof(int));
  double *j = (double *)malloc(sizeof(double));
  i = NULL;
}


x86 assembly (clang, -O0):
<mem_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_leak>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    $0x8,%edi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @mem_leak() {
%1 = alloca i32*
%2 = alloca double*
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %1
%5 = call i64 @malloc(i32 8)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %2
store i32* null, i32** %1
ret void
}

LLVM IR (-O2):
define void @mem_leak() {
%1 = tail call i64 @malloc(i32 4)
%2 = tail call i64 @malloc(i32 8)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d\n", (getchar() != EOF)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int stime(const time_t *when) {
  if (when == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<stime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <stime+0x31>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <stime+0x46>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stime>:
push   %rax
test   %rdi,%rdi
jne    111f <stime+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <stime+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @stime(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = load i32, i32* @EINVAL
%4 = load i32, i32* @ENOSYS
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
void vec3_add2(double *v1, const double *v2) {
  v1[0] += v2[0];
  v1[1] += v2[1];
  v1[2] += v2[2];
}


x86 assembly (clang, -O0):
<vec3_add2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_add2>:
movsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @vec3_add2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fadd double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fadd double %17, %14
store double %18, double* %16
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fadd double %24, %21
store double %25, double* %23
ret void
}

LLVM IR (-O2):
define void @vec3_add2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fadd double %3, %4
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fadd double %7, %9
store double %10, double* %8
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fadd double %12, %14
store double %15, double* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_debug_load() { printf("Sorry, can't load now\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Sorry, can't load now\0A\00"
define void @do_debug_load() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Sorry, can't load now\00"
define void @do_debug_load() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((__weak__, __always___)) char *
softboundcets___strdup(const char *s) {
  void *ret_ptr = strdup(s);
  __softboundcets_strdup_handler(ret_ptr);
  return ret_ptr;
}


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

x86 assembly (clang, -O2):
<softboundcets___strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %eax,%eax
call   1030 <__softboundcets_strdup_handler@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundcets___strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @__softboundcets_strdup_handler to i32 (i8*, ...)*)(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define weak i8* @softboundcets___strdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @__softboundcets_strdup_handler to i32 (i8*, ...)*)(i8* %2)
ret i8* %2
}
int num(char *stream, long offset) {
  char c = stream[offset];
  return ('0' <= c && c <= '9');
}


x86 assembly (clang, -O0):
<num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x12(%rbp)
jg     113d <num+0x3d>
movsbl -0x11(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num>:
mov    (%rdi,%rsi,1),%cl
add    $0xd0,%cl
xor    %eax,%eax
cmp    $0xa,%cl
setb   %al
ret

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

LLVM IR (-O2):
define i32 @num(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned short int net2short(unsigned char **bufp) {
  unsigned short int i;
  i = **bufp;
  i <<= 8;
  i |= *(*bufp + 1);
  *bufp += 2;
  return i;
}


x86 assembly (clang, -O0):
<net2short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x1(%rax),%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<net2short>:
mov    (%rdi),%rcx
movzwl (%rcx),%eax
rol    $0x8,%ax
add    $0x2,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i16 @net2short(i8** %0) {
%2 = alloca i8**
%3 = alloca i16
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
store i16 %7, i16* %3
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = trunc i32 %10 to i16
store i16 %11, i16* %3
%12 = load i8**, i8*** %2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = or i32 %18, %16
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8* %23, i8** %21
%24 = load i16, i16* %3
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @net2short(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
%10 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %10, i8** %0
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void print_indentation(int level) {
  static char const indentation[] = "  ";
  for (int i = 0; i != level; ++i) {
    printf(indentation);
  }
}


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

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

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

LLVM IR (-O2):
@print_indentation.indentation = internal constant [3 x i8] c" \00"
define void @print_indentation(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @print_indentation.indentation, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "Hello world!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int pipe_close(void *ptr) {
  free(ptr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pipe_close(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x3b() {
  Assert_real((ispunct(59)),
              "/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_ispunct.c",
              300, ("ispunct should be 1 for ;"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x3b>:
push   %rax
mov    $0x3b,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x12c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ;\00"
define void @t_ispunct_0x3b() {
%1 = call i32 @ispunct(i32 59)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ;\00"
define void @t_ispunct_0x3b() {
%1 = tail call i32 @ispunct(i32 59)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_nullify_pointer() {}


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

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

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

LLVM IR (-O2):
define void @g_nullify_pointer() {
ret void
}
const int calclen_l1a(unsigned int i) {
  int j, l = 0;
  if (i == 1)
    return 1;
  j = 31;
  while ((i & 0x80000000) == 0) {
    i <<= 1;
    j--;
  }
  do {
    i <<= 1;
    l += 2;
  } while (--j);
  return l + 1;
}


x86 assembly (clang, -O0):
<calclen_l1a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1124 <calclen_l1a+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1185 <calclen_l1a+0x85>
movl   $0x1f,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
jne    1153 <calclen_l1a+0x53>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <calclen_l1a+0x2b>
jmp    1158 <calclen_l1a+0x58>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    1158 <calclen_l1a+0x58>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calclen_l1a>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <calclen_l1a+0xb>
ret
mov    $0x3f,%eax
test   %edi,%edi
js     110a <calclen_l1a+0xa>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %edi,%edi
add    $0xfffffffe,%eax
test   %edi,%edi
jns    1120 <calclen_l1a+0x20>
jmp    110a <calclen_l1a+0xa>

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

LLVM IR (-O2):
define i32 @calclen_l1a(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, -1
br i1 %4, label %8, label %14
5: ; preds = %8
%6 = shl i32 %12, 1
%7 = or i32 %6, 1
br label %14
8: ; preds = %3, %8
%9 = phi i32 [ %12, %8 ], [ 31, %3 ]
%10 = phi i32 [ %11, %8 ], [ %0, %3 ]
%11 = shl nuw i32 %10, 1
%12 = add nsw i32 %9, -1
%13 = icmp sgt i32 %11, -1
br i1 %13, label %8, label %5
14: ; preds = %3, %5, %1
%15 = phi i32 [ 1, %1 ], [ 63, %3 ], [ %7, %5 ]
ret i32 %15
}
int QRinput_estimateBitsModeAn(int size) {
  int w;
  int bits;
  w = size / 2;
  bits = w * 11;
  if (size & 1) {
    bits += 6;
  }
  return bits;
}


x86 assembly (clang, -O0):
<QRinput_estimateBitsModeAn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
imul   $0xb,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <QRinput_estimateBitsModeAn+0x34>
mov    -0xc(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QRinput_estimateBitsModeAn>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,2),%edx
test   $0x1,%dil
lea    0x6(%rax,%rcx,2),%eax
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @QRinput_estimateBitsModeAn(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = mul nsw i32 %2, 11
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %3, 6
%7 = select i1 %5, i32 %3, i32 %6
ret i32 %7
}
float c_vector3_dot_product(const float *a, const float *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<c_vector3_dot_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_vector3_dot_product>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @c_vector3_dot_product(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @c_vector3_dot_product(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
float truncf(float);
float intr_wrap_327(float p1) { return truncf(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_327>:
jmp    1030 <truncf@plt>

LLVM IR (-O0):
define float @intr_wrap_327(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.trunc.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @intr_wrap_327(float %0) {
%2 = tail call float @llvm.trunc.f32(float %0)
ret float %2
}
/* Variables and functions */
char *strpbrk(const char *str1, const char *str2) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strpbrk(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
char *strstr(char *, char *);
char *match_simple(char *base, char *s, char *token, int tokenlen) {
  return strstr(s, token);
}


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

x86 assembly (clang, -O2):
<match_simple>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i8* @match_simple(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i8* @strstr(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @match_simple(i8* nocapture readnone %0, i8* %1, i8* nocapture %2, i32 %3) {
%5 = tail call i8* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) %2)
ret i8* %5
}