xunge/DecIR huggingface dataset:
int open(const char *name, int flags, ...) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ fexcept_t;

/* Variables and functions */
int ENOTSUP;
int fegetexceptflag(fexcept_t *flagp, int excepts) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<fegetexceptflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ed4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetexceptflag>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @fegetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOTSUP
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @fegetexceptflag(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_signal(int /*<<< orphan*/ *);
int gen_posix_cond_signal(pthread_cond_t *cond) {
  return pthread_cond_signal(cond);
}


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

x86 assembly (clang, -O2):
<gen_posix_cond_signal>:
jmp    1030 <pthread_cond_signal@plt>

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

LLVM IR (-O2):
define i32 @gen_posix_cond_signal(i32* %0) {
%2 = tail call i32 @pthread_cond_signal(i32* %0)
ret i32 %2
}
/* Type definitions */
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
};
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ snprintf(int /*<<< orphan*/, int, char *, char *);
int /*<<< orphan*/ unlink(int /*<<< orphan*/);
void close_unixsock(int fd, struct in_addr inetaddr) {
  struct sockaddr_un where;
  close(fd);
  snprintf(where.sun_path, sizeof(where.sun_path),
           "/var/run/pptp/"
           "%s",
           inet_ntoa(inetaddr));
  unlink(where.sun_path);
  ;
}


x86 assembly (clang, -O0):
<close_unixsock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %esi,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <close@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rcx
mov    $0x4,%esi
lea    0xe8a(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x10(%rbp),%edi
call   1030 <unlink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_unixsock>:
push   %rbx
mov    %esi,%ebx
call   1060 <close@plt>
mov    %ebx,%edi
call   1040 <inet_ntoa@plt>
lea    0xeaa(%rip),%rdx
mov    $0x4,%esi
mov    %rax,%rcx
call   1050 <snprintf@plt>
pop    %rbx
jmp    1030 <unlink@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
%struct.sockaddr_un = type { i32 }
@.str = [17 x i8] c"/var/run/pptp/%s\00"
define void @close_unixsock(i32 %0, i32 %1) {
%3 = alloca %struct.in_addr
%4 = alloca i32
%5 = alloca %struct.sockaddr_un
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %1, i32* %6
store i32 %0, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @close(i32 %7)
%9 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i8* @inet_ntoa(i32 %12)
%14 = call i32 @snprintf(i32 %10, i32 4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %5, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @unlink(i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/var/run/pptp/%s\00"
define void @close_unixsock(i32 %0, i32 %1) {
%3 = tail call i32 @close(i32 %0)
%4 = tail call i8* @inet_ntoa(i32 %1)
%5 = tail call i32 @snprintf(i32 undef, i32 4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @unlink(i32 undef)
ret void
}
double max(const double a, const double b) {
  if (b > a)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_to_montgomery(uintptr_t, uintptr_t);
void fiat_p256_to_montgomery(uint32_t out1[8], const uint32_t arg1[8]) {
  internal_fiat_p256_to_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_to_montgomery>:
jmp    1030 <internal_fiat_p256_to_montgomery@plt>

LLVM IR (-O0):
define void @fiat_p256_to_montgomery(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_to_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_to_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_to_montgomery(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ timer_init();
void memcheck_init() {
  *((char *)0x260) = 0x55;
  timer_init();
}


x86 assembly (clang, -O0):
<memcheck_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x260,%eax
movb   $0x55,(%rax)
mov    $0x0,%al
call   1030 <timer_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcheck_init>:
movb   $0x55,0x260
55
xor    %eax,%eax
jmp    1030 <timer_init@plt>

LLVM IR (-O0):
define void @memcheck_init() {
store i8 85, i8* inttoptr (i64 608 to i8*)
%1 = call i32 (...) @timer_init()
ret void
}

LLVM IR (-O2):
define void @memcheck_init() {
store i8 85, i8* inttoptr (i64 608 to i8*)
%1 = tail call i32 (...) @timer_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void emitbool(char cond[]) {
  puts("\tmov ecx, eax\n");
  puts("\txor eax, eax\n");
  puts("\ttest ecx, ecx\n");
  puts("\tset");
  puts(cond);
  puts(" al\n");
}


x86 assembly (clang, -O0):
<emitbool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitbool>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\09mov ecx, eax\0A\00"
@.str.1 = [15 x i8] c"\09xor eax, eax\0A\00"
@.str.2 = [16 x i8] c"\09test ecx, ecx\0A\00"
@.str.3 = [5 x i8] c"\09set\00"
@.str.4 = [5 x i8] c" al\0A\00"
define void @emitbool(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @puts(i8* %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\09mov ecx, eax\0A\00"
@.str.1 = [15 x i8] c"\09xor eax, eax\0A\00"
@.str.2 = [16 x i8] c"\09test ecx, ecx\0A\00"
@.str.3 = [5 x i8] c"\09set\00"
@.str.4 = [5 x i8] c" al\0A\00"
define void @emitbool(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) signed __int128 t103_5add(signed __int128 x) {
  signed __int128 r;
  if (__builtin_add_overflow(
          x,
          (signed __int128)((
              (signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1))),
          &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t103_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0xffffffffffffffff,%rdx
movabs $0x7fffffffffffffff,%rax
ff ff 7f
adc    %rax,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1161 <t103_5add+0x51>
jmp    1168 <t103_5add+0x58>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t103_5add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0xffffffffffffffff,%r14
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
adc    %rsi,%rbx
jno    1131 <t103_5add+0x21>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t103_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %11, i128 170141183460469231731687303715884105727)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t103_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 170141183460469231731687303715884105727)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *path) {
  fprintf(stderr, "Usage: %s recipe_path\n", path);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s recipe_path\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int big_endian(void) {
  union {
    long l;
    char c[sizeof(long)];
  } u;
  u.l = 1;
  return (u.c[sizeof(long) - 1] == 1);
}


x86 assembly (clang, -O0):
<big_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i64 }
define i32 @big_endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i64*
store i64 1, i64* %2
%3 = bitcast %union.anon* %1 to [8 x i8]*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 7
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "\n\n"
                  "Approximate GREP: perform approximate string matching.\n"
                  "\n"
                  "usage: agrep string file [file...]\n"
                  "\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [96 x i8] c"\0A\0AApproximate GREP: perform approximate string matching.\0A\0Ausage: agrep string file [file...]\0A\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [96 x i8] c"\0A\0AApproximate GREP: perform approximate string matching.\0A\0Ausage: agrep string file [file...]\0A\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int __setxid(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
  return __setxid(170, rgid, egid, sgid);
}


x86 assembly (clang, -O0):
<setresgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xaa,%edi
call   1030 <__setxid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setresgid>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0xaa,%edi
jmp    1030 <__setxid@plt>

LLVM IR (-O0):
define i32 @setresgid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @__setxid(i32 170, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @setresgid(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__setxid(i32 170, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) { printf("%s\n", "Hello, World!"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int is_power_of_two_non_zero(uint32_t x) { return (x & -x) == x; }


x86 assembly (clang, -O0):
<is_power_of_two_non_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two_non_zero>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_power_of_two_non_zero(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ EOF;
double pocet(int);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    printf("%.f\n", pocet(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     1178 <main+0x48>
mov    -0x8(%rbp),%edi
call   1030 <pocet@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e98(%rip),%r12
cmp    (%r12),%rax
je     1192 <main+0x62>
lea    0xea6(%rip),%r14
lea    0xe9c(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    0x4(%rsp),%edi
call   1030 <pocet@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    (%r12),%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [5 x i8] c"%.f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = call double @pocet(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test11_head() {
  do {
    printf("test11");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test11_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test11_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test11\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test11_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test11\00"
define void @test11_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
int getCupNum() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getCupNum() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Wow\n");
  int i;
  for (i = 0; i < 0x3; i++)
    ;
  i += 20;
  int *ptr = (void *)(i);
  *ptr = 10;
  printf("aaa\n");
  printf("bbb\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114f <main+0x3f>
jmp    1141 <main+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
mov    -0x8(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [4 x i8] c"Wow\00"
@str.3 = [4 x i8] c"aaa\00"
@str.4 = [4 x i8] c"bbb\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
store i32 10, i32* inttoptr (i64 23 to i32*)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
void clear_buffer(char *buffer) {
  memset(buffer, ' ', 80 * 24);
  buffer[80 * 24] = '\0';
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
mov    $0x780,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,0x780(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%esi
mov    $0x780,%edx
call   1030 <memset@plt>
movb   $0x0,0x780(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @clear_buffer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i8 signext 32, i32 1920)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1920
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
define void @clear_buffer(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i8 signext 32, i32 1920)
%3 = getelementptr inbounds i8, i8* %0, i64 1920
store i8 0, i8* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
void UARTBreakCtl(uint32_t ui32Base, bool bBreakState) {
  ASSERT(_UARTBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) =
      (bBreakState
           ? ((*((volatile uint32_t *)(ui32Base + 0x0000002C))) | 0x00000001)
           : ((*((volatile uint32_t *)(ui32Base + 0x0000002C))) &
              ~(0x00000001)));
}


x86 assembly (clang, -O0):
<UARTBreakCtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
cmpl   $0x0,-0x8(%rbp)
je     115c <UARTBreakCtl+0x3c>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116c <UARTBreakCtl+0x4c>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%eax
and    $0xfffffffe,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTBreakCtl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
movslq %ebp,%rcx
mov    0x2c(%rcx),%edx
and    $0xfffffffe,%edx
or     %edx,%eax
mov    %eax,0x2c(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @UARTBreakCtl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_UARTBaseValid(i32 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 44
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = or i32 %15, 1
br label %24
17: ; preds = %2
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 44
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load volatile i32, i32* %21
%23 = and i32 %22, -2
br label %24
24: ; preds = %17, %10
%25 = phi i32 [ %16, %10 ], [ %23, %17 ]
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 44
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
store volatile i32 %25, i32* %29
ret void
}

LLVM IR (-O2):
define void @UARTBreakCtl(i32 %0, i32 %1) {
%3 = tail call i32 @_UARTBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
%5 = icmp ne i32 %1, 0
%6 = add nsw i32 %0, 44
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -2
%11 = zext i1 %5 to i32
%12 = or i32 %10, %11
store volatile i32 %12, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: lcdlight [up|down|off|max|get|set <value>]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Usage: lcdlight [up|down|off|max|get|set <value>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [50 x i8] c"Usage: lcdlight [up|down|off|max|get|set <value>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int long_hash(char *word) {
  int i = 1, temp = 0, p;
  while (*word != '\0') {
    p = *word * i;
    temp = p + temp;
    word++;
    i++;
  }
  return temp;
}


x86 assembly (clang, -O0):
<long_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <long_hash+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <long_hash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_hash>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1124 <long_hash+0x24>
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <long_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @long_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i8* [ %12, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = phi i32 [ %13, %4 ], [ 1, %1 ]
%9 = sext i8 %5 to i32
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %10, %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = add nuw nsw i32 %8, 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds,
                              int num_leds) {}


x86 assembly (clang, -O0):
<ap9x_pci_setup_wmac_leds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gpio_led = type opaque
define void @ap9x_pci_setup_wmac_leds(i32 %0, %struct.gpio_led* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.gpio_led*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.gpio_led* %1, %struct.gpio_led** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.gpio_led = type opaque
define void @ap9x_pci_setup_wmac_leds(i32 %0, %struct.gpio_led* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, double, char *);
void dump_hdf5_d(char *name, double val, char *desc) {
  printf("HDF5:{'name':'%s','value':%.16e,'desc':'%s'}:5FDH\n", name, val,
         desc);
}


x86 assembly (clang, -O0):
<dump_hdf5_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_hdf5_d>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"HDF5:{'name':'%s','value':%.16e,'desc':'%s'}:5FDH\0A\00"
define void @dump_hdf5_d(i8* %0, double %1, i8* %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca i8*
store i8* %0, i8** %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load double, double* %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %7, double %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"HDF5:{'name':'%s','value':%.16e,'desc':'%s'}:5FDH\0A\00"
define void @dump_hdf5_d(i8* %0, double %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %0, double %1, i8* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t max_s16(int16_t a, int16_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max_s16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max_s16+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_s16+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_s16>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max_s16(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int EINTR;
int close(int);
int errno;
int tcp_sock_close(int sd) {
  int ret;
  while (1) {
    ret = close(sd);
    if (ret == -1) {
      ret = errno;
      if (ret == EINTR)
        continue;
      goto err_ret;
    } else
      break;
  }
  return 0;
err_ret:
  return ret;
}


x86 assembly (clang, -O0):
<tcp_sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1158 <tcp_sock_close+0x48>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%eax
jne    1153 <tcp_sock_close+0x43>
jmp    111b <tcp_sock_close+0xb>
jmp    1169 <tcp_sock_close+0x59>
jmp    115d <tcp_sock_close+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    116f <tcp_sock_close+0x5f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_sock_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1146 <tcp_sock_close+0x36>
mov    (%r14),%eax
cmp    (%r15),%eax
je     1130 <tcp_sock_close+0x20>
jmp    1148 <tcp_sock_close+0x38>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i32 0
@EINTR = global i32 0
define i32 @tcp_sock_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
br label %5
5: ; preds = %1, %15
%6 = load i32, i32* %3
%7 = call i32 @close(i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i32, i32* @errno
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* @EINTR
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %10
br label %5
16: ; preds = %10
br label %19
17: ; preds = %5
br label %18
18: ; preds = %17
store i32 0, i32* %2
br label %21
19: ; preds = %16
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %18
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@errno = global i32 0
@EINTR = global i32 0
define i32 @tcp_sock_close(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = load i32, i32* @EINTR
%8 = icmp eq i32 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %6, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
void airlock_exit(void) {
  emit("mov [__io_cycle_counter],edi\n");
  emit("mov [__io_fetchbase],ebp\n");
  emit("mov [__io_fetchbased_pc],esi\n");
  emit("push ebx\n");
  emit("push eax\n");
}


x86 assembly (clang, -O0):
<airlock_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <emit@plt>
lea    0xef7(%rip),%rdi
call   1030 <emit@plt>
lea    0xf05(%rip),%rdi
call   1030 <emit@plt>
lea    0xf17(%rip),%rdi
call   1030 <emit@plt>
lea    0xf15(%rip),%rdi
call   1030 <emit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<airlock_exit>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emit@plt>
lea    0xefa(%rip),%rdi
call   1030 <emit@plt>
lea    0xf08(%rip),%rdi
call   1030 <emit@plt>
lea    0xf1a(%rip),%rdi
call   1030 <emit@plt>
lea    0xf18(%rip),%rdi
pop    %rax
jmp    1030 <emit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"mov [__io_cycle_counter],edi\0A\00"
@.str.1 = [26 x i8] c"mov [__io_fetchbase],ebp\0A\00"
@.str.2 = [30 x i8] c"mov [__io_fetchbased_pc],esi\0A\00"
@.str.3 = [10 x i8] c"push ebx\0A\00"
@.str.4 = [10 x i8] c"push eax\0A\00"
define void @airlock_exit() {
%1 = call i32 @emit(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emit(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @emit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @emit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"mov [__io_cycle_counter],edi\0A\00"
@.str.1 = [26 x i8] c"mov [__io_fetchbase],ebp\0A\00"
@.str.2 = [30 x i8] c"mov [__io_fetchbased_pc],esi\0A\00"
@.str.3 = [10 x i8] c"push ebx\0A\00"
@.str.4 = [10 x i8] c"push eax\0A\00"
define void @airlock_exit() {
%1 = tail call i32 @emit(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emit(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @emit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @emit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct mem_event_domain {
  int dummy;
};
struct domain {
  int dummy;
};

/* Variables and functions */
int __mem_event_claim_slot(struct domain *, struct mem_event_domain *,
                           int /*<<< orphan*/);
int mem_event_claim_slot_nosleep(struct domain *d,
                                 struct mem_event_domain *med) {
  return __mem_event_claim_slot(d, med, 0);
}


x86 assembly (clang, -O0):
<mem_event_claim_slot_nosleep>:
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    %edx,%edx
call   1030 <__mem_event_claim_slot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_event_claim_slot_nosleep>:
xor    %edx,%edx
jmp    1030 <__mem_event_claim_slot@plt>

LLVM IR (-O0):
%struct.domain = type { i32 }
%struct.mem_event_domain = type { i32 }
define i32 @mem_event_claim_slot_nosleep(%struct.domain* %0, %struct.mem_event_domain* %1) {
%3 = alloca %struct.domain*
%4 = alloca %struct.mem_event_domain*
store %struct.domain* %0, %struct.domain** %3
store %struct.mem_event_domain* %1, %struct.mem_event_domain** %4
%5 = load %struct.domain*, %struct.domain** %3
%6 = load %struct.mem_event_domain*, %struct.mem_event_domain** %4
%7 = call i32 @__mem_event_claim_slot(%struct.domain* %5, %struct.mem_event_domain* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.domain = type { i32 }
%struct.mem_event_domain = type { i32 }
define i32 @mem_event_claim_slot_nosleep(%struct.domain* %0, %struct.mem_event_domain* %1) {
%3 = tail call i32 @__mem_event_claim_slot(%struct.domain* %0, %struct.mem_event_domain* %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ed_swap_2(int /*<<< orphan*/);
void *ed_swap_2p(void *x) {
  *(uint16_t *)x = ed_swap_2(*(uint16_t *)x);
  return x;
}


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

x86 assembly (clang, -O2):
<ed_swap_2p>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <ed_swap_2@plt>
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ed_swap_2p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @ed_swap_2(i32 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @ed_swap_2p(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @ed_swap_2(i32 %3)
store i32 %4, i32* %2
ret i8* %0
}
void gtk_text_buffer_get_selection_bounds() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_selection_bounds() {
ret void
}
double campoz(double dx, double By) { return 3; }


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

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

LLVM IR (-O0):
define double @campoz(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 3.000000e+00
}

LLVM IR (-O2):
define double @campoz(double %0, double %1) {
ret double 3.000000e+00
}
void rul__dbg_enable_control_c() {}


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

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

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

LLVM IR (-O2):
define void @rul__dbg_enable_control_c() {
ret void
}
/* Variables and functions */
int prj_getlistsize(void **list) {
  int count = 0;
  void **ptr = list;
  while (*ptr != NULL) {
    ptr++;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<prj_getlistsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     113f <prj_getlistsize+0x3f>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <prj_getlistsize+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prj_getlistsize>:
cmpq   $0x0,(%rdi)
je     111d <prj_getlistsize+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <prj_getlistsize+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @prj_getlistsize(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8** [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8*, i8** %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}