xunge/DecIR huggingface dataset:
char *strchr(const char *src, int ch) {
  return ({
    extern __typeof__(strchr) module_libc_strchr;
    &module_libc_strchr;
  })(src, ch);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
jmp    1030 <module_libc_strchr@plt>

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = tail call i8* @module_libc_strchr(i8* %0, i32 %1)
ret i8* %3
}
int compare(const void *a, const void *b) {
  int *x = (int *)a;
  int *y = (int *)b;
  return *x - *y;
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(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 = sub nsw i32 %5, %6
ret i32 %7
}
int count_c(char c, char *s) {
  int cnt = 0;
  while (*s) {
    if (*s++ == c)
      ++cnt;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<count_c>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <count_c+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <count_c+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <count_c+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_c>:
mov    (%rsi),%cl
test   %cl,%cl
je     1126 <count_c+0x26>
add    $0x1,%rsi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %dil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <count_c+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_c(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %6, %0
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
scalar_t__ rope_new();
void *_rope_create() { return (void *)rope_new(); }


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

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

LLVM IR (-O0):
define i8* @_rope_create() {
%1 = call i64 (...) @rope_new()
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @_rope_create() {
%1 = tail call i64 (...) @rope_new()
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
void RAND_egd_bytes(void) {}


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

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

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

LLVM IR (-O2):
define void @RAND_egd_bytes() {
ret void
}
/* Variables and functions */
bool nrf52_errata_144(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_144() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ KaDisp_clear();
int /*<<< orphan*/ KaDisp_scroll_on_off(int /*<<< orphan*/);
int /*<<< orphan*/ SSD1780_init_HW();
void KaDisp_init(void) {
  SSD1780_init_HW();
  KaDisp_scroll_on_off(0);
  KaDisp_clear();
}


x86 assembly (clang, -O0):
<KaDisp_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <SSD1780_init_HW@plt>
xor    %edi,%edi
call   1030 <KaDisp_scroll_on_off@plt>
mov    $0x0,%al
call   1040 <KaDisp_clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<KaDisp_init>:
push   %rax
xor    %eax,%eax
call   1050 <SSD1780_init_HW@plt>
xor    %edi,%edi
call   1030 <KaDisp_scroll_on_off@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <KaDisp_clear@plt>

LLVM IR (-O0):
define void @KaDisp_init() {
%1 = call i32 (...) @SSD1780_init_HW()
%2 = call i32 @KaDisp_scroll_on_off(i32 0)
%3 = call i32 (...) @KaDisp_clear()
ret void
}

LLVM IR (-O2):
define void @KaDisp_init() {
%1 = tail call i32 (...) @SSD1780_init_HW()
%2 = tail call i32 @KaDisp_scroll_on_off(i32 0)
%3 = tail call i32 (...) @KaDisp_clear()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void bury_short(uint8_t *buf, int16_t s) { *(int16_t *)buf = s; }


x86 assembly (clang, -O0):
<bury_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bury_short>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @bury_short(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ mu_badv_if_up(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (mu_badv_if_up(NULL, NULL)) {
    printf("TRUE");
  } else {
    printf("FALSE");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <mu_badv_if_up@plt>
cmp    $0x0,%rax
je     1156 <main+0x36>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
jmp    1162 <main+0x42>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <mu_badv_if_up@plt>
test   %rax,%rax
lea    0xed1(%rip),%rax
lea    0xec5(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @mu_badv_if_up(i32* null, i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i32 @main() {
%1 = tail call i64 @mu_badv_if_up(i32* null, i32* null)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __dos_store_4le(unsigned char *, unsigned int);
void mbr_set_id(unsigned char *b, unsigned int id) {
  __dos_store_4le(&b[440], id);
}


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

x86 assembly (clang, -O2):
<mbr_set_id>:
add    $0x1b8,%rdi
jmp    1030 <__dos_store_4le@plt>

LLVM IR (-O0):
define void @mbr_set_id(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 440
%7 = load i32, i32* %4
%8 = call i32 @__dos_store_4le(i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @mbr_set_id(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 440
%4 = tail call i32 @__dos_store_4le(i8* %3, i32 %1)
ret void
}
void StringEdit(char *EditLine) {}


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

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

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

LLVM IR (-O2):
define void @StringEdit(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ flash_eeprom_read_uint8(int /*<<< orphan*/);
uint8_t read_uint8(uint32_t offset) { return flash_eeprom_read_uint8(offset); }


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

x86 assembly (clang, -O2):
<read_uint8>:
jmp    1030 <flash_eeprom_read_uint8@plt>

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

LLVM IR (-O2):
define i32 @read_uint8(i32 %0) {
%2 = tail call i32 @flash_eeprom_read_uint8(i32 %0)
ret i32 %2
}
void EVP_read_pw_string(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_read_pw_string() {
ret void
}
long oper(long v1, char sign, long v2) {
  switch (sign) {
  case '+':
    return v1 + v2;
  case '-':
    return v1 - v2;
  case '*':
    return v1 * v2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<oper>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
movsbl -0x11(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2a,%eax
je     116b <oper+0x6b>
jmp    1127 <oper+0x27>
mov    -0x24(%rbp),%eax
sub    $0x2b,%eax
je     1149 <oper+0x49>
jmp    1138 <oper+0x38>
mov    -0x24(%rbp),%eax
sub    $0x2d,%eax
je     115a <oper+0x5a>
jmp    117d <oper+0x7d>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <oper+0x85>
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <oper+0x85>
mov    -0x10(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1185 <oper+0x85>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oper>:
mov    %rdx,%rax
cmp    $0x2a,%esi
je     1116 <oper+0x16>
cmp    $0x2d,%esi
je     111b <oper+0x1b>
cmp    $0x2b,%esi
jne    1122 <oper+0x22>
add    %rdi,%rax
ret
imul   %rdi,%rax
ret
sub    %rax,%rdi
mov    %rdi,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @oper(i64 %0, i8 signext %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8
%7 = alloca i64
store i64 %0, i64* %5
store i8 %1, i8* %6
store i64 %2, i64* %7
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
switch i32 %9, label %22 [
i32 43, label %10
i32 45, label %14
i32 42, label %18
]
10: ; preds = %3
%11 = load i64, i64* %5
%12 = load i64, i64* %7
%13 = add nsw i64 %11, %12
store i64 %13, i64* %4
br label %23
14: ; preds = %3
%15 = load i64, i64* %5
%16 = load i64, i64* %7
%17 = sub nsw i64 %15, %16
store i64 %17, i64* %4
br label %23
18: ; preds = %3
%19 = load i64, i64* %5
%20 = load i64, i64* %7
%21 = mul nsw i64 %19, %20
store i64 %21, i64* %4
br label %23
22: ; preds = %3
store i64 0, i64* %4
br label %23
23: ; preds = %22, %18, %14, %10
%24 = load i64, i64* %4
ret i64 %24
}

LLVM IR (-O2):
define i64 @oper(i64 %0, i8 signext %1, i64 %2) {
%4 = sext i8 %1 to i32
switch i32 %4, label %11 [
i32 43, label %5
i32 45, label %7
i32 42, label %9
]
5: ; preds = %3
%6 = add nsw i64 %2, %0
br label %11
7: ; preds = %3
%8 = sub nsw i64 %0, %2
br label %11
9: ; preds = %3
%10 = mul nsw i64 %2, %0
br label %11
11: ; preds = %3, %9, %7, %5
%12 = phi i64 [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ 0, %3 ]
ret i64 %12
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int k, i, j, tmp;
  k = __VERIFIER_nondet_int();
  i = __VERIFIER_nondet_int();
  j = __VERIFIER_nondet_int();
  while (i <= 100 && j <= k) {
    tmp = i;
    i = j;
    j = tmp + 1;
    k = k - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jg     1158 <main+0x48>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1168 <main+0x58>
jmp    118b <main+0x7b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %2
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %3
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %4
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 100
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %18, label %25
18: ; preds = %16
%19 = load i32, i32* %3
store i32 %19, i32* %5
%20 = load i32, i32* %4
store i32 %20, i32* %3
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
%23 = load i32, i32* %2
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %2
br label %9
25: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int bar(int i) {
  int c = 2;
  c &= i > 6;
  return c == 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x6,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 6
%6 = zext i1 %5 to i32
%7 = load i32, i32* %3
%8 = and i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
ret i32 1
}
/* Variables and functions */
short eval_5cards(int, int, int, int, int);
short eval_5hand(int *hand) {
  int c1, c2, c3, c4, c5;
  c1 = *hand++;
  c2 = *hand++;
  c3 = *hand++;
  c4 = *hand++;
  c5 = *hand;
  return (eval_5cards(c1, c2, c3, c4, c5));
}


x86 assembly (clang, -O0):
<eval_5hand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1030 <eval_5cards@plt>
cwtl
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_5hand>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    0x8(%rdi),%edx
mov    0xc(%rdi),%ecx
mov    0x10(%rdi),%r8d
mov    %eax,%edi
jmp    1030 <eval_5cards@plt>

LLVM IR (-O0):
define signext i16 @eval_5hand(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %2
%10 = load i32, i32* %8
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %2
%13 = load i32, i32* %11
store i32 %13, i32* %4
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i32 1
store i32* %15, i32** %2
%16 = load i32, i32* %14
store i32 %16, i32* %5
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %2
%19 = load i32, i32* %17
store i32 %19, i32* %6
%20 = load i32*, i32** %2
%21 = load i32, i32* %20
store i32 %21, i32* %7
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = call signext i16 @eval_5cards(i32 %22, i32 %23, i32 %24, i32 %25, i32 %26)
ret i16 %27
}

LLVM IR (-O2):
define signext i16 @eval_5hand(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %2
%6 = getelementptr inbounds i32, i32* %0, i64 3
%7 = load i32, i32* %4
%8 = getelementptr inbounds i32, i32* %0, i64 4
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = tail call signext i16 @eval_5cards(i32 %3, i32 %5, i32 %7, i32 %9, i32 %10)
ret i16 %11
}
/* Variables and functions */
void *a15(int);
void *a14(int x) { return (((x >> 14) & 1) ? a15(x) : a15(x)); }


x86 assembly (clang, -O0):
<a14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xe,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a14+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a15@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a14+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a15@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a14>:
jmp    1030 <a15@plt>

LLVM IR (-O0):
define i8* @a14(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 14
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a15(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a15(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a14(i32 %0) {
%2 = tail call i8* @a15(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char *);
void check_size(char *name, int setup_secs, int sectors) {
  if (sectors > setup_secs + 1024)
    die("Kernel %s is too big", name);
}


x86 assembly (clang, -O0):
<check_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x400,%ecx
cmp    %ecx,%eax
jle    1146 <check_size+0x36>
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_size>:
add    $0x400,%esi
cmp    %edx,%esi
jge    112c <check_size+0x1c>
mov    %rdi,%rax
lea    0xedc(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <die@plt>
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Kernel %s is too big\00"
define void @check_size(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1024
%10 = icmp sgt i32 %7, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Kernel %s is too big\00"
define void @check_size(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1024
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
double exp_rn(double);
double exp_rd(double x) { return exp_rn(x); }


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

x86 assembly (clang, -O2):
<exp_rd>:
jmp    1030 <exp_rn@plt>

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

LLVM IR (-O2):
define double @exp_rd(double %0) {
%2 = tail call double @exp_rn(double %0)
ret double %2
}
unsigned char SIO1readData8(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @SIO1readData8() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @SIO1readData8() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
printWinner(char W) { printf("Master : %c wins the game", W); }


x86 assembly (clang, -O0):
<printWinner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Master : %c wins the game\00"
define i32 @printWinner(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [26 x i8] c"Master : %c wins the game\00"
define i32 @printWinner(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret i32 undef
}
/* Variables and functions */
int jpg1byte();
int topmkr(void) {
  if (jpg1byte() != 0xff)
    return (0x100);
  return (jpg1byte());
}


x86 assembly (clang, -O0):
<topmkr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <jpg1byte@plt>
cmp    $0xff,%eax
je     1136 <topmkr+0x26>
movl   $0x100,-0x4(%rbp)
jmp    1140 <topmkr+0x30>
mov    $0x0,%al
call   1030 <jpg1byte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<topmkr>:
push   %rax
xor    %eax,%eax
call   1030 <jpg1byte@plt>
cmp    $0xff,%eax
jne    1127 <topmkr+0x17>
xor    %eax,%eax
pop    %rcx
jmp    1030 <jpg1byte@plt>
mov    $0x100,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @topmkr() {
%1 = alloca i32
%2 = call i32 (...) @jpg1byte()
%3 = icmp ne i32 %2, 255
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 256, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @jpg1byte()
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @topmkr() {
%1 = tail call i32 (...) @jpg1byte()
%2 = icmp eq i32 %1, 255
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @jpg1byte()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 256, %0 ]
ret i32 %6
}
int puts(const char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ can_change_color();
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_int(int /*<<< orphan*/);
void cmd_can_change_color(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_int(can_change_color());
}


x86 assembly (clang, -O0):
<cmd_can_change_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_can_change_color+0x27>
jmp    117f <cmd_can_change_color+0x3f>
mov    $0x1,%edi
call   1040 <report_count@plt>
mov    $0x0,%al
call   1050 <can_change_color@plt>
mov    %eax,%edi
call   1060 <report_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_can_change_color>:
push   %rax
xor    %esi,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_can_change_color+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
xor    %eax,%eax
call   1050 <can_change_color@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <report_int@plt>

LLVM IR (-O0):
define void @cmd_can_change_color(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 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @can_change_color()
%12 = call i32 @report_int(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_can_change_color(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @can_change_color()
%8 = tail call i32 @report_int(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
char *__body_init(int /*<<< orphan*/ *, char **, int *);
char *body_init(char **header, int *num_lines) {
  if (num_lines)
    *num_lines = 0;
  return __body_init(NULL, header, num_lines);
}


x86 assembly (clang, -O0):
<body_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1135 <body_init+0x25>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <__body_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<body_init>:
mov    %rsi,%rdx
mov    %rdi,%rsi
test   %rdx,%rdx
je     1121 <body_init+0x11>
movl   $0x0,(%rdx)
xor    %edi,%edi
jmp    1030 <__body_init@plt>

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

LLVM IR (-O2):
define i8* @body_init(i8** %0, i32* %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i32 0, i32* %1
br label %5
5: ; preds = %4, %2
%6 = tail call i8* @__body_init(i32* null, i8** %0, i32* %1)
ret i8* %6
}
int NumberOfOperations(long long i) { return 100; }


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

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

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

LLVM IR (-O2):
define i32 @NumberOfOperations(i64 %0) {
ret i32 100
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stop_fullscreen_stereo();
void all_done(void) {
  stop_fullscreen_stereo();
  exit(0);
}


x86 assembly (clang, -O0):
<all_done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <stop_fullscreen_stereo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<all_done>:
push   %rax
xor    %eax,%eax
call   1030 <stop_fullscreen_stereo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @all_done() {
%1 = call i32 (...) @stop_fullscreen_stereo()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @all_done() {
%1 = tail call i32 (...) @stop_fullscreen_stereo()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __fwritex(void *, size_t, int /*<<< orphan*/ *);
void out(FILE *f, const char *s, size_t l) { __fwritex((void *)s, l, f); }


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

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

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

LLVM IR (-O2):
define void @out(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @__fwritex(i8* %1, i64 %2, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int openPtyMaster(const char *dev) {
  int fd;
  fd = open(dev, O_RDWR);
  if (fd < 0) {
    fprintf(stderr, "Pty open error.\n");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<openPtyMaster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    117a <openPtyMaster+0x4a>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openPtyMaster>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     1145 <openPtyMaster+0x15>
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@stderr = global i32 0
@.str = [17 x i8] c"Pty open error.\0A\00"
define i32 @openPtyMaster(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@stderr = global i32 0
@.str = [17 x i8] c"Pty open error.\0A\00"
define i32 @openPtyMaster(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i32 %3
}
/* Variables and functions */
int popcount_short(int);
int get_bitno(int mask, int i) {
  if (0 == (mask & (1 << i)))
    return -1;
  return popcount_short(mask & ((1 << i) - 1));
}


x86 assembly (clang, -O0):
<get_bitno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x10(%rbp),%ecx
and    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1149 <get_bitno+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <get_bitno+0x53>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
and    %eax,%edi
call   1030 <popcount_short@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bitno>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
bt     %esi,%edi
jae    112a <get_bitno+0x1a>
add    $0xffffffff,%eax
and    %edi,%eax
mov    %eax,%edi
jmp    1030 <popcount_short@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_bitno(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp eq i32 0, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %19
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = shl i32 1, %14
%16 = sub nsw i32 %15, 1
%17 = and i32 %13, %16
%18 = call i32 @popcount_short(i32 %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_bitno(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = add nsw i32 %3, -1
%8 = and i32 %7, %0
%9 = tail call i32 @popcount_short(i32 %8)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ -1, %2 ]
ret i32 %11
}
unsigned char lire_bits(unsigned char x, int p1, int p2) {
  unsigned char mx;
  mx = x >> (p2);
  return (~(~0 << (p1 - p2 + 1))) & mx;
}


x86 assembly (clang, -O0):
<lire_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lire_bits>:
mov    %edx,%ecx
shr    %cl,%edi
sub    %edx,%esi
lea    0x1(%rsi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @lire_bits(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = load i32, i32* %6
%11 = ashr i32 %9, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = shl i32 -1, %16
%18 = xor i32 %17, -1
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
ret i8 %22
}

LLVM IR (-O2):
define zeroext i8 @lire_bits(i8 zeroext %0, i32 %1, i32 %2) {
%4 = zext i8 %0 to i32
%5 = lshr i32 %4, %2
%6 = add i32 %1, 1
%7 = sub i32 %6, %2
%8 = shl nsw i32 -1, %7
%9 = xor i32 %8, -1
%10 = and i32 %5, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex8array_(void *x, unsigned int *n) {
  popNarray((char *)x, (*n * 8));
}


x86 assembly (clang, -O0):
<popcomplex8array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x3,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcomplex8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popcomplex8array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 8
%9 = call i32 @popNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @popcomplex8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int errno;
int *errno_location() { return &errno; }


x86 assembly (clang, -O0):
<errno_location>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errno_location>:
mov    0x2ed9(%rip),%rax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32* @errno_location() {
ret i32* @errno
}

LLVM IR (-O2):
@errno = global i32 0
define i32* @errno_location() {
ret i32* @errno
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void n_cfree(void *ptr) {
  void **pptr = (void **)ptr;
  if (*pptr) {
    free(*pptr);
    *pptr = NULL;
  }
}


x86 assembly (clang, -O0):
<n_cfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1149 <n_cfree+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_cfree>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <n_cfree+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @n_cfree(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = call i32 @free(i8* %11)
%13 = load i8**, i8*** %3
store i8* null, i8** %13
br label %14
14: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @n_cfree(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
store i8* null, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int sscanf(int /*<<< orphan*/, char *, double *);
int /*<<< orphan*/ wcsutil_dot_to_locale(char const *, char *);
int wcsutil_str2double(const char *buf, const char *format, double *value) {
  char ctmp[72];
  return sscanf(wcsutil_dot_to_locale(buf, ctmp), "%lf", value) < 1;
}


x86 assembly (clang, -O0):
<wcsutil_str2double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <wcsutil_dot_to_locale@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rdx
lea    0xeb2(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsutil_str2double>:
push   %rbx
sub    $0x50,%rsp
mov    %rdx,%rbx
mov    %rsp,%rsi
call   1040 <wcsutil_dot_to_locale@plt>
lea    0xec9(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @wcsutil_str2double(i8* %0, i8* %1, double* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca [72 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store double* %2, double** %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%10 = call i32 @wcsutil_dot_to_locale(i8* %8, i8* %9)
%11 = load double*, double** %6
%12 = call i32 @sscanf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %11)
%13 = icmp slt i32 %12, 1
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @wcsutil_str2double(i8* %0, i8* nocapture readnone %1, double* %2) {
%4 = alloca [72 x i8]
%5 = getelementptr inbounds [72 x i8], [72 x i8]* %4, i64 0, i64 0
%6 = call i32 @wcsutil_dot_to_locale(i8* %0, i8* %5)
%7 = call i32 @sscanf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%8 = icmp slt i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
int Operand_ulabel8_ator(unsigned int *valp, unsigned int pc) {
  *valp -= pc;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_ulabel8_ator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_ulabel8_ator>:
sub    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_ulabel8_ator(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sub i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_vect(double **, unsigned long);
void create_identity(double **phi, unsigned long *nvox, unsigned *ext) {
  *ext = 1;
  *nvox = 1;
  do_vect(phi, *nvox);
  *(*phi + 0) = 1.0;
}


x86 assembly (clang, -O0):
<create_identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <do_vect@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_identity>:
push   %rbx
mov    %rdi,%rbx
movl   $0x1,(%rdx)
movq   $0x1,(%rsi)
mov    $0x1,%esi
call   1030 <do_vect@plt>
mov    (%rbx),%rax
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @create_identity(double** %0, i64* %1, i32* %2) {
%4 = alloca double**
%5 = alloca i64*
%6 = alloca i32*
store double** %0, double*** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
store i32 1, i32* %7
%8 = load i64*, i64** %5
store i64 1, i64* %8
%9 = load double**, double*** %4
%10 = load i64*, i64** %5
%11 = load i64, i64* %10
%12 = call i32 @do_vect(double** %9, i64 %11)
%13 = load double**, double*** %4
%14 = load double*, double** %13
%15 = getelementptr inbounds double, double* %14, i64 0
store double 1.000000e+00, double* %15
ret void
}

LLVM IR (-O2):
define void @create_identity(double** %0, i64* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 1, i32* %2
store i64 1, i64* %1
%4 = tail call i32 @do_vect(double** %0, i64 1)
%5 = load double*, double** %0
store double 1.000000e+00, double* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void BinIOSwap2(const uint8_t *src, uint8_t *dst) {
  *(dst + 1) = *(src + 0);
  *(dst + 0) = *(src + 1);
}


x86 assembly (clang, -O0):
<BinIOSwap2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BinIOSwap2>:
mov    (%rdi),%eax
mov    %eax,0x4(%rsi)
mov    0x4(%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @BinIOSwap2(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %7, i32* %9
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @BinIOSwap2(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}