xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long next_fibonacci_num();
void next_fibonacci_num_test(void) {
  long num = 0;
  for (size_t i = 0; i < 10; i++)
    num = next_fibonacci_num();
  assert(num == 89);
}


x86 assembly (clang, -O0):
<next_fibonacci_num_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xa,-0x10(%rbp)
jae    115f <next_fibonacci_num_test+0x3f>
mov    $0x0,%al
call   1040 <next_fibonacci_num@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <next_fibonacci_num_test+0x18>
cmpq   $0x59,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_fibonacci_num_test>:
push   %rax
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %eax,%eax
call   1040 <next_fibonacci_num@plt>
xor    %edi,%edi
cmp    $0x59,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @next_fibonacci_num_test() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
br label %3
3: ; preds = %8, %0
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i64 (...) @next_fibonacci_num()
store i64 %7, i64* %1
br label %8
8: ; preds = %6
%9 = load i64, i64* %2
%10 = add i64 %9, 1
store i64 %10, i64* %2
br label %3
11: ; preds = %3
%12 = load i64, i64* %1
%13 = icmp eq i64 %12, 89
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
define void @next_fibonacci_num_test() {
%1 = tail call i64 (...) @next_fibonacci_num()
%2 = tail call i64 (...) @next_fibonacci_num()
%3 = tail call i64 (...) @next_fibonacci_num()
%4 = tail call i64 (...) @next_fibonacci_num()
%5 = tail call i64 (...) @next_fibonacci_num()
%6 = tail call i64 (...) @next_fibonacci_num()
%7 = tail call i64 (...) @next_fibonacci_num()
%8 = tail call i64 (...) @next_fibonacci_num()
%9 = tail call i64 (...) @next_fibonacci_num()
%10 = tail call i64 (...) @next_fibonacci_num()
%11 = icmp eq i64 %10, 89
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ message;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int send_data(int port, char *message) {
  if (send(port, message, sizeof(message), 0) < 0) {
    perror("Send error");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0x0,%rax
jge    1164 <send_data+0x44>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    116b <send_data+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_data>:
push   %rbx
xor    %ebx,%ebx
mov    $0x8,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
test   %rax,%rax
js     1138 <send_data+0x18>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%ebx
jmp    1134 <send_data+0x14>

LLVM IR (-O0):
@.str = [11 x i8] c"Send error\00"
define i32 @send_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = call i64 @send(i32 %6, i8* %7, i32 8, i32 0)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [11 x i8] c"Send error\00"
define i32 @send_data(i32 %0, i8* %1) {
%3 = tail call i64 @send(i32 %0, i8* %1, i32 8, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t flip_uint32_t(uint32_t x) {
  return ((x & 0x000000ff) << 24) | ((x & 0x0000ff00) << 8) |
         ((x & 0x00ff0000) >> 8) | ((x & 0xff000000) >> 24);
}


x86 assembly (clang, -O0):
<flip_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @flip_uint32_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @flip_uint32_t(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void output_destroy(void *untyped) {}


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

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

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

LLVM IR (-O2):
define void @output_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_alloc1(char *);
int /*<<< orphan*/ gen_ddt_write(char *);
int gen_alloc(char *dirname) {
  gen_alloc1(dirname);
  gen_ddt_write(dirname);
  return (0);
}


x86 assembly (clang, -O0):
<gen_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gen_alloc1@plt>
mov    -0x8(%rbp),%rdi
call   1040 <gen_ddt_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_alloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gen_alloc1(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @gen_ddt_write(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_alloc(i8* %0) {
%2 = tail call i32 @gen_alloc1(i8* %0)
%3 = tail call i32 @gen_ddt_write(i8* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ CurrentTime;
int /*<<< orphan*/ False;
int /*<<< orphan*/ None;
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XInternAtom(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ XSetSelectionOwner(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                      int /*<<< orphan*/, int /*<<< orphan*/);
void _DtReleaseLock(Display *display, char *lock_name) {
  Atom lock_atom;
  lock_atom = XInternAtom(display, lock_name, False);
  XSetSelectionOwner(display, lock_atom, None, CurrentTime);
  XFlush(display);
}


x86 assembly (clang, -O0):
<_DtReleaseLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
call   1030 <XInternAtom@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
mov    0x2e78(%rip),%rax
mov    (%rax),%ecx
call   1040 <XSetSelectionOwner@plt>
mov    -0x8(%rbp),%rdi
call   1050 <XFlush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtReleaseLock>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
call   1030 <XInternAtom@plt>
mov    0x2e8f(%rip),%rcx
mov    (%rcx),%edx
mov    0x2e96(%rip),%rcx
mov    (%rcx),%ecx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <XSetSelectionOwner@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <XFlush@plt>

LLVM IR (-O0):
@False = global i32 0
@None = global i32 0
@CurrentTime = global i32 0
define void @_DtReleaseLock(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = load i8*, i8** %4
%8 = load i32, i32* @False
%9 = call i32 @XInternAtom(i32* %6, i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = load i32, i32* @None
%13 = load i32, i32* @CurrentTime
%14 = call i32 @XSetSelectionOwner(i32* %10, i32 %11, i32 %12, i32 %13)
%15 = load i32*, i32** %3
%16 = call i32 @XFlush(i32* %15)
ret void
}

LLVM IR (-O2):
@False = global i32 0
@None = global i32 0
@CurrentTime = global i32 0
define void @_DtReleaseLock(i32* %0, i8* %1) {
%3 = load i32, i32* @False
%4 = tail call i32 @XInternAtom(i32* %0, i8* %1, i32 %3)
%5 = load i32, i32* @None
%6 = load i32, i32* @CurrentTime
%7 = tail call i32 @XSetSelectionOwner(i32* %0, i32 %4, i32 %5, i32 %6)
%8 = tail call i32 @XFlush(i32* %0)
ret void
}
indreg0adr1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*p0) <= (*((short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
mov    $0xa98ac7,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1142 <indreg0adr1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <indreg0adr1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adr1>:
movzwl (%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @indreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = load i16, i16* inttoptr (i64 11111111 to i16*)
%20 = sext i16 %19 to i32
%21 = icmp sle i32 %18, %20
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %24
23: ; preds = %6
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @indreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = load i16, i16* %4
%8 = load i16, i16* inttoptr (i64 11111111 to i16*)
%9 = icmp sle i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, int, size_t, int /*<<< orphan*/ *);
size_t strlen(char const *);
void Write(const char *str, FILE *f) {
  size_t len = strlen(str);
  fwrite(str, 1, len, f);
}


x86 assembly (clang, -O0):
<Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

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

LLVM IR (-O2):
define void @Write(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i32 @fwrite(i8* %0, i32 1, i64 %3, i32* %1)
ret void
}
int IsWriteable(unsigned long pte_flags) { return pte_flags & 2; }


x86 assembly (clang, -O0):
<IsWriteable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsWriteable>:
mov    %rdi,%rax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @IsWriteable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @IsWriteable(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 2
ret i32 %3
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_msg(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *xalloc_array_zero(size_t num, size_t size) {
  void *result = calloc(num, size);
  if (!result) {
    log_msg(1, "calloc failed: %s", strerror(errno));
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<xalloc_array_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1197 <xalloc_array_zero+0x57>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe78(%rip),%rsi
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc_array_zero>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     114d <xalloc_array_zero+0xd>
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9e(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1040 <log_msg@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"calloc failed: %s\00"
@errno = global i32 0
define i8* @xalloc_array_zero(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = call i32 @strerror(i32 %12)
%14 = call i32 @log_msg(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [18 x i8] c"calloc failed: %s\00"
@errno = global i32 0
define noalias i8* @xalloc_array_zero(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @log_msg(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i8* %3
}
int z_time_monthsIntoYear(int Months) { return Months % 12; }


x86 assembly (clang, -O0):
<z_time_monthsIntoYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_time_monthsIntoYear>:
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @z_time_monthsIntoYear(i32 %0) {
%2 = srem i32 %0, 12
ret i32 %2
}
g(int x) { return 2; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x63() {
  Assert_real((isalpha(99)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              500, ("isalpha should be 1 for c"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x63>:
push   %rax
mov    $0x63,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1f4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for c\00"
define void @t_isalpha_0x63() {
%1 = call i32 @isalpha(i32 99)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for c\00"
define void @t_isalpha_0x63() {
%1 = tail call i32 @isalpha(i32 99)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int isinff(float);
int /*<<< orphan*/ printf(char *, int);
int main() {
  float x = 1.0 / 0.0;
  int i = isinff(x);
  if (i == 0)
    abort();
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <isinff@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    116a <main+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xec7(%rip),%xmm0
call   1050 <isinff@plt>
test   %eax,%eax
je     1154 <main+0x24>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
store float 0x7FF0000000000000, float* %2
%4 = load float, float* %2
%5 = call i32 @isinff(float %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isinff(float 0x7FF0000000000000)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int unset_bit(int number, int bit) { return number & ~(1 << bit); }


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

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

LLVM IR (-O0):
define i32 @unset_bit(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @unset_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printarray(int array[], int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printarray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printarray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printarray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printarray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printarray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printarray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void testmod_display_version() { puts("0.1.1"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.1.1\00"
define void @testmod_display_version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.1.1\00"
define void @testmod_display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM8_BRK_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM8_BRK_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM8_BRK_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char getch();
int /*<<< orphan*/ printf(char *);
int getbit() {
  char ch = getch();
  if (ch == '0' || ch == '1')
    return ch - '0';
  else if (ch == 'q') {
    printf(" } ");
    exit(0);
  } else
    return -1;
}


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
je     115c <getbit+0x2c>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    116b <getbit+0x3b>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <getbit+0x62>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    118b <getbit+0x5b>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
push   %rax
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ecx
and    $0xfe,%al
cmp    $0x30,%al
jne    1148 <getbit+0x18>
movzbl %cl,%eax
add    $0xffffffd0,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
cmp    $0x71,%cl
je     1154 <getbit+0x24>
pop    %rcx
ret
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" } \00"
define i32 @getbit() {
%1 = alloca i32
%2 = alloca i8
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 48
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 49
br i1 %10, label %11, label %15
11: ; preds = %7, %0
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %1
br label %23
15: ; preds = %7
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 113
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %15
store i32 -1, i32* %1
br label %23
23: ; preds = %22, %11
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c" } \00"
define i32 @getbit() {
%1 = tail call signext i8 (...) @getch()
%2 = and i8 %1, -2
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = zext i8 %1 to i32
%6 = add nsw i32 %5, -48
br label %12
7: ; preds = %0
%8 = icmp eq i8 %1, 113
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %7, %4
%13 = phi i32 [ %6, %4 ], [ -1, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_address_is_local() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_address_is_local"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_address_is_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_socket_address_is_local\0A\00"
define i32 @pa_socket_address_is_local() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_socket_address_is_local\00"
define i32 @pa_socket_address_is_local() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ effective_convert(int *, int);
int /*<<< orphan*/ free(void *);
scalar_t__ malloc(int);
void prof_effect(void) {
  int *e = (int *)malloc((sizeof(int) * 9973 * 9973));
  for (int c = 0; c < 1000; c++)
    effective_convert(e, 9973);
  free((void *)e);
}


x86 assembly (clang, -O0):
<prof_effect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x17b699e4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1176 <prof_effect+0x46>
mov    -0x8(%rbp),%rdi
mov    $0x26f5,%esi
call   1050 <effective_convert@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <prof_effect+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prof_effect>:
push   %rbp
push   %rbx
push   %rax
mov    $0x17b699e4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x3e8,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    $0x26f5,%esi
call   1050 <effective_convert@plt>
add    $0xffffffff,%ebp
jne    1150 <prof_effect+0x20>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @prof_effect() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i64 @malloc(i32 397842916)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %1
store i32 0, i32* %2
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32*, i32** %1
%10 = call i32 @effective_convert(i32* %9, i32 9973)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = load i32*, i32** %1
%16 = bitcast i32* %15 to i8*
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
define void @prof_effect() {
%1 = tail call i64 @malloc(i32 397842916)
%2 = inttoptr i64 %1 to i32*
br label %6
3: ; preds = %6
%4 = inttoptr i64 %1 to i8*
%5 = tail call i32 @free(i8* %4)
ret void
6: ; preds = %0, %6
%7 = phi i32 [ 0, %0 ], [ %9, %6 ]
%8 = tail call i32 @effective_convert(i32* %2, i32 9973)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 1000
br i1 %10, label %3, label %6
}
/* Type definitions */
struct kref {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kref_set(struct kref *, int);
void kref_init(struct kref *kref) { kref_set(kref, 1); }


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

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

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

LLVM IR (-O2):
%struct.kref = type { i32 }
define void @kref_init(%struct.kref* %0) {
%2 = tail call i32 @kref_set(%struct.kref* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void error(char *mess) { exit(1); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ nvram_get(char const *);
int nvram_unset(char const *);
int nvram_safe_unset(const char *name) {
  int ret = 0;
  if (nvram_get(name)) {
    ret = nvram_unset(name);
  }
  return ret;
}


x86 assembly (clang, -O0):
<nvram_safe_unset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nvram_get@plt>
cmp    $0x0,%rax
je     1152 <nvram_safe_unset+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <nvram_unset@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_safe_unset>:
push   %rbx
mov    %rdi,%rbx
call   1040 <nvram_get@plt>
test   %rax,%rax
je     1137 <nvram_safe_unset+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <nvram_unset@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @nvram_safe_unset(i8* %0) {
%2 = tail call i64 @nvram_get(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @nvram_unset(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(char const, int /*<<< orphan*/ *);
int hputc(int ch, FILE *out) {
  static const char *hex = "0123456789abcdef";
  putc(hex[(ch >> 4) & 0xf], out);
  putc(hex[ch & 0xf], out);
  return 0;
}


x86 assembly (clang, -O0):
<hputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2f02(%rip),%rax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
mov    0x2ee0(%rip),%rax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xed7(%rip),%r15
movsbl (%rax,%r15,1),%edi
call   1030 <putc@plt>
and    $0xf,%ebx
movsbl (%rbx,%r15,1),%edi
mov    %r14,%rsi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@hputc.hex = internal global i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0)
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @hputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i8*, i8** @hputc.hex
%6 = load i32, i32* %3
%7 = ashr i32 %6, 4
%8 = and i32 %7, 15
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
%11 = load i8, i8* %10
%12 = load i32*, i32** %4
%13 = call i32 @putc(i8 signext %11, i32* %12)
%14 = load i8*, i8** @hputc.hex
%15 = load i32, i32* %3
%16 = and i32 %15, 15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = load i32*, i32** %4
%21 = call i32 @putc(i8 signext %19, i32* %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @hputc(i32 %0, i32* nocapture %1) {
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @putc(i8 signext %7, i32* %1)
%9 = and i32 %0, 15
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @putc(i8 signext %12, i32* %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
__attribute__((always_)) uint8_t clamp_byte0(int32_t n) {
  return n < 0 ? 0 : n;
}


x86 assembly (clang, -O0):
<clamp_byte0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    111e <clamp_byte0+0x1e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1126 <clamp_byte0+0x26>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_byte0>:
xor    %eax,%eax
test   %rdi,%rdi
cmovns %rdi,%rax
ret

LLVM IR (-O0):
define i64 @clamp_byte0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i64, i64* %2
br label %8
8: ; preds = %6, %5
%9 = phi i64 [ 0, %5 ], [ %7, %6 ]
ret i64 %9
}

LLVM IR (-O2):
define i64 @clamp_byte0(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = select i1 %2, i64 %0, i64 0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void test_m32_imm32(unsigned int *m32, unsigned int imm32) {
  put8(0xF7);
  put8(0x05);
  put32((unsigned int)m32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<test_m32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
mov    -0xc(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_m32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @test_m32_imm32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 247)
%6 = call i32 @put8(i32 5)
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i32
%9 = call i32 @put32(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @put32(i32 %10)
ret void
}

LLVM IR (-O2):
define void @test_m32_imm32(i32* %0, i32 %1) {
%3 = tail call i32 @put8(i32 247)
%4 = tail call i32 @put8(i32 5)
%5 = ptrtoint i32* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @put32(i32 %6)
%8 = tail call i32 @put32(i32 %1)
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double tan(double x) { return (sin(x) / cos(x)); }


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
%5 = load double, double* %2
%6 = call double @cos(double %5)
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @sin(double %0)
%3 = tail call double @cos(double %0)
%4 = fdiv double %2, %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setscope(pthread_attr_t *__attr, int __scope) {
  ;
  return -1;
}


x86 assembly (clang, -O0):
<pthread_attr_setscope>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pthread_attr_setscope(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret i32 -1
}

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


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

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

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

LLVM IR (-O2):
define void @XAddToSaveSet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage:  %s -i iface\n"
                "\t%s -i iface -r\n",
                getprogname(), getprogname());
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s -i iface\0A\09%s -i iface -r\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i8* (...) @getprogname()
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = load i32, i32* @EX_USAGE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s -i iface\0A\09%s -i iface -r\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i8* (...) @getprogname()
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = load i32, i32* @EX_USAGE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_flag_header();
void fgmvwrite_flag_header_() { gmvwrite_flag_header(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_flag_header_() {
%1 = tail call i32 (...) @gmvwrite_flag_header()
ret void
}
int test_imm_3Auint8_mem(unsigned char *val) {
  return ((*val) & (0x3A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 58
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int read_audio_state(int dev, int field, int chan, float *val) { return (-1); }


x86 assembly (clang, -O0):
<read_audio_state>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read_audio_state(i32 %0, i32 %1, i32 %2, float* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store float* %3, float** %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @read_audio_state(i32 %0, i32 %1, i32 %2, float* nocapture readnone %3) {
ret i32 -1
}
void gtk_settings_get_default() {}


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

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

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

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