xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void main_usage(int status) {
  fprintf(stdout,
          "\nUsage: %s <command> [options]\n\nCommand:\npe\tpaired-end barcode "
          "de-multiplexing\nse\tsingle-end barcode de-multiplexing\n\n--help, "
          "display this help and exit\n--version, output version information "
          "and exit\n\n",
          "sabre");
  exit(status);
}


x86 assembly (clang, -O0):
<main_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xf88(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main_usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
lea    0xf90(%rip),%rdx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [202 x i8] c"\0AUsage: %s <command> [options]\0A\0ACommand:\0Ape\09paired-end barcode de-multiplexing\0Ase\09single-end barcode de-multiplexing\0A\0A--help, display this help and exit\0A--version, output version information and exit\0A\0A\00"
@.str.1 = [6 x i8] c"sabre\00"
define void @main_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [202 x i8] c"\0AUsage: %s <command> [options]\0A\0ACommand:\0Ape\09paired-end barcode de-multiplexing\0Ase\09single-end barcode de-multiplexing\0A\0A--help, display this help and exit\0A--version, output version information and exit\0A\0A\00"
@.str.1 = [6 x i8] c"sabre\00"
define void @main_usage(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t __attribute__((__unused__)) lcm(uint64_t x, uint64_t y) {
  uint64_t m = x, n = y, o;
  while ((o = m % n)) {
    m = n;
    n = o;
  }
  return (x / n) * y;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmp    $0x0,%edx
je     113a <lcm+0x3a>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <lcm+0x16>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x10(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
mov    %esi,%edx
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%eax
mov    %edx,%ecx
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <lcm+0x10>
mov    %edi,%eax
cltd
idiv   %ecx
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
br label %10
10: ; preds = %15, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = srem i32 %11, %12
store i32 %13, i32* %7
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %6
store i32 %16, i32* %5
%17 = load i32, i32* %7
store i32 %17, i32* %6
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
%20 = load i32, i32* %6
%21 = sdiv i32 %19, %20
%22 = load i32, i32* %4
%23 = mul nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = sdiv i32 %0, %4
%10 = mul nsw i32 %9, %1
ret i32 %10
}
extern int f9(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f9() {
ret i32 0
}

LLVM IR (-O2):
define i32 @f9() {
ret i32 0
}
void flush_cache_mm(struct mm_struct *mm) {}


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

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @flush_cache_mm(%struct.mm_struct* nocapture %0) {
ret void
}
int comp(const void *a, const void *b) {
  int *a1 = (int *)a;
  int *b1 = (int *)b;
  if ((a1)[0] < (b1)[0])
    return -1;
  if ((a1)[0] > (b1)[0])
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <comp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <comp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1158 <comp+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <comp+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_assert_should_fail() { assert(0 | 0); }


x86 assembly (clang, -O0):
<test_assert_should_fail>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_should_fail>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_assert_should_fail() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_assert_should_fail() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ *calloc(int, int);
int /*<<< orphan*/ fib_memoization2(int, int /*<<< orphan*/ *);
int64_t fib_memoization(int n) {
  static int64_t *cache;
  if (!cache) {
    cache = calloc(100, sizeof(*cache));
  }
  int64_t ret = fib_memoization2(n, cache);
  return ret;
}


x86 assembly (clang, -O0):
<fib_memoization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpq   $0x0,0x2f05(%rip)
jne    114f <fib_memoization+0x2f>
mov    $0x64,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,0x2ee9(%rip)
mov    -0x4(%rbp),%edi
mov    0x2edf(%rip),%rsi
call   1040 <fib_memoization2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_memoization>:
push   %rbx
mov    %edi,%ebx
mov    0x2f0e(%rip),%rsi
test   %rsi,%rsi
jne    1148 <fib_memoization+0x28>
mov    $0x64,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rsi
mov    %rax,0x2ef0(%rip)
mov    %ebx,%edi
pop    %rbx
jmp    1040 <fib_memoization2@plt>

LLVM IR (-O0):
@fib_memoization.cache = internal global i32* null
define i32 @fib_memoization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32*, i32** @fib_memoization.cache
%5 = icmp ne i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32* @calloc(i32 100, i32 4)
store i32* %7, i32** @fib_memoization.cache
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = load i32*, i32** @fib_memoization.cache
%11 = call i32 @fib_memoization2(i32 %9, i32* %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@fib_memoization.cache = internal unnamed_addr global i32* null
define i32 @fib_memoization(i32 %0) {
%2 = load i32*, i32** @fib_memoization.cache
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32* @calloc(i32 100, i32 4)
store i32* %5, i32** @fib_memoization.cache
br label %6
6: ; preds = %4, %1
%7 = phi i32* [ %5, %4 ], [ %2, %1 ]
%8 = tail call i32 @fib_memoization2(i32 %0, i32* %7)
ret i32 %8
}
/* Variables and functions */
unsigned short htons(unsigned short);
unsigned short anp_sys_htons(unsigned short s) { return htons(s); }


x86 assembly (clang, -O0):
<anp_sys_htons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <htons@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anp_sys_htons>:
jmp    1030 <htons@plt>

LLVM IR (-O0):
define zeroext i16 @anp_sys_htons(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @htons(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @anp_sys_htons(i16 zeroext %0) {
%2 = tail call zeroext i16 @htons(i16 zeroext %0)
ret i16 %2
}
int test_imm_5Duint16_mem(unsigned short *val) {
  return ((*val) & (0x5D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Duint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x5d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 93
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rand();
int pseudo_random_int(int min, int max) { return (rand() % max) + min; }


x86 assembly (clang, -O0):
<pseudo_random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pseudo_random_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pseudo_random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @pseudo_random_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
void sleepMicro(unsigned short us) {
  unsigned short j, k;
  for (j = 0; j < us; j++) {
    for (k = 0; k < 6; k++) {
    }
  }
}


x86 assembly (clang, -O0):
<sleepMicro>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1160 <sleepMicro+0x60>
movw   $0x0,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0x6,%eax
jge    114a <sleepMicro+0x4a>
jmp    1139 <sleepMicro+0x39>
mov    -0x6(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x6(%rbp)
jmp    1127 <sleepMicro+0x27>
jmp    114f <sleepMicro+0x4f>
mov    -0x4(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x4(%rbp)
jmp    1111 <sleepMicro+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sleepMicro(i16 zeroext %0) {
ret void
}
int test_imm_CDint64_highword_reg(long long val) {
  return ((val >> 32) & (0xCD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CDint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xcd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CDint64_highword_reg>:
movabs $0xcd00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CDint64_highword_reg(i64 %0) {
%2 = and i64 %0, 880468295680
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ copro_pdp11_write8(int /*<<< orphan*/, int /*<<< orphan*/);
void dbg_memwrite(uint32_t addr, uint32_t value) {
  copro_pdp11_write8(addr, value);
}


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

x86 assembly (clang, -O2):
<dbg_memwrite>:
jmp    1030 <copro_pdp11_write8@plt>

LLVM IR (-O0):
define void @dbg_memwrite(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 = call i32 @copro_pdp11_write8(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @dbg_memwrite(i32 %0, i32 %1) {
%3 = tail call i32 @copro_pdp11_write8(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t len(int32_t *arr) {
  int32_t count = 0;
  for (; *(arr + count); count++)
    ;
  return count;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1134 <len+0x34>
jmp    1126 <len+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

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


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

x86 assembly (clang, -O2):
<test_imm_10int64_lowword_reg>:
test   $0x10,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_10int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 16
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 15)
ret i32 0
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
int /*<<< orphan*/ setterm(char *);
void cmd_setterm(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_return(setterm(args[0]));
}


x86 assembly (clang, -O0):
<cmd_setterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    116a <cmd_setterm+0x2a>
jmp    1187 <cmd_setterm+0x47>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <setterm@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_setterm>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1155 <cmd_setterm+0x15>
pop    %rbx
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    (%rbx),%rdi
call   1060 <setterm@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_setterm(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %16
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @setterm(i8* %13)
%15 = call i32 @report_return(i32 %14)
br label %16
16: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_setterm(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = load i8*, i8** %1
%8 = tail call i32 @setterm(i8* %7)
%9 = tail call i32 @report_return(i32 %8)
br label %10
10: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show(int *);
int /*<<< orphan*/ table(int *);
void main(void) {
  int *p;
  p = malloc(40 * sizeof(int));
  if (!p) {
    printf("Error, not enougth memory!");
    exit(1);
  }
  table(p);
  show(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa0,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1187 <main+0x37>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1050 <table@plt>
mov    -0x8(%rbp),%rdi
call   1040 <show@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa0,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1174 <main+0x24>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <table@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <show@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Error, not enougth memory!\00"
define void @main() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 160)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = call i32 @table(i32* %9)
%11 = load i32*, i32** %1
%12 = call i32 @show(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Error, not enougth memory!\00"
define void @main() {
%1 = tail call i32* @malloc(i32 160)
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @table(i32* %1)
%8 = tail call i32 @show(i32* %1)
ret void
}
/* Variables and functions */
int getpid();
void getpid_(int *val) { *val = getpid(); }


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

x86 assembly (clang, -O2):
<getpid_>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @getpid_(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @getpid()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Main program\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Main program\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void go_left(int n) { printf("%c[%dD", 0x1B, n); }


x86 assembly (clang, -O0):
<go_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_left>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dD\00"
define void @go_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dD\00"
define void @go_left(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OQS_MEM_secure_free(void *, int);
void OQS_AES128_free_schedule(void *schedule) {
  if (schedule != NULL) {
    OQS_MEM_secure_free(schedule, 176);
  }
}


x86 assembly (clang, -O0):
<OQS_AES128_free_schedule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <OQS_AES128_free_schedule+0x25>
mov    -0x8(%rbp),%rdi
mov    $0xb0,%esi
call   1030 <OQS_MEM_secure_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OQS_AES128_free_schedule>:
test   %rdi,%rdi
je     111f <OQS_AES128_free_schedule+0xf>
mov    $0xb0,%esi
jmp    1030 <OQS_MEM_secure_free@plt>
ret

LLVM IR (-O0):
define void @OQS_AES128_free_schedule(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @OQS_MEM_secure_free(i8* %6, i32 176)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @OQS_AES128_free_schedule(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @OQS_MEM_secure_free(i8* %0, i32 176)
br label %5
5: ; preds = %3, %1
ret void
}
int test9() { return __builtin_constant_p(&test9); }


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

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

LLVM IR (-O0):
define i32 @test9() {
ret i32 0
}

LLVM IR (-O2):
define i32 @test9() {
ret i32 0
}
int largest(int num1, int num2, int num3, int num4, int num5) {
  int largest = num1;
  if (num2 > largest)
    largest = num2;
  if (num3 > largest)
    largest = num3;
  if (num4 > largest)
    largest = num4;
  if (num5 > largest)
    largest = num5;
  return largest;
}


x86 assembly (clang, -O0):
<largest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    112c <largest+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    113e <largest+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1150 <largest+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1162 <largest+0x62>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<largest>:
mov    %edi,%eax
cmp    %edi,%esi
cmovg  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
cmp    %ecx,%eax
cmovl  %ecx,%eax
cmp    %r8d,%eax
cmovl  %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @largest(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %1, %0
%7 = select i1 %6, i32 %1, i32 %0
%8 = icmp slt i32 %7, %2
%9 = select i1 %8, i32 %2, i32 %7
%10 = icmp slt i32 %9, %3
%11 = select i1 %10, i32 %3, i32 %9
%12 = icmp slt i32 %11, %4
%13 = select i1 %12, i32 %4, i32 %11
ret i32 %13
}
int bound(int x, int lo, int hi) { return (x < lo ? lo : x > hi ? hi : x); }


x86 assembly (clang, -O0):
<bound>:
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
jge    1124 <bound+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <bound+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <bound+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <bound+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):
<bound>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @bound(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 slt 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 sgt 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 @bound(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int bind(int, struct sockaddr const *, int /*<<< orphan*/);
int xbind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
  int ret = bind(sockfd, addr, addrlen);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xbind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bind@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1143 <xbind+0x33>
jmp    1143 <xbind+0x33>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbind>:
jmp    1030 <bind@plt>

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @xbind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
ret i32 %4
}
int pin_config_set(const char *dev_name, const char *name,
                   unsigned long config) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pin_config_set(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ barrier_memory();
void barrier_read(void) { barrier_memory(); }


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

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

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

LLVM IR (-O2):
define void @barrier_read() {
%1 = tail call i32 (...) @barrier_memory()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x04() {
  Assert_real((isascii(4)),
              "/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",
              25, ("isascii should be 1 for 0x04"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x04>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x19,%edx
jmp    1030 <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 1 for 0x04\00"
define void @t_isascii_0x04() {
%1 = call i32 @isascii(i32 4)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 25, 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 1 for 0x04\00"
define void @t_isascii_0x04() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quat_scale(float *, float *, float);
__attribute__((always_)) struct quat *
psquat_scale(struct quat *result, struct quat *a, float scalar) {
  quat_scale((float *)result, (float *)a, scalar);
  return result;
}


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

x86 assembly (clang, -O2):
<psquat_scale>:
push   %rbx
mov    %rdi,%rbx
call   1030 <quat_scale@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.quat = type { i32 }
define %struct.quat* @psquat_scale(%struct.quat* %0, %struct.quat* %1, float %2) {
%4 = alloca %struct.quat*
%5 = alloca %struct.quat*
%6 = alloca float
store %struct.quat* %0, %struct.quat** %4
store %struct.quat* %1, %struct.quat** %5
store float %2, float* %6
%7 = load %struct.quat*, %struct.quat** %4
%8 = bitcast %struct.quat* %7 to float*
%9 = load %struct.quat*, %struct.quat** %5
%10 = bitcast %struct.quat* %9 to float*
%11 = load float, float* %6
%12 = call i32 @quat_scale(float* %8, float* %10, float %11)
%13 = load %struct.quat*, %struct.quat** %4
ret %struct.quat* %13
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define %struct.quat* @psquat_scale(%struct.quat* returned %0, %struct.quat* %1, float %2) {
%4 = bitcast %struct.quat* %0 to float*
%5 = bitcast %struct.quat* %1 to float*
%6 = tail call i32 @quat_scale(float* %4, float* %5, float %2)
ret %struct.quat* %0
}
void matrixSwap(int arr[10][20], int ia, int ib, int ic) {
  int aux = arr[ia][ic];
  arr[ia][ic] = arr[ia][ib];
  arr[ia][ib] = aux;
}


x86 assembly (clang, -O0):
<matrixSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixSwap>:
movslq %esi,%rax
movslq %ecx,%rcx
lea    (%rax,%rax,4),%rax
shl    $0x4,%rax
add    %rdi,%rax
mov    (%rax,%rcx,4),%esi
movslq %edx,%rdx
mov    (%rax,%rdx,4),%edi
mov    %edi,(%rax,%rcx,4)
mov    %esi,(%rax,%rdx,4)
ret

LLVM IR (-O0):
define void @matrixSwap([20 x i32]* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [20 x i32]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store [20 x i32]* %0, [20 x i32]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load [20 x i32]*, [20 x i32]** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [20 x i32], [20 x i32]* %10, i64 %12
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [20 x i32], [20 x i32]* %13, i64 0, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %9
%18 = load [20 x i32]*, [20 x i32]** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [20 x i32], [20 x i32]* %18, i64 %20
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [20 x i32], [20 x i32]* %21, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = load [20 x i32]*, [20 x i32]** %5
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %26, i64 %28
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [20 x i32], [20 x i32]* %29, i64 0, i64 %31
store i32 %25, i32* %32
%33 = load i32, i32* %9
%34 = load [20 x i32]*, [20 x i32]** %5
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [20 x i32], [20 x i32]* %34, i64 %36
%38 = load i32, i32* %7
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [20 x i32], [20 x i32]* %37, i64 0, i64 %39
store i32 %33, i32* %40
ret void
}

LLVM IR (-O2):
define void @matrixSwap([20 x i32]* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %0, i64 %5, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %0, i64 %5, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
store i32 %8, i32* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_si128(int /*<<< orphan*/, int);
__m128i __mm_slli_si128(__m128i A, int const I) { return _mm_slli_si128(A, 1); }


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

x86 assembly (clang, -O2):
<__mm_slli_si128>:
mov    $0x1,%esi
jmp    1030 <_mm_slli_si128@plt>

LLVM IR (-O0):
define i32 @__mm_slli_si128(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 = call i32 @_mm_slli_si128(i32 %5, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__mm_slli_si128(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_slli_si128(i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getStringLength();
int main(int argc, char const *argv[]) {
  getStringLength();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getStringLength@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @getStringLength()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getStringLength()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void assert_exact(int i) { assert(i == 0); }


x86 assembly (clang, -O0):
<assert_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_exact>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @assert_exact(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @assert_exact(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgcall(char *s) { sgen("%s\t%s", "call", s); }


x86 assembly (clang, -O0):
<cgcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <sgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgcall>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <sgen@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s\09%s\00"
@.str.1 = [5 x i8] c"call\00"
define void @cgcall(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sgen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%s\00"
@.str.1 = [5 x i8] c"call\00"
define void @cgcall(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int rect_width(int rect[2][2]) { return (rect[1][0] - rect[0][0]); }


x86 assembly (clang, -O0):
<rect_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rect_width>:
mov    0x8(%rdi),%eax
sub    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rect_width([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
%3 = load [2 x i32]*, [2 x i32]** %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 1
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = load [2 x i32]*, [2 x i32]** %2
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rect_width([2 x i32]* nocapture %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%5 = load i32, i32* %4
%6 = sub nsw i32 %3, %5
ret i32 %6
}
int main(int argc, const char *argv[]) {
  struct nested_struct {
    int c;
    signed char d;
  };
  struct my_struct {
    int a;
    struct nested_struct b[2];
  };
  struct my_struct array[2] = {{1, {{4, 1}, {6, -1}}}, {2, {{8, 3}, {9, -7}}}};
  return 0;
}


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

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

LLVM IR (-O0):
%struct.my_struct = type { i32, [2 x %struct.nested_struct] }
%struct.nested_struct = type { i32, i8 }
@__const.main.array = [2 x %struct.my_struct] [%struct.my_struct { i32 1, [2 x %struct.nested_struct] [%struct.nested_struct { i32 4, i8 1 }, %struct.nested_struct { i32 6, i8 -1 }] }, %struct.my_struct { i32 2, [2 x %struct.nested_struct] [%struct.nested_struct { i32 8, i8 3 }, %struct.nested_struct { i32 9, i8 -7 }] }]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x %struct.my_struct]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x %struct.my_struct]* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}