xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ wcstombs(char *, int /*<<< orphan*/ const *, int);
__attribute__((visibility("default"))) int
osal_path_existsW(const wchar_t *_path) {
  char path[260];
  wcstombs(path, _path, 260);
  struct stat fileinfo;
  return stat(path, &fileinfo) == 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<osal_path_existsW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x104,%edx
call   1040 <wcstombs@plt>
lea    -0x110(%rbp),%rdi
lea    -0x118(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osal_path_existsW>:
push   %rbx
sub    $0x120,%rsp
mov    %rdi,%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x104,%edx
call   1040 <wcstombs@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x120,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @osal_path_existsW(i32* %0) {
%2 = alloca i32*
%3 = alloca [260 x i8]
%4 = alloca %struct.stat
store i32* %0, i32** %2
%5 = getelementptr inbounds [260 x i8], [260 x i8]* %3, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32 @wcstombs(i8* %5, i32* %6, i32 260)
%8 = getelementptr inbounds [260 x i8], [260 x i8]* %3, i64 0, i64 0
%9 = call i64 @stat(i8* %8, %struct.stat* %4)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @osal_path_existsW(i32* %0) {
%2 = alloca [260 x i8]
%3 = alloca %struct.stat
%4 = getelementptr inbounds [260 x i8], [260 x i8]* %2, i64 0, i64 0
%5 = call i32 @wcstombs(i8* %4, i32* %0, i32 260)
%6 = bitcast %struct.stat* %3 to i8*
%7 = call i64 @stat(i8* %4, %struct.stat* %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
__attribute__((always_)) unsigned clamp_unsigned(unsigned a, unsigned b,
                                                 unsigned c) {
  return a < b ? b : a > c ? c : a;
}


x86 assembly (clang, -O0):
<clamp_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1124 <clamp_unsigned+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp_unsigned+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    113b <clamp_unsigned+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp_unsigned+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_unsigned>:
mov    %edx,%eax
cmp    %edx,%edi
cmovbe %edi,%eax
cmp    %esi,%edi
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clamp_unsigned(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* %4
%8 = load i32, i32* %5
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp ugt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp_unsigned(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, %1
%5 = icmp ugt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dot();
void sE() {
  dot();
  cBreak();
}


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

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

LLVM IR (-O0):
define void @sE() {
%1 = call i32 (...) @dot()
%2 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sE() {
%1 = tail call i32 (...) @dot()
%2 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn(int **, int);
int main(int argc, char *argv[]) {
  int mat[4][4] = {
      {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}};
  fn(mat, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x4,%esi
call   1030 <fn@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <fn@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.mat = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12], [4 x i32] [i32 13, i32 14, i32 15, i32 16]]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x [4 x i32]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x [4 x i32]]* %6 to i8*
%8 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %6, i64 0, i64 0
%9 = bitcast [4 x i32]* %8 to i32**
%10 = call i32 @fn(i32** %9, i32 4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mat = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12], [4 x i32] [i32 13, i32 14, i32 15, i32 16]]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x [4 x i32]]
%4 = bitcast [4 x [4 x i32]]* %3 to i8*
%5 = bitcast [4 x [4 x i32]]* %3 to i32**
%6 = call i32 @fn(i32** %5, i32 4)
ret i32 0
}
void UARTModemControlClear(unsigned long ulBase, unsigned long ulControl) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &= ~ulControl;
}


x86 assembly (clang, -O0):
<UARTModemControlClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlClear>:
not    %rsi
and    %rsi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @UARTModemControlClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 20
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @UARTModemControlClear(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 20
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_ioctl(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


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

x86 assembly (clang, -O2):
<sys_ioctl>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_ioctl(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_ioctl(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
int log2mem_atomic_incr_fetch_int(int *v, int value) {
  return __sync_add_and_fetch(v, value);
}


x86 assembly (clang, -O0):
<log2mem_atomic_incr_fetch_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
lock xadd %eax,(%rdx)
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2mem_atomic_incr_fetch_int>:
mov    %esi,%eax
lock xadd %eax,(%rdi)
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @log2mem_atomic_incr_fetch_int(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 = atomicrmw add i32* %5, i32 %6 seq_cst
%8 = add i32 %7, %6
ret i32 %8
}

LLVM IR (-O2):
define i32 @log2mem_atomic_incr_fetch_int(i32* nocapture %0, i32 %1) {
%3 = atomicrmw add i32* %0, i32 %1 seq_cst
%4 = add i32 %3, %1
ret i32 %4
}
int have_simd() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @have_simd() {
ret i32 1
}
void *test_anti_range_57(int n) {
  extern void *alloc_anti_range_57(int) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 12)
    n = 1 - 1;
  return alloc_anti_range_57(n);
}


x86 assembly (clang, -O0):
<test_anti_range_57>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_57+0x2a>
cmpl   $0xc,-0x4(%rbp)
jg     113a <test_anti_range_57+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_57@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_57>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
cmp    $0xc,%eax
cmovb  %ecx,%edi
jmp    1030 <alloc_anti_range_57@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_57(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 12
%4 = select i1 %3, i32 0, i32 %0
%5 = tail call i8* @alloc_anti_range_57(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ initialiserEmplacementCleEnnemi();
int /*<<< orphan*/ initialiserPositionJoueurNouveauNiveau();
int /*<<< orphan*/ placerCaverneNouveauNiveau();
int /*<<< orphan*/ placerCoffreEtEnnemiNouveauNiveau();
int /*<<< orphan*/ placerObstacleNouveauNiveau();
int /*<<< orphan*/ remplirSalleNouveauNiveau();
void genererNiveau(void) {
  initialiserPositionJoueurNouveauNiveau();
  remplirSalleNouveauNiveau();
  placerCaverneNouveauNiveau();
  placerObstacleNouveauNiveau();
  placerCoffreEtEnnemiNouveauNiveau();
  initialiserEmplacementCleEnnemi();
}


x86 assembly (clang, -O0):
<genererNiveau>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <initialiserPositionJoueurNouveauNiveau@plt>
mov    $0x0,%al
call   1040 <remplirSalleNouveauNiveau@plt>
mov    $0x0,%al
call   1030 <placerCaverneNouveauNiveau@plt>
mov    $0x0,%al
call   1050 <placerObstacleNouveauNiveau@plt>
mov    $0x0,%al
call   1070 <placerCoffreEtEnnemiNouveauNiveau@plt>
mov    $0x0,%al
call   1060 <initialiserEmplacementCleEnnemi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genererNiveau>:
push   %rax
xor    %eax,%eax
call   1080 <initialiserPositionJoueurNouveauNiveau@plt>
xor    %eax,%eax
call   1040 <remplirSalleNouveauNiveau@plt>
xor    %eax,%eax
call   1030 <placerCaverneNouveauNiveau@plt>
xor    %eax,%eax
call   1050 <placerObstacleNouveauNiveau@plt>
xor    %eax,%eax
call   1070 <placerCoffreEtEnnemiNouveauNiveau@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <initialiserEmplacementCleEnnemi@plt>

LLVM IR (-O0):
define void @genererNiveau() {
%1 = call i32 (...) @initialiserPositionJoueurNouveauNiveau()
%2 = call i32 (...) @remplirSalleNouveauNiveau()
%3 = call i32 (...) @placerCaverneNouveauNiveau()
%4 = call i32 (...) @placerObstacleNouveauNiveau()
%5 = call i32 (...) @placerCoffreEtEnnemiNouveauNiveau()
%6 = call i32 (...) @initialiserEmplacementCleEnnemi()
ret void
}

LLVM IR (-O2):
define void @genererNiveau() {
%1 = tail call i32 (...) @initialiserPositionJoueurNouveauNiveau()
%2 = tail call i32 (...) @remplirSalleNouveauNiveau()
%3 = tail call i32 (...) @placerCaverneNouveauNiveau()
%4 = tail call i32 (...) @placerObstacleNouveauNiveau()
%5 = tail call i32 (...) @placerCoffreEtEnnemiNouveauNiveau()
%6 = tail call i32 (...) @initialiserEmplacementCleEnnemi()
ret void
}
int last_one210(unsigned int u2, unsigned int u1, unsigned int u0) {
  if (u2) {
    return 80 - __builtin_ctz(u2);
  }
  if (u1) {
    return 53 - __builtin_ctz(u1);
  }
  return 26 - __builtin_ctz(u0);
}


x86 assembly (clang, -O0):
<last_one210>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112c <last_one210+0x2c>
mov    -0x8(%rbp),%eax
bsf    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115b <last_one210+0x5b>
cmpl   $0x0,-0xc(%rbp)
je     114b <last_one210+0x4b>
mov    -0xc(%rbp),%eax
bsf    %eax,%ecx
mov    $0x35,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115b <last_one210+0x5b>
mov    -0x10(%rbp),%eax
bsf    %eax,%ecx
mov    $0x1a,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_one210>:
test   %esi,%esi
cmovne %esi,%edx
mov    $0x1a,%eax
mov    $0x35,%ecx
cmove  %eax,%ecx
test   %edi,%edi
cmovne %edi,%edx
mov    $0x50,%eax
cmove  %ecx,%eax
bsf    %edx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @last_one210(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %5
%12 = call i32 @llvm.cttz.i32(i32 %11, i1 true)
%13 = sub nsw i32 80, %12
store i32 %13, i32* %4
br label %25
14: ; preds = %3
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %6
%19 = call i32 @llvm.cttz.i32(i32 %18, i1 true)
%20 = sub nsw i32 53, %19
store i32 %20, i32* %4
br label %25
21: ; preds = %14
%22 = load i32, i32* %7
%23 = call i32 @llvm.cttz.i32(i32 %22, i1 true)
%24 = sub nsw i32 26, %23
store i32 %24, i32* %4
br label %25
25: ; preds = %21, %17, %10
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @last_one210(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %5, i32 26, i32 53
%8 = select i1 %4, i32 %6, i32 %0
%9 = select i1 %4, i32 %7, i32 80
%10 = tail call i32 @llvm.cttz.i32(i32 %8, i1 true)
%11 = sub nsw i32 %9, %10
ret i32 %11
}
/* Type definitions */
struct out {
  int dummy;
};
struct node {
  int dummy;
};
struct module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_block(struct out *, struct module const *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ subs_first_const(struct node const *);
void print_invariant(struct out *out, const struct module *mod,
                     const struct node *node) {
  print_block(out, mod, subs_first_const(node));
}


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

x86 assembly (clang, -O2):
<print_invariant>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <subs_first_const@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <print_block@plt>

LLVM IR (-O0):
%struct.out = type { i32 }
%struct.module = type { i32 }
%struct.node = type { i32 }
define void @print_invariant(%struct.out* %0, %struct.module* %1, %struct.node* %2) {
%4 = alloca %struct.out*
%5 = alloca %struct.module*
%6 = alloca %struct.node*
store %struct.out* %0, %struct.out** %4
store %struct.module* %1, %struct.module** %5
store %struct.node* %2, %struct.node** %6
%7 = load %struct.out*, %struct.out** %4
%8 = load %struct.module*, %struct.module** %5
%9 = load %struct.node*, %struct.node** %6
%10 = call i32 @subs_first_const(%struct.node* %9)
%11 = call i32 @print_block(%struct.out* %7, %struct.module* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.out = type { i32 }
%struct.module = type { i32 }
%struct.node = type { i32 }
define void @print_invariant(%struct.out* %0, %struct.module* %1, %struct.node* %2) {
%4 = tail call i32 @subs_first_const(%struct.node* %2)
%5 = tail call i32 @print_block(%struct.out* %0, %struct.module* %1, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __stdio_close(int /*<<< orphan*/ *);
int fclose(FILE *file) { return __stdio_close(file); }


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

x86 assembly (clang, -O2):
<fclose>:
jmp    1030 <__stdio_close@plt>

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

LLVM IR (-O2):
define i32 @fclose(i32* %0) {
%2 = tail call i32 @__stdio_close(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t uniqueid(void) {
  static uint32_t uniquecounter;
  return uniquecounter++;
}


x86 assembly (clang, -O0):
<uniqueid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniqueid>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@uniqueid.uniquecounter = internal global i32 0
define i32 @uniqueid() {
%1 = load i32, i32* @uniqueid.uniquecounter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @uniqueid.uniquecounter
ret i32 %1
}

LLVM IR (-O2):
@uniqueid.uniquecounter = internal unnamed_addr global i32 0
define i32 @uniqueid() {
%1 = load i32, i32* @uniqueid.uniquecounter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @uniqueid.uniquecounter
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  alarm(5);
  alarm(1);
  alarm(10);
  while (1)
    ;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <alarm@plt>
mov    $0x1,%edi
call   1030 <alarm@plt>
mov    $0xa,%edi
call   1030 <alarm@plt>
jmp    113d <main+0x2d>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <alarm@plt>
mov    $0x1,%edi
call   1030 <alarm@plt>
mov    $0xa,%edi
call   1030 <alarm@plt>
nop
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alarm(i32 5)
%3 = call i32 @alarm(i32 1)
%4 = call i32 @alarm(i32 10)
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @alarm(i32 5)
%2 = tail call i32 @alarm(i32 1)
%3 = tail call i32 @alarm(i32 10)
br label %4
4: ; preds = %0, %4
br label %4
}
void mf_write_header_chunk(format, ntracks, division) int format, ntracks,
    division;
{
  long ident, length;
  ident = 0x4d546864;
  length = 6;
  write32bit(ident);
  write32bit(length);
  write16bit(format);
  write16bit(ntracks);
  write16bit(division);
}


x86 assembly (clang, -O0):
<mf_write_header_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movq   $0x4d546864,-0x18(%rbp)
4d
movq   $0x6,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <write32bit@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <write32bit@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <write16bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mf_write_header_chunk>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x4d546864,%edi
xor    %eax,%eax
call   1040 <write32bit@plt>
mov    $0x6,%edi
xor    %eax,%eax
call   1040 <write32bit@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <write16bit@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <write16bit@plt>
mov    %r14d,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write16bit@plt>

LLVM IR (-O0):
define void @mf_write_header_chunk(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64 1297377380, i64* %7
store i64 6, i64* %8
%9 = load i64, i64* %7
%10 = call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 %9)
%11 = load i64, i64* %8
%12 = call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 %11)
%13 = load i32, i32* %4
%14 = call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %13)
%15 = load i32, i32* %5
%16 = call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %15)
%17 = load i32, i32* %6
%18 = call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %17)
ret void
}

LLVM IR (-O2):
define void @mf_write_header_chunk(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 1297377380)
%5 = tail call i32 (i64, ...) bitcast (i32 (...)* @write32bit to i32 (i64, ...)*)(i64 6)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %0)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @write16bit to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ output_w32(int);
void emit_fcmpd(int x, int y) {
  assert(x == 30);
  assert(y == 31);
  assem_debug("fcmp d%d, d%d", x, y);
  output_w32(0x1e602000 | y << 16 | x << 5);
}


x86 assembly (clang, -O0):
<emit_fcmpd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1e,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1f,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
shl    $0x10,%edi
or     $0x1e602000,%edi
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fcmpd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x1e,%ebx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x1f,%ebp
sete   %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
shl    $0x10,%ebp
shl    $0x5,%ebx
or     %ebp,%ebx
or     $0x1e602000,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fcmp d%d, d%d\00"
define void @emit_fcmpd(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 = icmp eq i32 %5, 30
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 31
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %4
%17 = shl i32 %16, 16
%18 = or i32 509616128, %17
%19 = load i32, i32* %3
%20 = shl i32 %19, 5
%21 = or i32 %18, %20
%22 = call i32 @output_w32(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fcmp d%d, d%d\00"
define void @emit_fcmpd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 30
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 31
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%10 = shl i32 %1, 16
%11 = shl i32 %0, 5
%12 = or i32 %11, %10
%13 = or i32 %12, 509616128
%14 = tail call i32 @output_w32(i32 %13)
ret void
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int msg_type(struct tipc_msg *);
int msg_in_group(struct tipc_msg *m) {
  int mtyp = msg_type(m);
  return mtyp >= 4 && mtyp <= 7;
}


x86 assembly (clang, -O0):
<msg_in_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <msg_type@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1141 <msg_in_group+0x31>
cmpl   $0x7,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_in_group>:
push   %rax
call   1030 <msg_type@plt>
and    $0xfffffffc,%eax
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define i32 @msg_in_group(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
%3 = alloca i32
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%4 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%5 = call i32 @msg_type(%struct.tipc_msg* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 4
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 7
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ false, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define i32 @msg_in_group(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_type(%struct.tipc_msg* %0)
%3 = and i32 %2, -4
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int somaSerie(int, int, int);
int main() {
  printf("A soma dos valores de 1 a 8 com inclemento de 3: %d",
         somaSerie(1, 8, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x8,%esi
mov    $0x3,%edx
call   1040 <somaSerie@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x8,%esi
mov    $0x3,%edx
call   1040 <somaSerie@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"A soma dos valores de 1 a 8 com inclemento de 3: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @somaSerie(i32 1, i32 8, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"A soma dos valores de 1 a 8 com inclemento de 3: %d\00"
define i32 @main() {
%1 = tail call i32 @somaSerie(i32 1, i32 8, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void glGetShaderiv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetShaderiv() {
ret void
}
/* Variables and functions */
int calibrate(char *);
int main(int argc, char **argv) { return calibrate("/dev/usb/hiddev0"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"/dev/usb/hiddev0\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @calibrate(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"/dev/usb/hiddev0\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @calibrate(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t now() {
  struct timeval tv;
  int rc = gettimeofday(&tv, NULL);
  assert(rc == 0);
  return ((uint64_t)tv.tv_sec) * 1000 + (((uint64_t)tv.tv_usec) / 1000);
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @now() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, 1000
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = sdiv i32 %14, 1000
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 1000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = sdiv i32 %13, 1000
%15 = add nsw i32 %14, %10
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fortune_cookie(char msg[]) {
  printf("str is:%s", msg);
  printf("size of:%lu", sizeof(msg));
}


x86 assembly (clang, -O0):
<fortune_cookie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fortune_cookie>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"str is:%s\00"
@.str.1 = [12 x i8] c"size of:%lu\00"
define void @fortune_cookie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"str is:%s\00"
@.str.1 = [12 x i8] c"size of:%lu\00"
define void @fortune_cookie(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 8)
ret void
}
void acquire(int *_lock) {
  while (__sync_lock_test_and_set(_lock, 1))
    ;
}


x86 assembly (clang, -O0):
<acquire>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
xchg   %eax,(%rcx)
cmp    $0x0,%eax
je     1121 <acquire+0x21>
jmp    1108 <acquire+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<acquire>:
mov    $0x1,%eax
xchg   %eax,(%rdi)
test   %eax,%eax
jne    1100 <acquire>
ret

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

LLVM IR (-O2):
define void @acquire(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = atomicrmw xchg i32* %0, i32 1 seq_cst
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
void glmAdd3fs(float out[3], const float x[3], float y) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] + y;
}


x86 assembly (clang, -O0):
<glmAdd3fs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    1154 <glmAdd3fs+0x54>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <glmAdd3fs+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @glmAdd3fs(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fadd float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fadd float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fadd float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
extern unsigned int inl(unsigned long addr) {
  return *(volatile unsigned int *)((addr << 7) +
                                    ((0xfffffc0000000000UL) + 0x300000000UL) +
                                    0x60);
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x7,%rax
movabs $0xfffffc0300000000,%rcx
fc ff ff
add    %rcx,%rax
mov    0x60(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
shl    $0x7,%rdi
movabs $0xfffffc0300000060,%rax
fc ff ff
mov    (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @inl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 7
%5 = add i64 %4, -4385161609216
%6 = add i64 %5, 96
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @inl(i64 %0) {
%2 = shl i64 %0, 7
%3 = add i64 %2, -4385161609120
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int func2(int);
int func6(int a) { return func2(a) + a; }


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

x86 assembly (clang, -O2):
<func6>:
push   %rbx
mov    %edi,%ebx
call   1030 <func2@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @func6(i32 %0) {
%2 = tail call i32 @func2(i32 %0)
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_string(char *);
int /*<<< orphan*/ output_with_tab(char *);
gen_call(char *sname) {
  output_with_tab("call\t");
  output_string(sname);
  newline();
}


x86 assembly (clang, -O0):
<gen_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x10(%rbp),%rdi
call   1040 <output_string@plt>
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_call>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    %rbx,%rdi
call   1040 <output_string@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"call\09\00"
define i32 @gen_call(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 @output_string(i8* %5)
%7 = call i32 (...) @newline()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"call\09\00"
define i32 @gen_call(i8* %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_string(i8* %0)
%4 = tail call i32 (...) @newline()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main(void) {
  char os[] = "debian";
  printf("%d%d\n", os[1], os[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0xa(%rbp),%al
lea    0xec1(%rip),%rdi
movsbl %al,%esi
movsbl -0xb(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.os = [7 x i8] c"debian\00"
@.str = [6 x i8] c"%d%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
store i32 0, i32* %1
%3 = bitcast [7 x i8]* %2 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 101, i8 signext 100)
ret i32 0
}
__attribute__((no, noclone)) unsigned __int128 t103_2sub(unsigned short y) {
  signed char x = (5);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t103_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %di,%ax
mov    %ax,-0x12(%rbp)
movb   $0x5,-0x13(%rbp)
movsbq -0x13(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
movzwl -0x12(%rbp),%eax
sub    %rax,%rdx
mov    %r9,%rcx
sbb    $0x0,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    117d <t103_2sub+0x6d>
jmp    1184 <t103_2sub+0x74>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t103_2sub>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%eax
xor    %r14d,%r14d
mov    $0x5,%ebx
sub    %rax,%rbx
sbb    %r14,%r14
cmp    $0x6,%di
jb     1131 <t103_2sub+0x21>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t103_2sub(i16 zeroext %0) {
%2 = alloca i128
%3 = alloca i16
%4 = alloca i8
%5 = alloca i128
store i16 %0, i16* %3
store i8 5, i8* %4
%6 = load i8, i8* %4
%7 = load i16, i16* %3
%8 = sext i8 %6 to i129
%9 = zext i16 %7 to i129
%10 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %8, i129 %9)
%11 = extractvalue { i129, i1 } %10, 1
%12 = extractvalue { i129, i1 } %10, 0
%13 = trunc i129 %12 to i128
%14 = zext i128 %13 to i129
%15 = icmp ne i129 %12, %14
%16 = or i1 %11, %15
store i128 %13, i128* %5
br i1 %16, label %17, label %19
17: ; preds = %1
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %1
%20 = load i128, i128* %5
store i128 %20, i128* %2
%21 = bitcast i128* %2 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t103_2sub(i16 zeroext %0) {
%2 = zext i16 %0 to i129
%3 = sub nsw i129 5, %2
%4 = icmp ugt i16 %0, 5
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %5, %1
%8 = trunc i129 %3 to i64
%9 = lshr i129 %3, 64
%10 = trunc i129 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xc7() {
  Assert_real((isascii(199) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1000, ("isascii should be 0 for 0xc7"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xc7>:
push   %rax
mov    $0xc7,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e8,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc7\00"
define void @t_isascii_0xc7() {
%1 = call i64 @isascii(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([29 x i8], [29 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc7\00"
define void @t_isascii_0xc7() {
%1 = tail call i64 @isascii(i32 199)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}