xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ memchr(char const *, char, size_t);
size_t swi_strnlen(const char *str, size_t n) {
  const char *stop = (char *)memchr(str, '\0', n);
  return stop ? stop - str : n;
}


x86 assembly (clang, -O0):
<swi_strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <swi_strnlen+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <swi_strnlen+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swi_strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @swi_strnlen(i8* %0, i64 %1) {
%3 = tail call i64 @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i64 %3, 0
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %3, %5
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
int main() {
  unsigned char arg1 = 0x12;
  unsigned char arg2 = 0x34;
  unsigned char out1 = 0;
  unsigned char out2 = 0;
  __asm__("xaddb %%al, %%cl" : "=a"(out1), "=c"(out2) : "a"(arg1), "c"(arg2));
  return (out1 == 0x34) && (out2 == 0x46);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x12,-0x5(%rbp)
movb   $0x34,-0x6(%rbp)
movb   $0x0,-0x7(%rbp)
movb   $0x0,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    -0x6(%rbp),%cl
xadd   %al,%cl
mov    %al,-0x7(%rbp)
mov    %cl,-0x8(%rbp)
movzbl -0x7(%rbp),%ecx
xor    %eax,%eax
cmp    $0x34,%ecx
mov    %al,-0x9(%rbp)
jne    1149 <main+0x49>
movzbl -0x8(%rbp),%eax
cmp    $0x46,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x12,%al
mov    $0x34,%cl
xadd   %al,%cl
xor    $0x34,%al
xor    $0x46,%cl
xor    %edx,%edx
or     %al,%cl
sete   %dl
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i8 18, i8* %2
store i8 52, i8* %3
store i8 0, i8* %4
store i8 0, i8* %5
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = call { i8, i8 } asm "xaddb %al, %cl", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i8 %6, i8 %7)
%9 = extractvalue { i8, i8 } %8, 0
%10 = extractvalue { i8, i8 } %8, 1
store i8 %9, i8* %4
store i8 %10, i8* %5
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 52
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 70
br label %18
18: ; preds = %14, %0
%19 = phi i1 [ false, %0 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i8, i8 } asm "xaddb %al, %cl", "={ax},={cx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i8 18, i8 52)
%2 = extractvalue { i8, i8 } %1, 0
%3 = extractvalue { i8, i8 } %1, 1
%4 = icmp eq i8 %2, 52
%5 = icmp eq i8 %3, 70
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int set_r_func(int, int);
int replace_instruction(int act_inst, int fcode) {
  return set_r_func(act_inst, fcode);
}


x86 assembly (clang, -O0):
<replace_instruction>:
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 <set_r_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_instruction>:
jmp    1030 <set_r_func@plt>

LLVM IR (-O0):
define i32 @replace_instruction(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 @set_r_func(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @replace_instruction(i32 %0, i32 %1) {
%3 = tail call i32 @set_r_func(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ teste_macros();
int /*<<< orphan*/ teste_mostra_bin();
void main() {
  teste_mostra_bin();
  teste_macros();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @teste_mostra_bin()
%2 = call i32 (...) @teste_macros()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @teste_mostra_bin()
%2 = tail call i32 (...) @teste_macros()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bbm_write(void *, int, int);
scalar_t__ fc8080_channel_select(void *, unsigned char, unsigned char);
int fc8080_audio_select(void *handle, unsigned char subch_id,
                        unsigned char buf_id) {
  if (fc8080_channel_select(handle, subch_id, buf_id) != 0)
    return 1;
  bbm_write(handle, 0x0910 + buf_id, 0x40 | subch_id);
  return 0;
}


x86 assembly (clang, -O0):
<fc8080_audio_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
movzbl %al,%esi
movzbl -0x12(%rbp),%edx
call   1040 <fc8080_channel_select@plt>
cmp    $0x0,%rax
je     1160 <fc8080_audio_select+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1181 <fc8080_audio_select+0x61>
mov    -0x10(%rbp),%rdi
movzbl -0x12(%rbp),%esi
add    $0x910,%esi
movzbl -0x11(%rbp),%edx
or     $0x40,%edx
call   1030 <bbm_write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8080_audio_select>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
call   1040 <fc8080_channel_select@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1158 <fc8080_audio_select+0x38>
movzbl %bl,%esi
add    $0x910,%esi
or     $0x40,%bpl
movzbl %bpl,%edx
mov    %r14,%rdi
call   1030 <bbm_write@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8080_audio_select(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = load i8, i8* %7
%11 = call i64 @fc8080_channel_select(i8* %8, i8 zeroext %9, i8 zeroext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 1, i32* %4
br label %23
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = add nsw i32 2320, %17
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = or i32 64, %20
%22 = call i32 @bbm_write(i8* %15, i32 %18, i32 %21)
store i32 0, i32* %4
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @fc8080_audio_select(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i64 @fc8080_channel_select(i8* %0, i8 zeroext %1, i8 zeroext %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = zext i8 %2 to i32
%8 = add nuw nsw i32 %7, 2320
%9 = or i8 %1, 64
%10 = zext i8 %9 to i32
%11 = tail call i32 @bbm_write(i8* %0, i32 %8, i32 %10)
br label %12
12: ; preds = %3, %6
%13 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %13
}
/* Variables and functions */
void *realloc(void *, size_t);
void *v_realloc(void *ptr, size_t length) { return realloc(ptr, length); }


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

x86 assembly (clang, -O2):
<v_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @v_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @v_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) { die("Usage: build [-b] setup system [rootdev] [> image]"); }


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"Usage: build [-b] setup system [rootdev] [> image]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Usage: build [-b] setup system [rootdev] [> image]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void C_Utils_free_int_ptr(int *item) { free(item); }


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

x86 assembly (clang, -O2):
<C_Utils_free_int_ptr>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @C_Utils_free_int_ptr(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
void RTMemEfReallocNP(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemEfReallocNP() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t byteswap4(uint32_t num) {
  num = ((num & 0xFFFF0000) >> 16) | ((num & 0x0000FFFF) << 16);
  return ((num & 0xFF00FF00) >> 8) | ((num & 0x00FF00FF) << 8);
}


x86 assembly (clang, -O0):
<byteswap4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap4>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @byteswap4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = lshr i32 %4, 16
%6 = load i32, i32* %2
%7 = and i32 %6, 65535
%8 = shl i32 %7, 16
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, -16711936
%12 = lshr i32 %11, 8
%13 = load i32, i32* %2
%14 = and i32 %13, 16711935
%15 = shl i32 %14, 8
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @byteswap4(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void set_led_3(int mode) {
  if (mode == 0) {
    (*(volatile unsigned int *)(0x7F008824)) &= ~4;
  } else {
    (*(volatile unsigned int *)(0x7F008824)) |= 4;
  }
  return;
}


x86 assembly (clang, -O0):
<set_led_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1127 <set_led_3+0x27>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    1138 <set_led_3+0x38>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_led_3>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    0x7f008824,%ecx
and    $0xfffffffb,%ecx
lea    (%rcx,%rax,4),%eax
mov    %eax,0x7f008824
ret

LLVM IR (-O0):
define void @set_led_3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%7 = and i32 %6, -5
store volatile i32 %7, i32* inttoptr (i64 2130741284 to i32*)
br label %11
8: ; preds = %1
%9 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%10 = or i32 %9, 4
store volatile i32 %10, i32* inttoptr (i64 2130741284 to i32*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @set_led_3(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = and i32 %3, -5
%5 = select i1 %2, i32 0, i32 4
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
void ASN1_TIME_check(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_TIME_check() {
ret void
}
void CloseFlexCatCatalog(void) {}


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

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

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

LLVM IR (-O2):
define void @CloseFlexCatCatalog() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ log_msg(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void log_msg_arg1s(FILE *f, char *msg, char *arg1) {
  char buf[128];
  sprintf(buf, msg, arg1);
  log_msg(f, buf);
}


x86 assembly (clang, -O0):
<log_msg_arg1s>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1030 <log_msg@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_msg_arg1s>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <log_msg@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @log_msg_arg1s(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [128 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @sprintf(i8* %8, i8* %9, i8* %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%14 = call i32 @log_msg(i32* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @log_msg_arg1s(i32* %0, i8* nocapture %1, i8* %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) %1, i8* %2)
%7 = call i32 @log_msg(i32* %0, i8* %5)
ret void
}
int self_test(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @self_test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage: 63s-menuc <filename> \n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: 63s-menuc <filename> \0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Usage: 63s-menuc <filename> \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
void ble_rsp_hardware_set_txpower(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_hardware_set_txpower(i8* nocapture %0) {
ret void
}
int fn4(int a, int b, int m) { return (~m & a) | (b & m); }


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn4(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* %6
%8 = xor i32 %7, -1
%9 = load i32, i32* %4
%10 = and i32 %8, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fn4(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
double fcvt(int i, float *fp, double *dp, long *lp) {
  float f = *fp;
  double d = *dp;
  long l = *lp;
  *lp = (long)d;
  *fp = (float)i;
  *dp = (double)l;
  return (double)f;
}


x86 assembly (clang, -O0):
<fcvt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
cvttsd2si -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
cvtsi2ssl -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
cvtsi2sdq -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcvt>:
cvttsd2si (%rdx),%rax
cvtsi2sdq (%rcx),%xmm0
movss  (%rsi),%xmm1
cvtsi2ss %edi,%xmm2
mov    %rax,(%rcx)
movss  %xmm2,(%rsi)
movsd  %xmm0,(%rdx)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fcvt(i32 %0, float* %1, double* %2, i64* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca double*
%8 = alloca i64*
%9 = alloca float
%10 = alloca double
%11 = alloca i64
store i32 %0, i32* %5
store float* %1, float** %6
store double* %2, double** %7
store i64* %3, i64** %8
%12 = load float*, float** %6
%13 = load float, float* %12
store float %13, float* %9
%14 = load double*, double** %7
%15 = load double, double* %14
store double %15, double* %10
%16 = load i64*, i64** %8
%17 = load i64, i64* %16
store i64 %17, i64* %11
%18 = load double, double* %10
%19 = fptosi double %18 to i64
%20 = load i64*, i64** %8
store i64 %19, i64* %20
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to float
%23 = load float*, float** %6
store float %22, float* %23
%24 = load i64, i64* %11
%25 = sitofp i64 %24 to double
%26 = load double*, double** %7
store double %25, double* %26
%27 = load float, float* %9
%28 = fpext float %27 to double
ret double %28
}

LLVM IR (-O2):
define double @fcvt(i32 %0, float* nocapture %1, double* nocapture %2, i64* nocapture %3) {
%5 = load float, float* %1
%6 = load double, double* %2
%7 = load i64, i64* %3
%8 = fptosi double %6 to i64
store i64 %8, i64* %3
%9 = sitofp i32 %0 to float
store float %9, float* %1
%10 = sitofp i64 %7 to double
store double %10, double* %2
%11 = fpext float %5 to double
ret double %11
}
/* Type definitions */
struct catmc_atomic_int_least16_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_int_least16_t *);
void catmc_atomic_int_least16_t_destroy(
    struct catmc_atomic_int_least16_t *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_int_least16_t_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.catmc_atomic_int_least16_t = type { i32 }
define void @catmc_atomic_int_least16_t_destroy(%struct.catmc_atomic_int_least16_t* %0) {
%2 = alloca %struct.catmc_atomic_int_least16_t*
store %struct.catmc_atomic_int_least16_t* %0, %struct.catmc_atomic_int_least16_t** %2
%3 = load %struct.catmc_atomic_int_least16_t*, %struct.catmc_atomic_int_least16_t** %2
%4 = call i32 @free(%struct.catmc_atomic_int_least16_t* %3)
ret void
}

LLVM IR (-O2):
%struct.catmc_atomic_int_least16_t = type { i32 }
define void @catmc_atomic_int_least16_t_destroy(%struct.catmc_atomic_int_least16_t* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_int_least16_t* %0)
ret void
}
void extern_predeclared(void) {}


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

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

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

LLVM IR (-O2):
define void @extern_predeclared() {
ret void
}
char *gdb_dump_state() {}


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

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

LLVM IR (-O0):
define i8* @gdb_dump_state() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @gdb_dump_state() {
ret i8* undef
}
/* Variables and functions */
bool isEmpty(char *block, int size) {
  while (size-- > 0) {
    if (block[size] != 0) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    1145 <isEmpty+0x45>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1140 <isEmpty+0x40>
movl   $0x0,-0x4(%rbp)
jmp    114c <isEmpty+0x4c>
jmp    110b <isEmpty+0xb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1122 <isEmpty+0x22>
cmpb   $0x0,-0x1(%rdi,%rax,1)
lea    -0x1(%rax),%rax
je     1110 <isEmpty+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isEmpty(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 %6
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %13
13: ; preds = %4, %9
%14 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %14
}
int addition(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<addition>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addition(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addition(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int do_it(char const *, int /*<<< orphan*/,
          int (*)(char const *, struct stat64 const *, int), int,
          int /*<<< orphan*/);
int ftw64(const char *path,
          int (*fcb)(const char *, const struct stat64 *, int),
          int descriptors) {
  return do_it(path, 0, fcb, descriptors, 0);
}


x86 assembly (clang, -O0):
<ftw64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
mov    %r8d,%esi
call   1030 <do_it@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftw64>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
xor    %r8d,%r8d
jmp    1030 <do_it@plt>

LLVM IR (-O0):
%struct.stat64 = type opaque
%struct.stat64.0 = type opaque
define i32 @ftw64(i8* %0, i32 (i8*, %struct.stat64*, i32)* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32 (i8*, %struct.stat64*, i32)*
%6 = alloca i32
store i8* %0, i8** %4
store i32 (i8*, %struct.stat64*, i32)* %1, i32 (i8*, %struct.stat64*, i32)** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32 (i8*, %struct.stat64*, i32)*, i32 (i8*, %struct.stat64*, i32)** %5
%9 = bitcast i32 (i8*, %struct.stat64*, i32)* %8 to i32 (i8*, %struct.stat64.0*, i32)*
%10 = load i32, i32* %6
%11 = call i32 @do_it(i8* %7, i32 0, i32 (i8*, %struct.stat64.0*, i32)* %9, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
%struct.stat64 = type opaque
%struct.stat64.0 = type opaque
define i32 @ftw64(i8* %0, i32 (i8*, %struct.stat64*, i32)* %1, i32 %2) {
%4 = bitcast i32 (i8*, %struct.stat64*, i32)* %1 to i32 (i8*, %struct.stat64.0*, i32)*
%5 = tail call i32 @do_it(i8* %0, i32 0, i32 (i8*, %struct.stat64.0*, i32)* %4, i32 %2, i32 0)
ret i32 %5
}
void pok_kernel_restart(void) {}


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

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

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

LLVM IR (-O2):
define void @pok_kernel_restart() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("M=%d\n", 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"M=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int *foo();
int main() {
  int *q = foo();
  __CRAB_assert(*q >= 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x5,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
xor    %edi,%edi
cmpl   $0x5,(%rax)
setge  %dil
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* (...) @foo()
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 5
%7 = zext i1 %6 to i32
%8 = call i32 @__CRAB_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @foo()
%2 = load i32, i32* %1
%3 = icmp sgt i32 %2, 4
%4 = zext i1 %3 to i32
%5 = tail call i32 @__CRAB_assert(i32 %4)
ret i32 0
}
unsigned char reverse_bits_in_byte(unsigned char x) {
  unsigned int i;
  unsigned char y = 0;
  for (i = 0; i <= 7; i++) {
    if (x & (1 << i))
      y |= (1 << (7 - i));
  }
  return y;
}


x86 assembly (clang, -O0):
<reverse_bits_in_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
ja     1167 <reverse_bits_in_byte+0x67>
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1154 <reverse_bits_in_byte+0x54>
mov    $0x7,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
jmp    1159 <reverse_bits_in_byte+0x59>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <reverse_bits_in_byte+0x15>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_bits_in_byte>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @reverse_bits_in_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %4
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %3
%7 = icmp ule i32 %6, 7
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = load i32, i32* %3
%12 = shl i32 1, %11
%13 = and i32 %10, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %8
%16 = load i32, i32* %3
%17 = sub i32 7, %16
%18 = shl i32 1, %17
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %20, %18
%22 = trunc i32 %21 to i8
store i8 %22, i8* %4
br label %23
23: ; preds = %15, %8
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i8, i8* %4
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @reverse_bits_in_byte(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long long ts_usec(struct timespec *);
unsigned long long now_usec(void) {
  struct timespec ts;
  if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0)
    return 0;
  return ts_usec(&ts);
}


x86 assembly (clang, -O0):
<now_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1151 <now_usec+0x31>
movq   $0x0,-0x8(%rbp)
jmp    115e <now_usec+0x3e>
lea    -0x10(%rbp),%rdi
call   1040 <ts_usec@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now_usec>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
test   %rax,%rax
je     113b <now_usec+0x1b>
xor    %eax,%eax
pop    %rcx
ret
mov    %rsp,%rdi
call   1040 <ts_usec@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @now_usec() {
%1 = alloca i64
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i64 0, i64* %1
br label %9
7: ; preds = %0
%8 = call i64 @ts_usec(%struct.timespec* %2)
store i64 %8, i64* %1
br label %9
9: ; preds = %7, %6
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @now_usec() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i64 @ts_usec(%struct.timespec* %1)
br label %8
8: ; preds = %0, %6
%9 = phi i64 [ %7, %6 ], [ 0, %0 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void print_add(int lit) { printf("%d%s", lit, lit == 0 ? "\n" : " "); }


x86 assembly (clang, -O0):
<print_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xedf(%rip),%rdx
lea    0xed6(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_add>:
mov    %edi,%esi
test   %edi,%edi
lea    0xeea(%rip),%rax
lea    0xee5(%rip),%rdx
cmove  %rax,%rdx
lea    0xed3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c" \00"
define void @print_add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c" \00"
define void @print_add(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_57(int /*<<< orphan*/);
int gen_57() { handle_57(0); }


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

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

LLVM IR (-O0):
define i32 @gen_57() {
%1 = alloca i32
%2 = call i32 @handle_57(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_57() {
%1 = tail call i32 @handle_57(i32 0)
ret i32 undef
}
char **null_get_channel(void) { return 0; }


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

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

LLVM IR (-O0):
define i8** @null_get_channel() {
ret i8** null
}

LLVM IR (-O2):
define noalias i8** @null_get_channel() {
ret i8** null
}
int sem_destroy() {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sem_destroy() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_isdigit(char);
int /*<<< orphan*/ ft_putendl(char *);
int check_indirect(char *param) {
  while (*param) {
    if (!ft_isdigit(*param))
      ft_putendl("Invalid indirect number.");
    param++;
  }
  return (4);
}


x86 assembly (clang, -O0):
<check_indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <check_indirect+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <ft_isdigit@plt>
cmp    $0x0,%eax
jne    115a <check_indirect+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <ft_putendl@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <check_indirect+0xc>
mov    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_indirect>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1161 <check_indirect+0x41>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xec8(%rip),%r14
jmp    114b <check_indirect+0x2b>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1161 <check_indirect+0x41>
movsbl %al,%edi
call   1040 <ft_isdigit@plt>
test   %eax,%eax
jne    1140 <check_indirect+0x20>
mov    %r14,%rdi
call   1030 <ft_putendl@plt>
jmp    1140 <check_indirect+0x20>
mov    $0x4,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Invalid indirect number.\00"
define i32 @check_indirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %14, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @ft_isdigit(i8 signext %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = call i32 @ft_putendl(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %3
17: ; preds = %3
ret i32 4
}

LLVM IR (-O2):
@.str = [25 x i8] c"Invalid indirect number.\00"
define i32 @check_indirect(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = tail call i32 @ft_isdigit(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i32 4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int print(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t, char const *,
          int /*<<< orphan*/);
int vfprintf(FILE *file, const char *format, va_list ap) {
  int rv;
  rv = print(file, NULL, ~(size_t)0, format, ap);
  return rv;
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%esi
mov    $0xffffffffffffffff,%rdx
call   1030 <print@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0xffffffffffffffff,%rdx
jmp    1030 <print@plt>

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

LLVM IR (-O2):
define i32 @vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @print(i32* %0, i32* null, i64 -1, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ assert(int);
int sysconf(int /*<<< orphan*/);
size_t page_size(void) {
  int r = sysconf(_SC_PAGESIZE);
  assert(r > 0);
  return r;
}


x86 assembly (clang, -O0):
<page_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0x4(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_size>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1030 <assert@plt>
movslq %ebx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i64 @page_size() {
%1 = alloca i32
%2 = load i32, i32* @_SC_PAGESIZE
%3 = call i32 @sysconf(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i64 @page_size() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i32 @sysconf(i32 %1)
%3 = icmp sgt i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = sext i32 %2 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ call6e(float, double, unsigned char, unsigned short,
                          unsigned int, unsigned long);
void call6d(long l, float f, double d, unsigned char uc, unsigned short us,
            unsigned int ui, unsigned long ul) {
  l = l;
  call6e(f, d, uc, us, ui, ul);
}


x86 assembly (clang, -O0):
<call6d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dx,%ax
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %dl,-0x19(%rbp)
mov    %ax,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x19(%rbp),%sil
mov    -0x1c(%rbp),%ax
mov    -0x20(%rbp),%edx
mov    -0x28(%rbp),%rcx
movzbl %sil,%edi
movzwl %ax,%esi
call   1030 <call6e@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6d>:
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8,%rcx
jmp    1030 <call6e@plt>

LLVM IR (-O0):
define void @call6d(i64 %0, float %1, double %2, i8 zeroext %3, i16 zeroext %4, i32 %5, i64 %6) {
%8 = alloca i64
%9 = alloca float
%10 = alloca double
%11 = alloca i8
%12 = alloca i16
%13 = alloca i32
%14 = alloca i64
store i64 %0, i64* %8
store float %1, float* %9
store double %2, double* %10
store i8 %3, i8* %11
store i16 %4, i16* %12
store i32 %5, i32* %13
store i64 %6, i64* %14
%15 = load i64, i64* %8
store i64 %15, i64* %8
%16 = load float, float* %9
%17 = load double, double* %10
%18 = load i8, i8* %11
%19 = load i16, i16* %12
%20 = load i32, i32* %13
%21 = load i64, i64* %14
%22 = call i32 @call6e(float %16, double %17, i8 zeroext %18, i16 zeroext %19, i32 %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @call6d(i64 %0, float %1, double %2, i8 zeroext %3, i16 zeroext %4, i32 %5, i64 %6) {
%8 = tail call i32 @call6e(float %1, double %2, i8 zeroext %3, i16 zeroext %4, i32 %5, i64 %6)
ret void
}
int move_to_undo(u, start, lump)
register struct undostack *u;
int start, lump;
{ return pushmem(u, start, lump) && uputcmd(u, lump, start, 'M'); }


x86 assembly (clang, -O0):
<move_to_undo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1030 <pushmem@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1172 <move_to_undo+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x4d,%ecx
mov    $0x0,%al
call   1040 <uputcmd@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_to_undo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <pushmem@plt>
test   %eax,%eax
je     1159 <move_to_undo+0x39>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    $0x4d,%ecx
xor    %eax,%eax
call   1040 <uputcmd@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.undostack = type opaque
define i32 @move_to_undo(%struct.undostack* %0, i32 %1, i32 %2) {
%4 = alloca %struct.undostack*
%5 = alloca i32
%6 = alloca i32
store %struct.undostack* %0, %struct.undostack** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.undostack*, %struct.undostack** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (%struct.undostack*, i32, i32, ...) bitcast (i32 (...)* @pushmem to i32 (%struct.undostack*, i32, i32, ...)*)(%struct.undostack* %7, i32 %8, i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load %struct.undostack*, %struct.undostack** %4
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = call i32 (%struct.undostack*, i32, i32, i32, ...) bitcast (i32 (...)* @uputcmd to i32 (%struct.undostack*, i32, i32, i32, ...)*)(%struct.undostack* %13, i32 %14, i32 %15, i32 77)
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %12, %3
%19 = phi i1 [ false, %3 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
%struct.undostack = type opaque
define i32 @move_to_undo(%struct.undostack* %0, i32 %1, i32 %2) {
%4 = tail call i32 (%struct.undostack*, i32, i32, ...) bitcast (i32 (...)* @pushmem to i32 (%struct.undostack*, i32, i32, ...)*)(%struct.undostack* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (%struct.undostack*, i32, i32, i32, ...) bitcast (i32 (...)* @uputcmd to i32 (%struct.undostack*, i32, i32, i32, ...)*)(%struct.undostack* %0, i32 %2, i32 %1, i32 77)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}