xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__6__IrqSignal__fired();
void HplAtm128InterruptSigP__IntSig6__fired(void) {
  HplAtm128InterruptPinP__6__IrqSignal__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128InterruptSigP__IntSig6__fired() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__6__IrqSignal__fired()
ret void
}
double nextP(double p) { return 2 * p; }


x86 assembly (clang, -O0):
<nextP>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextP>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @nextP(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 2.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @nextP(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mpf_t;

/* Variables and functions */
int /*<<< orphan*/ fp_cache_put(char *, int /*<<< orphan*/, unsigned int, int);
int /*<<< orphan*/ mpf_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_sub_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
void fp_zeta_file_cache_put(mpf_t zeta, unsigned int s, int prec) {
  mpf_t zm1;
  mpf_init(zm1);
  mpf_sub_ui(zm1, zeta, 1);
  fp_cache_put("db-zeta.db", zm1, s, prec);
  mpf_clear(zm1);
}


x86 assembly (clang, -O0):
<fp_zeta_file_cache_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <mpf_init@plt>
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1030 <mpf_sub_ui@plt>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe87(%rip),%rdi
call   1060 <fp_cache_put@plt>
mov    -0x10(%rbp),%edi
call   1050 <mpf_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_zeta_file_cache_put>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <mpf_init@plt>
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <mpf_sub_ui@plt>
lea    0xe9d(%rip),%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1060 <fp_cache_put@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <mpf_clear@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"db-zeta.db\00"
define void @fp_zeta_file_cache_put(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %7
%9 = call i32 @mpf_init(i32 %8)
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = call i32 @mpf_sub_ui(i32 %10, i32 %11, i32 1)
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @fp_cache_put(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %7
%18 = call i32 @mpf_clear(i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"db-zeta.db\00"
define void @fp_zeta_file_cache_put(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpf_init(i32 undef)
%5 = tail call i32 @mpf_sub_ui(i32 undef, i32 %0, i32 1)
%6 = tail call i32 @fp_cache_put(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 undef, i32 %1, i32 %2)
%7 = tail call i32 @mpf_clear(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ scanf(char *);
void vider_stdin(void) {
  scanf("%*[^\n]");
  (void)getchar();
}


x86 assembly (clang, -O0):
<vider_stdin>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vider_stdin>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%*[^\0A]\00"
define void @vider_stdin() {
%1 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%*[^\0A]\00"
define void @vider_stdin() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
double pwmin(double x, double y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<pwmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <pwmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <pwmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pwmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @pwmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
struct dirent {
  scalar_t__ d_type;
};

/* Variables and functions */
scalar_t__ DT_DIR;
int no_directories(const struct dirent *entry) {
  int pass;
  if (entry->d_type != DT_DIR) {
    pass = 1;
  } else {
    pass = 0;
  }
  return pass;
}


x86 assembly (clang, -O0):
<no_directories>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eca(%rip),%rcx
cmp    (%rcx),%rax
je     112b <no_directories+0x2b>
movl   $0x1,-0xc(%rbp)
jmp    1132 <no_directories+0x32>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_directories>:
mov    (%rdi),%rcx
mov    0x2ed6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
ret

LLVM IR (-O0):
%struct.dirent = type { i64 }
@DT_DIR = global i64 0
define i32 @no_directories(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
%3 = alloca i32
store %struct.dirent* %0, %struct.dirent** %2
%4 = load %struct.dirent*, %struct.dirent** %2
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @DT_DIR
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %3
br label %11
10: ; preds = %1
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.dirent = type { i64 }
@DT_DIR = global i64 0
define i32 @no_directories(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @DT_DIR
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned find_in_block(const unsigned a[], unsigned len, unsigned elt) {
  unsigned i;
  for (i = 0; i < len; i++)
    if (!(a[i] < elt))
      break;
  return i;
}


x86 assembly (clang, -O0):
<find_in_block>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    114c <find_in_block+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jb     1139 <find_in_block+0x39>
jmp    114c <find_in_block+0x4c>
jmp    113e <find_in_block+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <find_in_block+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_in_block>:
test   %esi,%esi
je     1121 <find_in_block+0x21>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rax,4)
jae    1120 <find_in_block+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <find_in_block+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @find_in_block(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp ult i32 %10, %2
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdout;
void myPause(int posx, int posy) {
  printf(
      "\nYou are in room [%d,%d]of the CAVE.\nThe computer can either shoot, "
      "turn or move.\nPress[Enter] To have the computer execute it next Move\n",
      posx + 1, posy + 1);
  fflush(stdout);
  getchar();
}


x86 assembly (clang, -O0):
<myPause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myPause>:
push   %rax
lea    0x1(%rdi),%eax
lea    0x1(%rsi),%edx
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"\0AYou are in room [%d,%d]of the CAVE.\0AThe computer can either shoot, turn or move.\0APress[Enter] To have the computer execute it next Move\0A\00"
@stdout = global i32 0
define void @myPause(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
%12 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"\0AYou are in room [%d,%d]of the CAVE.\0AThe computer can either shoot, turn or move.\0APress[Enter] To have the computer execute it next Move\0A\00"
@stdout = global i32 0
define void @myPause(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = add nsw i32 %1, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0, b = 0;
  assert((0 ? (a = 23) : (b = 34)) == 34);
  assert(a == 0);
  assert(b == 34);
  assert((1 ? (a = 23) : (b = 56)) == 23);
  assert(a == 23);
  assert(b == 34);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x22,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x22,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x17,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
cmpl   $0x17,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x22,-0xc(%rbp)
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>
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
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 34, i32* %3
%4 = call i32 @assert(i32 1)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 34
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
store i32 23, i32* %2
%13 = call i32 @assert(i32 1)
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 23
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 34
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
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)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
ret i32 0
}
void I2CEndOfInterrupt(unsigned int baseAdd, unsigned int flag) {
  (*((volatile unsigned int *)(baseAdd + (0x20)))) = flag;
}


x86 assembly (clang, -O0):
<I2CEndOfInterrupt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CEndOfInterrupt>:
add    $0x20,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CEndOfInterrupt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 32
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @I2CEndOfInterrupt(i32 %0, i32 %1) {
%3 = add i32 %0, 32
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
double fabs(double);
void test_real96() {
  long double x = 1 / 3;
  long double y = 2 / 3;
  assertTrue("fabs((2.0*x) - y) < 0.00001", fabs((2.0 * x) - y) < 0.00001);
  ;
}


x86 assembly (clang, -O0):
<test_real96>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldz
fld    %st(0)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fadd   %st,%st(0)
fsubp  %st,%st(1)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movaps 0xed3(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xec4(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_real96>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"fabs((2.0*x) - y) < 0.00001\00"
define void @test_real96() {
%1 = alloca x86_fp80
%2 = alloca x86_fp80
store x86_fp80 0xK00000000000000000000, x86_fp80* %1
store x86_fp80 0xK00000000000000000000, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %1
%4 = load x86_fp80, x86_fp80* %2
%5 = fneg x86_fp80 %4
%6 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK40008000000000000000, x86_fp80 %3, x86_fp80 %5)
%7 = fptrunc x86_fp80 %6 to double
%8 = call double @llvm.fabs.f64(double %7)
%9 = fcmp olt double %8, 1.000000e-05
%10 = zext i1 %9 to i32
%11 = call i32 @assertTrue(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"fabs((2.0*x) - y) < 0.00001\00"
define void @test_real96() {
%1 = tail call i32 @assertTrue(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
int main() {
  int a = 7;
  int b = 3;
  return a + b;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ api_putchar(char);
void HariMain(void) {
  api_putchar('H');
  api_putchar('e');
  api_putchar('l');
  api_putchar('l');
  api_putchar('o');
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1030 <api_putchar@plt>
mov    $0x65,%edi
call   1030 <api_putchar@plt>
mov    $0x6c,%edi
call   1030 <api_putchar@plt>
mov    $0x6c,%edi
call   1030 <api_putchar@plt>
mov    $0x6f,%edi
call   1030 <api_putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
mov    $0x48,%edi
call   1030 <api_putchar@plt>
mov    $0x65,%edi
call   1030 <api_putchar@plt>
mov    $0x6c,%edi
call   1030 <api_putchar@plt>
mov    $0x6c,%edi
call   1030 <api_putchar@plt>
mov    $0x6f,%edi
pop    %rax
jmp    1030 <api_putchar@plt>

LLVM IR (-O0):
define void @HariMain() {
%1 = call i32 @api_putchar(i8 signext 72)
%2 = call i32 @api_putchar(i8 signext 101)
%3 = call i32 @api_putchar(i8 signext 108)
%4 = call i32 @api_putchar(i8 signext 108)
%5 = call i32 @api_putchar(i8 signext 111)
ret void
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 @api_putchar(i8 signext 72)
%2 = tail call i32 @api_putchar(i8 signext 101)
%3 = tail call i32 @api_putchar(i8 signext 108)
%4 = tail call i32 @api_putchar(i8 signext 108)
%5 = tail call i32 @api_putchar(i8 signext 111)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int clock_gettime(int /*<<< orphan*/, struct timespec *);
__attribute__((__weak__, __always___)) int
softboundcets_clock_gettime(clockid_t clk_id, struct timespec *tp) {
  return clock_gettime(clk_id, tp);
}


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

x86 assembly (clang, -O2):
<softboundcets_clock_gettime>:
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define weak i32 @softboundcets_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @clock_gettime(i32 %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define weak i32 @softboundcets_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @clock_gettime(i32 %0, %struct.timespec* %1)
ret i32 %3
}
int __atomic_swap(int _new, volatile int *ptr) {
  int prev;
  do {
    prev = *ptr;
  } while (__sync_val_compare_and_swap(ptr, prev, _new) != prev);
  return prev;
}


x86 assembly (clang, -O0):
<__atomic_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
cmp    -0x14(%rbp),%eax
jne    110b <__atomic_swap+0xb>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_swap>:
mov    (%rsi),%ecx
mov    %ecx,%eax
lock cmpxchg %edi,(%rsi)
jne    1100 <__atomic_swap>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__atomic_swap(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %6
6: ; preds = %9, %2
%7 = load i32*, i32** %4
%8 = load volatile i32, i32* %7
store i32 %8, i32* %5
br label %9
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = cmpxchg i32* %10, i32 %11, i32 %12 seq_cst seq_cst
%14 = extractvalue { i32, i1 } %13, 0
%15 = load i32, i32* %5
%16 = icmp ne i32 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %9
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @__atomic_swap(i32 %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %1
%5 = cmpxchg i32* %1, i32 %4, i32 %0 seq_cst seq_cst
%6 = extractvalue { i32, i1 } %5, 1
br i1 %6, label %7, label %3
7: ; preds = %3
ret i32 %4
}
int test_bitXor(int x, int y) { return x ^ y; }


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

x86 assembly (clang, -O2):
<test_bitXor>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test_bitXor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_bitXor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
void test() {
  1;
#pragma clang diagnostic push

#pragma clang diagnostic ignored "-Wformat-extra-args"

#pragma clang diagnostic pop

  2;
#pragma clang diagnostic push

#pragma clang diagnostic ignored "-Wformat-extra-args"

  3;
#pragma clang diagnostic pop
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
double berechne_anfangs_tilgung(double tilgungsrate, double kredit) {
  tilgungsrate = kredit * tilgungsrate;
  return tilgungsrate;
}


x86 assembly (clang, -O0):
<berechne_anfangs_tilgung>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_anfangs_tilgung>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @berechne_anfangs_tilgung(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 = load double, double* %3
%7 = fmul double %5, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @berechne_anfangs_tilgung(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
int DUMMY_Change_Name(char *a) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @DUMMY_Change_Name(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int msg(char *, char *, int, int);
int ckfld(char *field, int set, int get) {
  return set == get ? 0
                    : msg("W1 termios.%s is 0%08o, not 0%08o", field, get, set);
}


x86 assembly (clang, -O0):
<ckfld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1138 <ckfld+0x28>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <ckfld+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <msg@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckfld>:
mov    %esi,%ecx
cmp    %edx,%esi
jne    1119 <ckfld+0x9>
xor    %eax,%eax
ret
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
jmp    1030 <msg@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"W1 termios.%s is 0%08o, not 0%08o\00"
define i32 @ckfld(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %3
br label %16
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = call i32 @msg(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11, %10
%17 = phi i32 [ 0, %10 ], [ %15, %11 ]
ret i32 %17
}

LLVM IR (-O2):
@.str = [34 x i8] c"W1 termios.%s is 0%08o, not 0%08o\00"
define i32 @ckfld(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @msg(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i32 %1)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
char *i2a(unsigned i, char *a, unsigned r) {
  if (i / r > 0)
    a = i2a(i / r, a, r);
  *a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i % r];
  return a + 1;
}


x86 assembly (clang, -O0):
<i2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
cmp    $0x0,%eax
jbe    114d <i2a+0x3d>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <i2a@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %edx,%eax
mov    %eax,%ecx
lea    0xea0(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2a>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
cmp    %edi,%edx
ja     112d <i2a+0x1d>
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
mov    %eax,%edi
mov    %ebx,%edx
call   1030 <i2a@plt>
mov    %rax,%rsi
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
lea    0xec6(%rip),%rax
mov    (%rdx,%rax,1),%al
mov    %al,(%rsi)
add    $0x1,%rsi
mov    %rsi,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i8* @i2a(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = udiv i32 %7, %8
%10 = icmp ugt i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = udiv i32 %12, %13
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i8* @i2a(i32 %14, i8* %15, i32 %16)
store i8* %17, i8** %5
br label %18
18: ; preds = %11, %3
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = urem i32 %19, %20
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [37 x i8], [37 x i8]* @.str, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = load i8*, i8** %5
store i8 %24, i8* %25
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 1
ret i8* %27
}

LLVM IR (-O2):
@.str = [37 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i8* @i2a(i32 %0, i8* %1, i32 %2) {
%4 = icmp ugt i32 %2, %0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = udiv i32 %0, %2
%7 = tail call i8* @i2a(i32 %6, i8* %1, i32 %2)
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %7, %5 ], [ %1, %3 ]
%10 = urem i32 %0, %2
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds [37 x i8], [37 x i8]* @.str, i64 0, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %9
%14 = getelementptr inbounds i8, i8* %9, i64 1
ret i8* %14
}
void shapesPrintf(int row, int col, const char *fmt, ...) {}


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

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

LLVM IR (-O0):
define void @shapesPrintf(i32 %0, i32 %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @shapesPrintf(i32 %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
int do_370() { return 370; }


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

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

LLVM IR (-O0):
define i32 @do_370() {
ret i32 370
}

LLVM IR (-O2):
define i32 @do_370() {
ret i32 370
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int return_1();
int main() {
  int r = return_1();
  if (r != 1) {
    printf("The function does not return 1.\n");
  } else {
    printf("The function returns 1.\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <return_1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1154 <main+0x34>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <return_1@plt>
cmp    $0x1,%eax
lea    0xece(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"The function does not return 1.\0A\00"
@.str.1 = [25 x i8] c"The function returns 1.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @return_1()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@str = [24 x i8] c"The function returns 1.\00"
@str.2 = [32 x i8] c"The function does not return 1.\00"
define i32 @main() {
%1 = tail call i32 (...) @return_1()
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Type definitions */
struct group {
  int gr_gid;
};

/* Variables and functions */
struct group *getgrnam(char *);
int get_gid(char *group) {
  int retcode;
  struct group *grent;
  grent = getgrnam(group);
  if (grent == NULL) {
    retcode = -1;
  } else {
    retcode = grent->gr_gid;
  }
  return retcode;
}


x86 assembly (clang, -O0):
<get_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <get_gid+0x30>
movl   $0xffffffff,-0xc(%rbp)
jmp    1149 <get_gid+0x39>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_gid>:
push   %rax
call   1030 <getgrnam@plt>
test   %rax,%rax
je     111f <get_gid+0xf>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type { i32 }
define i32 @get_gid(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.group*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call %struct.group* @getgrnam(i8* %5)
store %struct.group* %6, %struct.group** %4
%7 = load %struct.group*, %struct.group** %4
%8 = icmp eq %struct.group* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %3
br label %14
10: ; preds = %1
%11 = load %struct.group*, %struct.group** %4
%12 = getelementptr inbounds %struct.group, %struct.group* %11, i32 0, i32 0
%13 = load i32, i32* %12
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.group = type { i32 }
define i32 @get_gid(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
double scs_tan_ru(double);
double tan_ru(double x) { return scs_tan_ru(x); }


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

x86 assembly (clang, -O2):
<tan_ru>:
jmp    1030 <scs_tan_ru@plt>

LLVM IR (-O0):
define double @tan_ru(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @scs_tan_ru(double %3)
ret double %4
}

LLVM IR (-O2):
define double @tan_ru(double %0) {
%2 = tail call double @scs_tan_ru(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Ae0Cg2(int, unsigned long volatile *, unsigned int,
                          unsigned int);
__attribute__((no)) void __attribute__((stdcall, regparm(3)))
s3sCI1(volatile unsigned long *RdZoN, unsigned kKiv65, unsigned vgKFx2) {
  Ae0Cg2(01, RdZoN, kKiv65, vgKFx2);
}


x86 assembly (clang, -O0):
<s3sCI1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%edi
call   1030 <Ae0Cg2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3sCI1>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <Ae0Cg2@plt>

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

LLVM IR (-O2):
define void @s3sCI1(i64* %0, i32 %1, i32 %2) {
%4 = tail call i32 @Ae0Cg2(i32 1, i64* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FMSTR_RxDequeue();
void FMSTR_Poll(void) { FMSTR_RxDequeue(); }


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

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

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

LLVM IR (-O2):
define void @FMSTR_Poll() {
%1 = tail call i32 (...) @FMSTR_RxDequeue()
ret void
}
/* Variables and functions */
double blackman(double);
double sinc(double);
double windowed_sinc(double x) {
  return blackman(0.5 + 0.5 * x / (16 / 2)) * sinc(x);
}


x86 assembly (clang, -O0):
<windowed_sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xec6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <blackman@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sinc@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<windowed_sinc>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  0xece(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <blackman@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sinc@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @windowed_sinc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 5.000000e-01, %3
%5 = fdiv double %4, 8.000000e+00
%6 = fadd double 5.000000e-01, %5
%7 = call double @blackman(double %6)
%8 = load double, double* %2
%9 = call double @sinc(double %8)
%10 = fmul double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @windowed_sinc(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fmul double %2, 1.250000e-01
%4 = fadd double %3, 5.000000e-01
%5 = tail call double @blackman(double %4)
%6 = tail call double @sinc(double %0)
%7 = fmul double %5, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printChar(char);
void printString(char *str) {
  int i;
  for (i = 0; str[i]; i++) {
    if (str[i] == '\n')
      printChar('\r');
    printChar(str[i]);
  }
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1173 <printString+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1154 <printString+0x44>
mov    $0xd,%edi
call   1030 <printChar@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <printChar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printString+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <printString+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <printChar@plt>
movzbl (%rbx),%eax
movsbl %al,%edi
call   1030 <printChar@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <printString+0x10>
test   %al,%al
jne    112d <printString+0x1d>
pop    %rbx
ret

LLVM IR (-O0):
define void @printString(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %28, %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 = icmp ne i8 %9, 0
br i1 %10, label %11, label %31
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = call i32 @printChar(i8 signext 13)
br label %21
21: ; preds = %19, %11
%22 = load i8*, i8** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = call i32 @printChar(i8 signext %26)
br label %28
28: ; preds = %21
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %4
31: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @printString(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %12, %9 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %13
i8 10, label %6
]
6: ; preds = %2
%7 = tail call i32 @printChar(i8 signext 13)
%8 = load i8, i8* %4
br label %9
9: ; preds = %2, %6
%10 = phi i8 [ %5, %2 ], [ %8, %6 ]
%11 = tail call i32 @printChar(i8 signext %10)
%12 = add nuw i64 %3, 1
br label %2
13: ; preds = %2
ret void
}
/* Type definitions */
struct netent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
struct netent *getnetbyaddr(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0;
  struct netent *net;
  printf("defined\n");
  net = getnetbyaddr(i, AF_INET);
  if (net != 0)
    printf("ok\n");
  else
    printf("not ok\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1040 <getnetbyaddr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1173 <main+0x53>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x5f>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <getnetbyaddr@plt>
test   %rax,%rax
lea    0xec1(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.netent = type { i32 }
@.str = [9 x i8] c"defined\0A\00"
@AF_INET = global i32 0
@.str.1 = [4 x i8] c"ok\0A\00"
@.str.2 = [8 x i8] c"not ok\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.netent*
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* @AF_INET
%7 = call %struct.netent* @getnetbyaddr(i32 %5, i32 %6)
store %struct.netent* %7, %struct.netent** %3
%8 = load %struct.netent*, %struct.netent** %3
%9 = icmp ne %struct.netent* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
%struct.netent = type { i32 }
@AF_INET = global i32 0
@str = [8 x i8] c"defined\00"
@str.3 = [7 x i8] c"not ok\00"
@str.4 = [3 x i8] c"ok\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @AF_INET
%3 = tail call %struct.netent* @getnetbyaddr(i32 0, i32 %2)
%4 = icmp eq %struct.netent* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void stradd(char *s, char c) {
  int i = strlen(s);
  s[i] = c;
  s[i + 1] = '\0';
}


x86 assembly (clang, -O0):
<stradd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stradd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @stradd(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @stradd(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
void skip_spaces(const char **src) {
  while (**src && isspace(**src)) {
    (*src)++;
  }
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114d <skip_spaces+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <skip_spaces+0x4d>
jmp    1170 <skip_spaces+0x60>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <skip_spaces+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    (%rdi),%rax
mov    (%rax),%al
test   %al,%al
je     113f <skip_spaces+0x2f>
mov    %rdi,%rbx
nopl   (%rax)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113f <skip_spaces+0x2f>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%eax
test   %al,%al
jne    1120 <skip_spaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @skip_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8 [ %12, %9 ], [ %3, %1 ]
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i8*, i8** %0
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %0
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void IntDefaultHandler(void) { printf("Default interrupt handler fired\r\n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Default interrupt handler fired\0D\0A\00"
define void @IntDefaultHandler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Default interrupt handler fired\0D\00"
define void @IntDefaultHandler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}