xunge/DecIR huggingface dataset:
void termop_settab(struct ansiseq *s) {
  tnc_log_log(
      7, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c",
      424, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_settab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1a8,%r8d
lea    0xf37(%rip),%r9
lea    0xf3e(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_settab>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf65(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1a8,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_settab = [14 x i8] c"termop_settab\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_settab(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 424, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_settab, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_settab = [14 x i8] c"termop_settab\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_settab(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 424, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_settab, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void om_text_print_header(FILE *fp) { (void)fp; }


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

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

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

LLVM IR (-O2):
define void @om_text_print_header(i32* nocapture %0) {
ret void
}
void f_command(unsigned int j) {}


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

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

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

LLVM IR (-O2):
define void @f_command(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_header(void *, void *);
int process_method_unsupported(void *p_req, void *p_res) {
  process_header(p_req, p_res);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @process_method_unsupported(i8* %0, i8* %1) {
%3 = tail call i32 @process_header(i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_memory_usage(void) { fflush(stderr); }


x86 assembly (clang, -O0):
<print_memory_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_memory_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @print_memory_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @print_memory_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_flag;

/* Variables and functions */
int /*<<< orphan*/ ATOMIC_FLAG_INIT;
int /*<<< orphan*/ atomic_flag_clear_explicit(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/);
int /*<<< orphan*/ atomic_flag_test_and_set_explicit(int /*<<< orphan*/ *,
                                                     int /*<<< orphan*/);
int /*<<< orphan*/ memory_order_acquire;
int /*<<< orphan*/ memory_order_release;
int main() {
  atomic_flag af = ATOMIC_FLAG_INIT;
  if (!atomic_flag_test_and_set_explicit(&af, memory_order_acquire))
    atomic_flag_clear_explicit(&af, memory_order_release);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
call   1040 <atomic_flag_test_and_set_explicit@plt>
cmp    $0x0,%eax
jne    1168 <main+0x48>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
call   1030 <atomic_flag_clear_explicit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1040 <atomic_flag_test_and_set_explicit@plt>
test   %eax,%eax
jne    1158 <main+0x38>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1030 <atomic_flag_clear_explicit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ATOMIC_FLAG_INIT = global i32 0
@memory_order_acquire = global i32 0
@memory_order_release = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @ATOMIC_FLAG_INIT
store i32 %3, i32* %2
%4 = load i32, i32* @memory_order_acquire
%5 = call i32 @atomic_flag_test_and_set_explicit(i32* %2, i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i32, i32* @memory_order_release
%9 = call i32 @atomic_flag_clear_explicit(i32* %2, i32 %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@ATOMIC_FLAG_INIT = global i32 0
@memory_order_acquire = global i32 0
@memory_order_release = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @ATOMIC_FLAG_INIT
store i32 %3, i32* %1
%4 = load i32, i32* @memory_order_acquire
%5 = call i32 @atomic_flag_test_and_set_explicit(i32* %1, i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* @memory_order_release
%9 = call i32 @atomic_flag_clear_explicit(i32* %1, i32 %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}
int _is_hexdigit(char c) {
  return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
          (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<_is_hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <_is_hexdigit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <_is_hexdigit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <_is_hexdigit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <_is_hexdigit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <_is_hexdigit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_hexdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_is_hexdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @_is_hexdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int pthread_rwlock_destroy(pthread_rwlock_t *lock) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_rwlock_destroy(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ recvfrom(int, void *, size_t, int /*<<< orphan*/,
                            struct sockaddr *, int *);
ssize_t udp_read(int fd, void *buffer, size_t count, struct sockaddr_in *addr) {
  socklen_t len = sizeof(*addr);
  return recvfrom(fd, buffer, count, 0, (struct sockaddr *)addr, &len);
}


x86 assembly (clang, -O0):
<udp_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
xor    %ecx,%ecx
lea    -0x24(%rbp),%r9
call   1030 <recvfrom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_read>:
push   %rax
mov    %rcx,%r8
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%r9
xor    %ecx,%ecx
call   1030 <recvfrom@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @udp_read(i32 %0, i8* %1, i64 %2, %struct.sockaddr_in* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.sockaddr_in*
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.sockaddr_in* %3, %struct.sockaddr_in** %8
store i32 4, i32* %9
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load %struct.sockaddr_in*, %struct.sockaddr_in** %8
%14 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%15 = call i32 @recvfrom(i32 %10, i8* %11, i64 %12, i32 0, %struct.sockaddr* %14, i32* %9)
ret i32 %15
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @udp_read(i32 %0, i8* %1, i64 %2, %struct.sockaddr_in* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 4, i32* %5
%7 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%8 = call i32 @recvfrom(i32 %0, i8* %1, i64 %2, i32 0, %struct.sockaddr* %7, i32* %5)
ret i32 %8
}
void posix_class2P_DIGIT() {}


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

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

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

LLVM IR (-O2):
define void @posix_class2P_DIGIT() {
ret void
}
double py_one2d(double x, double y) {
  (void)x;
  (void)y;
  return 1.0;
}


x86 assembly (clang, -O0):
<py_one2d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<py_one2d>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @py_one2d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @py_one2d(double %0, double %1) {
ret double 1.000000e+00
}
int empty(char *s) {
  char *p;
  for (p = s; *p; p++) {
    if (!(*p == ' ' || *p == '\t' || *p == '\n'))
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116f <empty+0x6f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1159 <empty+0x59>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1159 <empty+0x59>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1159 <empty+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1176 <empty+0x76>
jmp    115e <empty+0x5e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <empty+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
jmp    1114 <empty+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%eax
lea    -0x9(%rax),%ecx
cmp    $0x2,%cl
jb     1110 <empty+0x10>
cmp    $0x20,%al
je     1110 <empty+0x10>
test   %al,%al
jne    112d <empty+0x2d>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @empty(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 32, label %5
i8 9, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
void g_io_channel_set_buffered() {}


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

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

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

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

/* Variables and functions */
unsigned char *blake2b_file(unsigned char *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned char *hash_file_blake2b(unsigned char *out, FILE *fp) {
  return blake2b_file(out, fp, NULL, 0);
}


x86 assembly (clang, -O0):
<hash_file_blake2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <blake2b_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_file_blake2b>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <blake2b_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_blake2b(i8* %0, i32* %1) {
%3 = tail call i8* @blake2b_file(i8* %0, i32* %1, i32* null, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
void handler() {
  printf("接收到SIGALRM信号\n");
  signal(SIGALRM, handler);
  alarm(5);
  printf("over\n");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rsi
call   1050 <signal@plt>
mov    $0x5,%edi
call   1040 <alarm@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    0x2e93(%rip),%rsi
call   1050 <signal@plt>
mov    $0x5,%edi
call   1040 <alarm@plt>
lea    0xeb4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\E6\8E\A5\E6\94\B6\E5\88\B0SIGALRM\E4\BF\A1\E5\8F\B7\0A\00"
@SIGALRM = global i32 0
@.str.1 = [6 x i8] c"over\0A\00"
define void @handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIGALRM
%3 = call i32 @signal(i32 %2, void (...)* bitcast (void ()* @handler to void (...)*))
%4 = call i32 @alarm(i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@str = [23 x i8] c"\E6\8E\A5\E6\94\B6\E5\88\B0SIGALRM\E4\BF\A1\E5\8F\B7\00"
@str.2 = [5 x i8] c"over\00"
define void @handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @SIGALRM
%3 = tail call i32 @signal(i32 %2, void (...)* bitcast (void ()* @handler to void (...)*))
%4 = tail call i32 @alarm(i32 5)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ batwarn_set_gamma(double);
void exit_cb(void) { batwarn_set_gamma(1.0); }


x86 assembly (clang, -O0):
<exit_cb>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <batwarn_set_gamma@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_cb>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <batwarn_set_gamma@plt>

LLVM IR (-O0):
define void @exit_cb() {
%1 = call i32 @batwarn_set_gamma(double 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @exit_cb() {
%1 = tail call i32 @batwarn_set_gamma(double 1.000000e+00)
ret void
}
int checkAlphaStr(const char *str) {
  if (str == ((void *)0))
    return 0;
  for (; *str != '\0'; ++str) {
    if (isalpha(*str))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkAlphaStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <checkAlphaStr+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1186 <checkAlphaStr+0x76>
jmp    1138 <checkAlphaStr+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117f <checkAlphaStr+0x6f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
je     1169 <checkAlphaStr+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1186 <checkAlphaStr+0x76>
jmp    116e <checkAlphaStr+0x5e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <checkAlphaStr+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkAlphaStr>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     114e <checkAlphaStr+0x3e>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     114e <checkAlphaStr+0x3e>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isalpha@plt>
test   %eax,%eax
jne    1149 <checkAlphaStr+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <checkAlphaStr+0x20>
jmp    114e <checkAlphaStr+0x3e>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @checkAlphaStr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %9
6: ; preds = %9
%7 = load i8, i8* %15
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %3, %6
%10 = phi i8 [ %7, %6 ], [ %4, %3 ]
%11 = phi i8* [ %15, %6 ], [ %0, %3 ]
%12 = sext i8 %10 to i32
%13 = tail call i32 @isalpha(i32 %12)
%14 = icmp eq i32 %13, 0
%15 = getelementptr inbounds i8, i8* %11, i64 1
br i1 %14, label %6, label %16
16: ; preds = %9, %6, %3, %1
%17 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %9 ], [ 0, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo();
int main(void) {
  if (foo())
    abort();
  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>
cmp    $0x0,%rax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int _getmpeg2frame(unsigned char *, int);
int getmpeg2frameGray(unsigned char *rgb) { return _getmpeg2frame(rgb, 1); }


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

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

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

LLVM IR (-O2):
define i32 @getmpeg2frameGray(i8* %0) {
%2 = tail call i32 @_getmpeg2frame(i8* %0, i32 1)
ret i32 %2
}
int greatest_common_divisor(int ival1, int ival2) { return -1; }


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

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

LLVM IR (-O0):
define i32 @greatest_common_divisor(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 @greatest_common_divisor(i32 %0, i32 %1) {
ret i32 -1
}
int power(int q) {
  int i, res = 1;
  for (i = 1; i <= q; i++) {
    res = -1 * res;
  }
  return res;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1139 <power+0x39>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <power+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
mov    $0x1,%eax
test   %edi,%edi
jle    114b <power+0x4b>
lea    -0x1(%rdi),%edx
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%edx
jb     1125 <power+0x25>
and    $0xfffffff8,%edi
nopl   0x0(%rax)
add    $0xfffffff8,%edi
jne    1120 <power+0x20>
test   %ecx,%ecx
je     114b <power+0x4b>
mov    $0x1,%edx
mov    $0xffffffff,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %esi,%eax
mov    %edx,%esi
mov    %eax,%edx
add    $0xffffffff,%ecx
jne    1140 <power+0x40>
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %21, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 0, %7 ], [ %11, %9 ]
%11 = add i32 %10, 8
%12 = icmp eq i32 %11, %8
br i1 %12, label %13, label %9
13: ; preds = %9, %3
%14 = icmp eq i32 %5, 0
br i1 %14, label %21, label %15
15: ; preds = %13, %15
%16 = phi i32 [ %17, %15 ], [ -1, %13 ]
%17 = phi i32 [ %16, %15 ], [ 1, %13 ]
%18 = phi i32 [ %19, %15 ], [ 0, %13 ]
%19 = add i32 %18, 1
%20 = icmp eq i32 %19, %5
br i1 %20, label %21, label %15
21: ; preds = %13, %15, %1
%22 = phi i32 [ 1, %1 ], [ 1, %13 ], [ %16, %15 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ print_greetings();
void local_print_greetings(void) { print_greetings(); }


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

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

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

LLVM IR (-O2):
define void @local_print_greetings() {
%1 = tail call i32 (...) @print_greetings()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ test;

/* Variables and functions */
int /*<<< orphan*/ hexlog(char const *, int);
int main(int argc, const char *argv[]) {
  const char test[] = "blah foo bar \001 \002 doh shoo na ba fi \003";
  hexlog(test, sizeof(test));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x3206966206162,%rax
mov    %rax,0x1d(%rsp)
mov    %rsp,%rdi
mov    $0x25,%esi
call   1030 <hexlog@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.test = [37 x i8] c"blah foo bar \01 \02 doh shoo na ba fi \03\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [37 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [37 x i8]* %6 to i8*
%8 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 0
%9 = call i32 @hexlog(i8* %8, i32 37)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [37 x i8] c"blah foo bar \01 \02 doh shoo na ba fi \03\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [37 x i8]
%4 = getelementptr inbounds [37 x i8], [37 x i8]* %3, i64 0, i64 0
%5 = call i32 @hexlog(i8* %4, i32 37)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ethash_h256 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha3_256(int /*<<< orphan*/ *, int,
                            int /*<<< orphan*/ const *, size_t const);
void SHA3_256(struct ethash_h256 const *ret, uint8_t const *data,
              size_t const size) {
  sha3_256((uint8_t *)ret, 32, data, size);
}


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

x86 assembly (clang, -O2):
<SHA3_256>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x20,%esi
jmp    1030 <sha3_256@plt>

LLVM IR (-O0):
%struct.ethash_h256 = type { i32 }
define void @SHA3_256(%struct.ethash_h256* %0, i32* %1, i64 %2) {
%4 = alloca %struct.ethash_h256*
%5 = alloca i32*
%6 = alloca i64
store %struct.ethash_h256* %0, %struct.ethash_h256** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load %struct.ethash_h256*, %struct.ethash_h256** %4
%8 = bitcast %struct.ethash_h256* %7 to i32*
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = call i32 @sha3_256(i32* %8, i32 32, i32* %9, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.ethash_h256 = type { i32 }
define void @SHA3_256(%struct.ethash_h256* %0, i32* %1, i64 %2) {
%4 = getelementptr %struct.ethash_h256, %struct.ethash_h256* %0, i64 0, i32 0
%5 = tail call i32 @sha3_256(i32* %4, i32 32, i32* %1, i64 %2)
ret void
}
int test_imm_6Buint16_mem(unsigned short *val) {
  return ((*val) & (-0x6B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_6Buint16_mem>:
movzwl (%rdi),%eax
test   $0xff95,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Buint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -107
%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_6Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -107
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t mem_vc2arm(const uint32_t address) { return address & ~0xC0000000; }


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

x86 assembly (clang, -O2):
<mem_vc2arm>:
mov    %edi,%eax
and    $0x3fffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @mem_vc2arm(i32 %0) {
%2 = and i32 %0, 1073741823
ret i32 %2
}
int get_preuse_bit(int address) { return ((int)(address % 4) / 2); }


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

x86 assembly (clang, -O2):
<get_preuse_bit>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfc,%eax
sub    %eax,%edi
mov    %edi,%eax
shr    $0x7,%al
add    %dil,%al
sar    %al
movsbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @get_preuse_bit(i32 %0) {
%2 = srem i32 %0, 4
%3 = trunc i32 %2 to i8
%4 = sdiv i8 %3, 2
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void geq_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a>=b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<geq_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee9(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<geq_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a>=b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @geq_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a>=b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @geq_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
void anc_max14744_stop_charge(void) { return; }


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

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

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

LLVM IR (-O2):
define void @anc_max14744_stop_charge() {
ret void
}
int align_head(int order) { return (1 << order) - 1; }


x86 assembly (clang, -O0):
<align_head>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_head>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @align_head(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @align_head(i32 %0) {
%2 = shl nsw i32 -1, %0
%3 = xor i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[], char *envp[]) {
  int local0;
  int o2;
  printf("Input number: ");
  scanf("%d", &local0);
  fib(local0);
  printf("fibonacci(%d) = %d\n", local0, o2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%edi
call   1050 <fib@plt>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fib@plt>
mov    0x4(%rsp),%esi
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Input number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"fibonacci(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%12 = load i32, i32* %8
%13 = call i32 @fib(i32 %12)
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Input number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"fibonacci(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = load i32, i32* %4
%9 = call i32 @fib(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("-h            print this help and exit\n"
         "-p <num>      TCP port number to listen on (default: 11211)\n"
         "-t <num>      number of threads to use (default: 4)\n"
         "-v            verbose (print errors/warnings while in event loop)\n"
         "-vv           very verbose (also print client commands/reponses)\n"
         "-vvv          extremely verbose (also print internal state "
         "transitions)\n");
  return;
}


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 = [355 x i8] c"-h print this help and exit\0A-p <num> TCP port number to listen on (default: 11211)\0A-t <num> number of threads to use (default: 4)\0A-v verbose (print errors/warnings while in event loop)\0A-vv very verbose (also print client commands/reponses)\0A-vvv extremely verbose (also print internal state transitions)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([355 x i8], [355 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [354 x i8] c"-h print this help and exit\0A-p <num> TCP port number to listen on (default: 11211)\0A-t <num> number of threads to use (default: 4)\0A-v verbose (print errors/warnings while in event loop)\0A-vv very verbose (also print client commands/reponses)\0A-vvv extremely verbose (also print internal state transitions)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([354 x i8], [354 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ llib_led_malloc(int);
unsigned char *mema(int align, int size) {
  unsigned char *z = (unsigned char *)llib_led_malloc(align + size);
  return z + align - (unsigned long)(z) % align;
}


x86 assembly (clang, -O0):
<mema>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
call   1030 <llib_led_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mema>:
push   %rbx
mov    %edi,%ebx
lea    (%rsi,%rbx,1),%edi
call   1030 <llib_led_malloc@plt>
movslq %ebx,%rsi
lea    (%rax,%rsi,1),%rcx
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1135 <mema+0x25>
xor    %edx,%edx
div    %rsi
jmp    1139 <mema+0x29>
xor    %edx,%edx
div    %ebx
sub    %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mema(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = call i64 @llib_led_malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8*, i8** %5
%16 = ptrtoint i8* %15 to i64
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = urem i64 %16, %18
%20 = sub i64 0, %19
%21 = getelementptr inbounds i8, i8* %14, i64 %20
ret i8* %21
}

LLVM IR (-O2):
define i8* @mema(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i64 @llib_led_malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = urem i64 %4, %6
%9 = sub i64 0, %8
%10 = getelementptr inbounds i8, i8* %7, i64 %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void calc3_error(int regs[26], int *base, const char *s) {
  fprintf(stderr, "%s\n", s);
}


x86 assembly (clang, -O0):
<calc3_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc3_error>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @calc3_error(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %6
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @calc3_error(i32* nocapture readnone %0, i32* nocapture readnone %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int size(int w, int h) { return w * h; }


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

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

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

LLVM IR (-O2):
define i32 @size(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int lrand48();
int myrand(void) {
  static int cnt = 0;
  return (lrand48() + cnt++) & 0x7FFFFFFF;
}


x86 assembly (clang, -O0):
<myrand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    0x2f0b(%rip),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,0x2f00(%rip)
add    %ecx,%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrand>:
push   %rax
xor    %eax,%eax
call   1030 <lrand48@plt>
mov    0x2f0e(%rip),%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x2f05(%rip)
add    %ecx,%eax
and    $0x7fffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@myrand.cnt = internal global i32 0
define i32 @myrand() {
%1 = call i32 (...) @lrand48()
%2 = load i32, i32* @myrand.cnt
%3 = add nsw i32 %2, 1
store i32 %3, i32* @myrand.cnt
%4 = add nsw i32 %1, %2
%5 = and i32 %4, 2147483647
ret i32 %5
}

LLVM IR (-O2):
@myrand.cnt = internal unnamed_addr global i32 0
define i32 @myrand() {
%1 = tail call i32 (...) @lrand48()
%2 = load i32, i32* @myrand.cnt
%3 = add nsw i32 %2, 1
store i32 %3, i32* @myrand.cnt
%4 = add nsw i32 %2, %1
%5 = and i32 %4, 2147483647
ret i32 %5
}