xunge/DecIR huggingface dataset:
double D(double a, double b, double c) {
  double d;
  d = b * b - 4.0 * a * c;
  return d;
}


x86 assembly (clang, -O0):
<D>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xedb(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<D>:
mulsd  0xef8(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @D(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = load double, double* %5
%10 = load double, double* %4
%11 = fmul double 4.000000e+00, %10
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %8, double %9, double %14)
store double %15, double* %7
%16 = load double, double* %7
ret double %16
}

LLVM IR (-O2):
define double @D(double %0, double %1, double %2) {
%4 = fmul double %0, -4.000000e+00
%5 = fmul double %4, %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
ret double %6
}
void ARGBSetRow_NEON() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_weight_wxh(int /*<<< orphan*/ *, int,
                                        int /*<<< orphan*/ *, int, int, int,
                                        int);
void pixel_avg_weight_4x4(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                          int i_stride_pix2, int i_weight1) {
  pixel_avg_weight_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 4, 4,
                       i_weight1);
}


x86 assembly (clang, -O0):
<pixel_avg_weight_4x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x4,%r9d
mov    %r9d,%r8d
mov    %eax,(%rsp)
call   1030 <pixel_avg_weight_wxh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_weight_4x4>:
push   %rax
mov    %r8d,(%rsp)
mov    $0x4,%r8d
mov    $0x4,%r9d
call   1030 <pixel_avg_weight_wxh@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pixel_avg_weight_4x4(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @pixel_avg_weight_wxh(i32* %11, i32 %12, i32* %13, i32 %14, i32 4, i32 4, i32 %15)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_weight_4x4(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @pixel_avg_weight_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 4, i32 4, i32 %4)
ret void
}
int fun1206() { return 1206; }


x86 assembly (clang, -O0):
<fun1206>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4b6,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1206() {
ret i32 1206
}

LLVM IR (-O2):
define i32 @fun1206() {
ret i32 1206
}
void *match(s_ix, l_ix, pat)
long l_ix;
char unsigned *pat;
{ exit(1); }


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define i8* @match(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
unreachable
}

LLVM IR (-O2):
define noalias i8* @match(i32 %0, i64 %1, i8* nocapture readnone %2) {
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
bool cleanup() { return true; }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cleanup() {
ret i32 1
}

LLVM IR (-O2):
define i32 @cleanup() {
ret i32 1
}
void wrapper(void (*fun)()) { fun(); }


x86 assembly (clang, -O0):
<wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @wrapper(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Circle(int x, int y, int radius) {
  printf("Drawing the circle...\n");
  if (radius == 2)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<Circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x10(%rbp)
jne    1143 <Circle+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <Circle+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Circle>:
push   %rbx
mov    %edx,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
setne  %al
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"Drawing the circle...\00"
define i32 @Circle(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%5 = icmp eq i32 %2, 2
%6 = select i1 %5, i32 -1, i32 1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *get_rfc2409_prime_768(int /*<<< orphan*/ *);
BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn) {
  return get_rfc2409_prime_768(bn);
}


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

x86 assembly (clang, -O2):
<BN_get_rfc2409_prime_768>:
jmp    1030 <get_rfc2409_prime_768@plt>

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

LLVM IR (-O2):
define i32* @BN_get_rfc2409_prime_768(i32* %0) {
%2 = tail call i32* @get_rfc2409_prime_768(i32* %0)
ret i32* %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int stun_make_type(int);
uint16_t stun_make_error_response(uint16_t method) {
  return (stun_make_type(method) | 0x0110);
}


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

x86 assembly (clang, -O2):
<stun_make_error_response>:
push   %rax
call   1030 <stun_make_type@plt>
or     $0x110,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stun_make_error_response(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @stun_make_type(i32 %3)
%5 = or i32 %4, 272
ret i32 %5
}

LLVM IR (-O2):
define i32 @stun_make_error_response(i32 %0) {
%2 = tail call i32 @stun_make_type(i32 %0)
%3 = or i32 %2, 272
ret i32 %3
}
int prime(int n) {
  int i = 2;
  if (i <= 1)
    return 0;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1124 <prime+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1171 <prime+0x71>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116a <prime+0x6a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1157 <prime+0x57>
movl   $0x0,-0x4(%rbp)
jmp    1171 <prime+0x71>
jmp    115c <prime+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <prime+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
mov    $0x1,%ecx
cmp    $0x4,%edi
jl     1125 <prime+0x25>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1128 <prime+0x28>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1110 <prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp sgt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
unsigned int peek_bits(unsigned char const *, long, int);
unsigned int read_bits(const unsigned char *data, long *p, int q) {
  unsigned int answer;
  answer = peek_bits(data, *p, q);
  *p += q;
  return answer;
}


x86 assembly (clang, -O0):
<read_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%edx
call   1030 <peek_bits@plt>
mov    %eax,-0x18(%rbp)
movslq -0x14(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bits>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    (%rsi),%rsi
call   1030 <peek_bits@plt>
movslq %ebx,%rcx
add    %rcx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @read_bits(i8* %0, i64* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = load i32, i32* %6
%12 = call i32 @peek_bits(i8* %8, i64 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %5
%16 = load i64, i64* %15
%17 = add nsw i64 %16, %14
store i64 %17, i64* %15
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @read_bits(i8* %0, i64* nocapture %1, i32 %2) {
%4 = load i64, i64* %1
%5 = tail call i32 @peek_bits(i8* %0, i64 %4, i32 %2)
%6 = sext i32 %2 to i64
%7 = load i64, i64* %1
%8 = add nsw i64 %7, %6
store i64 %8, i64* %1
ret i32 %5
}
/* Variables and functions */
unsigned int swap32(unsigned int);
unsigned int ntohl(unsigned int val) { return swap32(val); }


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

x86 assembly (clang, -O2):
<ntohl>:
jmp    1030 <swap32@plt>

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

LLVM IR (-O2):
define i32 @ntohl(i32 %0) {
%2 = tail call i32 @swap32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(uint8_t *data, uint8_t len) {
  for (int i = 0; i < len; i++)
    printf("%02x ", data[i]);
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
char *_dl_strcat(char *dst, const char *src) {
  register char *ptr = dst;
  while (*ptr)
    ptr++;
  while (*src)
    *ptr++ = *src++;
  *ptr = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<_dl_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <_dl_strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <_dl_strcat+0x14>
jmp    1137 <_dl_strcat+0x37>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <_dl_strcat+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1137 <_dl_strcat+0x37>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rdi
add    $0x1,%rcx
cmpb   $0x0,(%rdi)
jne    1110 <_dl_strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1146 <_dl_strcat+0x46>
mov    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x2(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <_dl_strcat+0x30>
add    %rdi,%rcx
mov    %rcx,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @_dl_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %4, %8 ]
%14 = phi i8* [ %15, %11 ], [ %1, %8 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %13
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int it8716f_shutdown(void *data) {
  free(data);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @it8716f_shutdown(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintMessage3() { printf("This is the message 3\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"This is the message 3\0A\00"
define void @PrintMessage3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"This is the message 3\00"
define void @PrintMessage3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int M_PI;
int jeHambi(int opseg, int promjerRupe) {
  float promjerPeciva;
  promjerPeciva = opseg / M_PI;
  if (promjerPeciva <= (float)promjerRupe)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<jeHambi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed4(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     113f <jeHambi+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <jeHambi+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jeHambi>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2ss %eax,%xmm0
cvtsi2ss %esi,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @jeHambi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @M_PI
%9 = sdiv i32 %7, %8
%10 = sitofp i32 %9 to float
store float %10, float* %6
%11 = load float, float* %6
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = fcmp ole float %11, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @jeHambi(i32 %0, i32 %1) {
%3 = load i32, i32* @M_PI
%4 = sdiv i32 %0, %3
%5 = sitofp i32 %4 to float
%6 = sitofp i32 %1 to float
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int printw(char const *, int);
int i_printw(const char *fmt, int i) { return (printw(fmt, i)); }


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

x86 assembly (clang, -O2):
<i_printw>:
jmp    1030 <printw@plt>

LLVM IR (-O0):
define i32 @i_printw(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 i32 @printw(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @i_printw(i8* %0, i32 %1) {
%3 = tail call i32 @printw(i8* %0, i32 %1)
ret i32 %3
}
int on_puzzle(int x, int y) {
  if ((x >= 0) && (x < 4) && (y >= 0) && (y < 4)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<on_puzzle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     113e <on_puzzle+0x3e>
cmpl   $0x4,-0x8(%rbp)
jge    113e <on_puzzle+0x3e>
cmpl   $0x0,-0xc(%rbp)
jl     113e <on_puzzle+0x3e>
cmpl   $0x4,-0xc(%rbp)
jge    113e <on_puzzle+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <on_puzzle+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_puzzle>:
or     %esi,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @on_puzzle(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 4
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
scalar_t__ module_is_live(struct module *);
__attribute__((always_)) int try_module_get(struct module *module) {
  return !module || module_is_live(module);
}


x86 assembly (clang, -O0):
<try_module_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <try_module_get+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <module_is_live@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_module_get>:
test   %rdi,%rdi
je     112b <try_module_get+0x1b>
push   %rax
call   1030 <module_is_live@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.module = type { i32 }
define i32 @try_module_get(%struct.module* %0) {
%2 = alloca %struct.module*
store %struct.module* %0, %struct.module** %2
%3 = load %struct.module*, %struct.module** %2
%4 = icmp ne %struct.module* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load %struct.module*, %struct.module** %2
%7 = call i64 @module_is_live(%struct.module* %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.module = type { i32 }
define i32 @try_module_get(%struct.module* %0) {
%2 = icmp eq %struct.module* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @module_is_live(%struct.module* %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int c, m;
  printf("Insira a quantidade de metros\n");
  scanf("%i", &m);
  c = m * 1000;
  printf("O valor em centimetros é: %i\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x3e8,-0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
imul   $0x3e8,0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Insira a quantidade de metros\0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [31 x i8] c"O valor em centimetros \C3\A9: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 1000
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [31 x i8] c"O valor em centimetros \C3\A9: %i\0A\00"
@str = [30 x i8] c"Insira a quantidade de metros\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 1000
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
double floor(double);
double carmen_global_convert_degmin_to_double(double dm_format) {
  double degree = floor(dm_format / 100.0);
  double minutes = (dm_format - degree * 100.0) / 60.0;
  return degree + minutes;
}


x86 assembly (clang, -O0):
<carmen_global_convert_degmin_to_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xea7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_global_convert_degmin_to_double>:
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm0
call   1030 <floor@plt>
movsd  0xed5(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  (%rsp),%xmm1
subsd  %xmm2,%xmm1
divsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @carmen_global_convert_degmin_to_double(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 1.000000e+02
%7 = call double @llvm.floor.f64(double %6)
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e+02, double %8)
%12 = fdiv double %11, 6.000000e+01
store double %12, double* %4
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fadd double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @carmen_global_convert_degmin_to_double(double %0) {
%2 = fdiv double %0, 1.000000e+02
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+02, double %0)
%6 = fdiv double %5, 6.000000e+01
%7 = fadd double %3, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *, int);
int strlen(char *);
char odwroc(char a[]) {
  int n = strlen(a);
  reverse(a, n);
}


x86 assembly (clang, -O0):
<odwroc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <reverse@plt>
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odwroc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <reverse@plt>

LLVM IR (-O0):
define signext i8 @odwroc(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @reverse(i8* %7, i32 %8)
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @odwroc(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @reverse(i8* %0, i32 %2)
ret i8 undef
}
/* Type definitions */
struct bss_t {
  int dummy;
};

/* Variables and functions */
int recvwait(struct bss_t *, int, unsigned char *, int);
int recvbyte(struct bss_t *bss, int sock) {
  unsigned char buffer[1];
  int ret;
  ret = recvwait(bss, sock, buffer, 1);
  if (ret < 0)
    return ret;
  return buffer[0];
}


x86 assembly (clang, -O0):
<recvbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x15(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <recvwait@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    114c <recvbyte+0x3c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <recvbyte+0x43>
movzbl -0x15(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvbyte>:
push   %rax
lea    0x7(%rsp),%rdx
mov    $0x1,%ecx
call   1030 <recvwait@plt>
test   %eax,%eax
movzbl 0x7(%rsp),%ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bss_t = type { i32 }
define i32 @recvbyte(%struct.bss_t* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.bss_t*
%5 = alloca i32
%6 = alloca [1 x i8]
%7 = alloca i32
store %struct.bss_t* %0, %struct.bss_t** %4
store i32 %1, i32* %5
%8 = load %struct.bss_t*, %struct.bss_t** %4
%9 = load i32, i32* %5
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%11 = call i32 @recvwait(%struct.bss_t* %8, i32 %9, i8* %10, i32 1)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* %7
store i32 %15, i32* %3
br label %20
16: ; preds = %2
%17 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %14
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.bss_t = type { i32 }
define i32 @recvbyte(%struct.bss_t* %0, i32 %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = call i32 @recvwait(%struct.bss_t* %0, i32 %1, i8* %4, i32 1)
%6 = icmp slt i32 %5, 0
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = select i1 %6, i32 %5, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _error(char const *message, int ret) {
  fputs("makepasswd"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"makepasswd: \00"
@stderr = global i32 0
define i32 @_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"makepasswd: \00"
@stderr = global i32 0
define i32 @_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int wait(int *);
int waitPid(int pid) {
  int xpid, status, rcode;
  rcode = -1;
  for (;;) {
    xpid = wait(&status);
    if (xpid != -1)
      rcode = ((status >> 8) & 0xFF);
    else
      rcode = -1;
    if (xpid == -1 || xpid == pid)
      break;
  }
  return rcode;
}


x86 assembly (clang, -O0):
<waitPid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <wait@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     114b <waitPid+0x3b>
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <waitPid+0x42>
movl   $0xffffffff,-0x10(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1168 <waitPid+0x58>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    116d <waitPid+0x5d>
jmp    1172 <waitPid+0x62>
jmp    1122 <waitPid+0x12>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitPid>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <wait@plt>
cmp    $0xffffffff,%eax
je     1131 <waitPid+0x21>
cmp    %ebx,%eax
jne    1120 <waitPid+0x10>
cmp    $0xffffffff,%eax
movzbl 0x5(%rsp),%ecx
cmove  %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @waitPid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %5
br label %6
6: ; preds = %23, %1
%7 = call i32 @wait(i32* %4)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
store i32 %13, i32* %5
br label %15
14: ; preds = %6
store i32 -1, i32* %5
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, -1
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18, %15
br label %24
23: ; preds = %18
br label %6
24: ; preds = %22
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @waitPid(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = call i32 @wait(i32* %2)
%6 = icmp eq i32 %5, -1
%7 = icmp eq i32 %5, %0
%8 = or i1 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = select i1 %6, i32 -1, i32 %12
ret i32 %13
}
int sum_cmd(cp)
char *cp;
{ return sum_product(cp, 0); }


x86 assembly (clang, -O0):
<sum_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <sum_product@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_cmd>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <sum_product@plt>

LLVM IR (-O0):
define i32 @sum_cmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @sum_product to i32 (i8*, i32, ...)*)(i8* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @sum_cmd(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @sum_product to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
__attribute__((always_)) void write16(volatile void *addr, uint16_t value) {
  *((volatile uint16_t *)(addr)) = value;
}


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

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

LLVM IR (-O0):
define void @write16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @write16(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *basename) {
  fprintf(stderr, "Usage: %s [-q]\n", basename);
}


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 = [16 x i8] c"Usage: %s [-q]\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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s [-q]\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ return_sense(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void sam_blank_check(uint16_t ascq, uint8_t *sam_stat) {
  return_sense(0x08, ascq, NULL, sam_stat);
}


x86 assembly (clang, -O0):
<sam_blank_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x8,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <return_sense@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam_blank_check>:
mov    %rsi,%rcx
mov    %edi,%esi
mov    $0x8,%edi
xor    %edx,%edx
jmp    1030 <return_sense@plt>

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

LLVM IR (-O2):
define void @sam_blank_check(i32 %0, i32* %1) {
%3 = tail call i32 @return_sense(i32 8, i32 %0, i32* null, i32* %1)
ret void
}
long hashlong(long p1, long p2) {
  long res = 0;
  int *pp1 = (int *)p1;
  while (*pp1 != -1)
    res = ((res * 100001) + (*pp1++));
  return (res);
}


x86 assembly (clang, -O0):
<hashlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     114f <hashlong+0x4f>
imul   $0x186a1,-0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
movslq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <hashlong+0x1c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashlong>:
mov    (%rdi),%ecx
cmp    $0xffffffff,%ecx
je     1129 <hashlong+0x29>
add    $0x4,%rdi
xor    %eax,%eax
nopl   (%rax)
imul   $0x186a1,%rax,%rdx
movslq %ecx,%rax
add    %rdx,%rax
mov    (%rdi),%ecx
add    $0x4,%rdi
cmp    $0xffffffff,%ecx
jne    1110 <hashlong+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hashlong(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %16, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %14, %6 ], [ %4, %2 ]
%8 = phi i32* [ %11, %6 ], [ %3, %2 ]
%9 = phi i64 [ %13, %6 ], [ 0, %2 ]
%10 = mul nsw i64 %9, 100001
%11 = getelementptr inbounds i32, i32* %8, i64 1
%12 = sext i32 %7 to i64
%13 = add nsw i64 %10, %12
%14 = load i32, i32* %11
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i64 [ 0, %2 ], [ %13, %6 ]
ret i64 %17
}
int putw(w, fp)
unsigned w;
struct _buf *fp;
{
  if ((fputc(w & 0xff, fp) >= 0) && (fputc(w / 256, fp) >= 0))
    return w;
  return -1;
}


x86 assembly (clang, -O0):
<putw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
cmp    $0x0,%eax
jl     1161 <putw+0x51>
mov    -0x8(%rbp),%edi
shr    $0x8,%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
cmp    $0x0,%eax
jl     1161 <putw+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <putw+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putw>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %bl,%edi
xor    %eax,%eax
call   1030 <fputc@plt>
test   %eax,%eax
js     113a <putw+0x2a>
mov    %ebx,%edi
shr    $0x8,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fputc@plt>
test   %eax,%eax
jns    113f <putw+0x2f>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct._buf = type opaque
define i32 @putw(i32 %0, %struct._buf* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct._buf*
store i32 %0, i32* %4
store %struct._buf* %1, %struct._buf** %5
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = load %struct._buf*, %struct._buf** %5
%9 = call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %7, %struct._buf* %8)
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* %4
%13 = udiv i32 %12, 256
%14 = load %struct._buf*, %struct._buf** %5
%15 = call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %13, %struct._buf* %14)
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %20
19: ; preds = %11, %2
store i32 -1, i32* %3
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct._buf = type opaque
define i32 @putw(i32 %0, %struct._buf* %1) {
%3 = and i32 %0, 255
%4 = tail call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %3, %struct._buf* %1)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = lshr i32 %0, 8
%8 = tail call i32 (i32, %struct._buf*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %struct._buf*, ...)*)(i32 %7, %struct._buf* %1)
%9 = icmp sgt i32 %8, -1
br i1 %9, label %11, label %10
10: ; preds = %6, %2
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ -1, %10 ], [ %0, %6 ]
ret i32 %12
}