xunge/DecIR huggingface dataset:
int isalpha(int c) {
  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int no_of_bits(int n) {
  int cnt = 0;
  while (n) {
    if (n | 1)
      ++cnt;
    n <<= 1;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<no_of_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <no_of_bits+0x3e>
mov    -0x4(%rbp),%eax
or     $0x1,%eax
cmp    $0x0,%eax
je     1130 <no_of_bits+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <no_of_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_of_bits>:
bsf    %edi,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @no_of_bits(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = call i32 @llvm.cttz.i32(i32 %0, i1 true)
%4 = sub nuw nsw i32 32, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int fast_iscntrl(uint8_t c) { return (c > 0 && c < 32) || c == 127; }


x86 assembly (clang, -O0):
<fast_iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1120 <fast_iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     112a <fast_iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_iscntrl>:
lea    -0x1(%rdi),%eax
cmp    $0x1f,%eax
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @fast_iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 32
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @fast_iscntrl(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 31
%4 = icmp eq i32 %0, 127
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double exp(double);
double soilmoisture(double evap_fr) {
  return ((exp((evap_fr - 1.2836) / 0.4213)) / 0.511);
}


x86 assembly (clang, -O0):
<soilmoisture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soilmoisture>:
push   %rax
addsd  0xee7(%rip),%xmm0
divsd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @soilmoisture(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.283600e+00
%5 = fdiv double %4, 4.213000e-01
%6 = call double @exp(double %5)
%7 = fdiv double %6, 5.110000e-01
ret double %7
}

LLVM IR (-O2):
define double @soilmoisture(double %0) {
%2 = fadd double %0, -1.283600e+00
%3 = fdiv double %2, 4.213000e-01
%4 = tail call double @exp(double %3)
%5 = fdiv double %4, 5.110000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void __attribute__((destructor)) fini(void) { write(1, "5", 1); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
lea    0xee0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"5\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"5\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void Substitute(int *new) {}


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

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

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

LLVM IR (-O2):
define void @Substitute(i32* nocapture %0) {
ret void
}
/* Variables and functions */
size_t ptToSizet(void *pt) {
  char *a = NULL, *b = pt;
  return b - a;
}


x86 assembly (clang, -O0):
<ptToSizet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptToSizet>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ptToSizet(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @ptToSizet(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
int cmp(int *v1, int *v2) {
  if (*v1 > *v2) {
    return 1;
  } else if (*v1 == *v2) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <cmp+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <cmp+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <cmp+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <cmp+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(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 = load i32, i32* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = icmp sgt i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %20
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 0, i32* %3
br label %20
19: ; preds = %12
store i32 -1, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = icmp ne i32 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int readv(int /*<<< orphan*/, struct iovec *, int);
int main(void) {
  struct iovec iov;
  int count = 4;
  ssize_t ret;
  ret = readv(0, &iov, count);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <readv@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1030 <readv@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.iovec
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @readv(i32 0, %struct.iovec* %2, i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca %struct.iovec
%2 = bitcast %struct.iovec* %1 to i8*
%3 = call i32 @readv(i32 0, %struct.iovec* %1, i32 4)
ret i32 %3
}
void sigpipe(int signum) {}


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

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

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

LLVM IR (-O2):
define void @sigpipe(i32 %0) {
ret void
}
int l(int d) { return (d << 6) >> 6; }


x86 assembly (clang, -O0):
<l>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x6,%eax
sar    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<l>:
mov    %edi,%eax
shl    $0x6,%eax
sar    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @l(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 6
%5 = ashr i32 %4, 6
ret i32 %5
}

LLVM IR (-O2):
define i32 @l(i32 %0) {
%2 = shl i32 %0, 6
%3 = ashr exact i32 %2, 6
ret i32 %3
}
void foo509() {}


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

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

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

LLVM IR (-O2):
define void @foo509() {
ret void
}
unsigned xrop3_189_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk1 = S ^ D;
  stk2 = T ^ D;
  stk1 = stk1 & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_189_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_189_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %ecx,%edx
xor    $0xff,%edx
xor    $0xff,%eax
and    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_189_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = xor i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %7
%26 = load i32, i32* %5
%27 = xor i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_189_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = xor i32 %6, 255
%9 = and i32 %8, %7
%10 = or i32 %9, %4
%11 = xor i32 %10, -1
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ md5_final(unsigned char *);
int /*<<< orphan*/ md5_init();
int /*<<< orphan*/ md5_update(unsigned char *, unsigned int);
void md5_sign(unsigned char *inbuf, unsigned int inlen, unsigned char *sign) {
  md5_init();
  md5_update(inbuf, inlen);
  md5_final(sign);
}


x86 assembly (clang, -O0):
<md5_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <md5_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <md5_update@plt>
mov    -0x18(%rbp),%rdi
call   1030 <md5_final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_sign>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <md5_init@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <md5_update@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <md5_final@plt>

LLVM IR (-O0):
define void @md5_sign(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = call i32 (...) @md5_init()
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @md5_update(i8* %8, i32 %9)
%11 = load i8*, i8** %6
%12 = call i32 @md5_final(i8* %11)
ret void
}

LLVM IR (-O2):
define void @md5_sign(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (...) @md5_init()
%5 = tail call i32 @md5_update(i8* %0, i32 %1)
%6 = tail call i32 @md5_final(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *stb_substr(char *t, int n) {
  char *a;
  int z = (int)strlen(t);
  if (z < n)
    n = z;
  a = (char *)malloc(n + 1);
  strncpy(a, t, n);
  a[n] = 0;
  return a;
}


x86 assembly (clang, -O0):
<stb_substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <stb_substr+0x2d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_substr>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <strlen@plt>
cmp    %ebx,%eax
cmovl  %eax,%ebx
lea    0x1(%rbx),%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @stb_substr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %6
store i32 %14, i32* %4
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
%18 = call i64 @malloc(i32 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %5
%20 = load i8*, i8** %5
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = call i32 @strncpy(i8* %20, i8* %21, i32 %22)
%24 = load i8*, i8** %5
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 0, i8* %27
%28 = load i8*, i8** %5
ret i8* %28
}

LLVM IR (-O2):
define i8* @stb_substr(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = icmp slt i32 %4, %1
%6 = select i1 %5, i32 %4, i32 %1
%7 = add nsw i32 %6, 1
%8 = tail call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @strncpy(i8* %9, i8* %0, i32 %6)
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char const *);
int /*<<< orphan*/ t;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void __attribute__((used)) timestamp(const char *str, FILE *fp) {
  time_t t = time(&t);
  char *c = ctime(&t);
  c[24] = '\t';
  fprintf(fp, "%s%s", c, str);
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x9,0x18(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
mov    %r15,%rdi
call   1030 <ctime@plt>
movb   $0x9,0x18(%rax)
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@t = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i8*, i32*)* @timestamp to i8*)], section "llvm.metadata"
define void @timestamp(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = call i32 @time(i32* %5)
store i32 %7, i32* %5
%8 = call i8* @ctime(i32* %5)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i64 24
store i8 9, i8* %10
%11 = load i32*, i32** %4
%12 = load i8*, i8** %6
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@t = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i8*, i32*)* @timestamp to i8*)], section "llvm.metadata"
define void @timestamp(i8* %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
store i32 %5, i32* %3
%6 = call i8* @ctime(i32* %3)
%7 = getelementptr inbounds i8, i8* %6, i64 24
store i8 9, i8* %7
%8 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %0)
ret void
}
unsigned long hashmap_get_hashval(unsigned char *str) {
  unsigned long hash = 5381;
  int c = 0;
  while (c = *str++) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hashmap_get_hashval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1151 <hashmap_get_hashval+0x51>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hashmap_get_hashval+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_get_hashval>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hashmap_get_hashval+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashmap_get_hashval+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hashmap_get_hashval(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = mul i64 %6, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ TCP_NODELAY;
int errno;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int socket_set_tcpnodelay(int fd) {
  int optval = 1;
  socklen_t optlen = sizeof(optval);
  int err = setsockopt(fd, SOL_SOCKET, TCP_NODELAY, &optval, optlen);
  if (err == -1)
    return errno;
  return 0;
}


x86 assembly (clang, -O0):
<socket_set_tcpnodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%r8d
lea    -0xc(%rbp),%rcx
call   1030 <setsockopt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1169 <socket_set_tcpnodelay+0x59>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <socket_set_tcpnodelay+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_set_tcpnodelay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
jne    114d <socket_set_tcpnodelay+0x3d>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@TCP_NODELAY = global i32 0
@errno = global i32 0
define i32 @socket_set_tcpnodelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* @errno
%9 = select i1 %7, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2STxDataPut(unsigned long ulBase, unsigned long ulData) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) >= 16) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulData;
}


x86 assembly (clang, -O0):
<I2STxDataPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
cmp    $0x10,%rax
jb     114c <I2STxDataPut+0x3c>
jmp    1135 <I2STxDataPut+0x25>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxDataPut>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
nopl   0x0(%rax)
mov    0x18(%rbx),%rax
cmp    $0xf,%rax
ja     1130 <I2STxDataPut+0x20>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2STxDataPut(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 = icmp eq i64 %5, 1074085888
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
br label %9
9: ; preds = %15, %2
%10 = load i64, i64* %3
%11 = add i64 %10, 24
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = icmp uge i64 %13, 16
br i1 %14, label %15, label %16
15: ; preds = %9
br label %9
16: ; preds = %9
%17 = load i64, i64* %4
%18 = load i64, i64* %3
%19 = add i64 %18, 0
%20 = inttoptr i64 %19 to i64*
store volatile i64 %17, i64* %20
ret void
}

LLVM IR (-O2):
define void @I2STxDataPut(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 24
%7 = inttoptr i64 %6 to i64*
br label %8
8: ; preds = %8, %2
%9 = load volatile i64, i64* %7
%10 = icmp ugt i64 %9, 15
br i1 %10, label %8, label %11
11: ; preds = %8
%12 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %12
ret void
}
int command_away(const void *pointer, void *data, struct t_gui_buffer *buffer,
                 int argc, char **argv, char **argv_eol) {
  (void)pointer;
  (void)data;
  (void)buffer;
  (void)argc;
  (void)argv;
  (void)argv_eol;
  return 0;
}


x86 assembly (clang, -O0):
<command_away>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.t_gui_buffer = type opaque
define i32 @command_away(i8* %0, i8* %1, %struct.t_gui_buffer* %2, i32 %3, i8** %4, i8** %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.t_gui_buffer*
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i8**
store i8* %0, i8** %7
store i8* %1, i8** %8
store %struct.t_gui_buffer* %2, %struct.t_gui_buffer** %9
store i32 %3, i32* %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load %struct.t_gui_buffer*, %struct.t_gui_buffer** %9
%16 = load i32, i32* %10
%17 = load i8**, i8*** %11
%18 = load i8**, i8*** %12
ret i32 0
}

LLVM IR (-O2):
%struct.t_gui_buffer = type opaque
define i32 @command_away(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_gui_buffer* nocapture readnone %2, i32 %3, i8** nocapture readnone %4, i8** nocapture readnone %5) {
ret i32 0
}
int foo9() { return 9; }


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

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

LLVM IR (-O0):
define i32 @foo9() {
ret i32 9
}

LLVM IR (-O2):
define i32 @foo9() {
ret i32 9
}
/* Variables and functions */
int log10(int);
int sigTodB(int sig) { return 20 * log10(sig); }


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

x86 assembly (clang, -O2):
<sigTodB>:
push   %rax
call   1030 <log10@plt>
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sigTodB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log10(i32 %3)
%5 = mul nsw i32 20, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @sigTodB(i32 %0) {
%2 = tail call i32 @log10(i32 %0)
%3 = mul nsw i32 %2, 20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int by_value(int x, int y) {
  x = 1;
  y = 10;
  printf("%2d %2d\n", x, y);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"%2d %2d\0A\00"
define i32 @by_value(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ llvm_fcmp_ord(double, double);
int llvm_fcmp_one(double X, double Y) { return X != Y && llvm_fcmp_ord(X, Y); }


x86 assembly (clang, -O0):
<llvm_fcmp_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x11(%rbp)
jne    1142 <llvm_fcmp_one+0x32>
jp     1142 <llvm_fcmp_one+0x32>
jmp    115b <llvm_fcmp_one+0x4b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <llvm_fcmp_ord@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_fcmp_one>:
ucomisd %xmm1,%xmm0
jne    1118 <llvm_fcmp_one+0x8>
jnp    112e <llvm_fcmp_one+0x1e>
push   %rax
call   1030 <llvm_fcmp_ord@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_one(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp une double %5, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i64 @llvm_fcmp_ord(double %9, double %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %2
%14 = phi i1 [ false, %2 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @llvm_fcmp_one(double %0, double %1) {
%3 = fcmp une double %0, %1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @llvm_fcmp_ord(double %0, double %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
ret i32 %9
}
void swap(int *nums, int i, int j) {
  int tmp = nums[i];
  nums[i] = nums[j];
  nums[j] = tmp;
  return;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void freeSharedPages(void *base) {}


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

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

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

LLVM IR (-O2):
define void @freeSharedPages(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prop_deliver(int, int *, int, int);
void audio_monitoring_force_display(int x) {
  prop_deliver(*(int *)(0x74C94), &x, 4, 0x0);
}


x86 assembly (clang, -O0):
<audio_monitoring_force_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x74c94,%eax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <prop_deliver@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_monitoring_force_display>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x74c94,%edi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <prop_deliver@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @audio_monitoring_force_display(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* inttoptr (i64 478356 to i32*)
%4 = call i32 @prop_deliver(i32 %3, i32* %2, i32 4, i32 0)
ret void
}

LLVM IR (-O2):
define void @audio_monitoring_force_display(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* inttoptr (i64 478356 to i32*)
%4 = call i32 @prop_deliver(i32 %3, i32* %2, i32 4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clearpri() { system("busybox clear"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"busybox clear\00"
define void @clearpri() {
%1 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"busybox clear\00"
define void @clearpri() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void ol_backend_gamma_absolute_uninit(struct ol_backend_gamma_s *self) {
  (void)(self);
}


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

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

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

LLVM IR (-O2):
%struct.ol_backend_gamma_s = type opaque
define void @ol_backend_gamma_absolute_uninit(%struct.ol_backend_gamma_s* nocapture %0) {
ret void
}
void ZType_finalize(void *_self) {}


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

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

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

LLVM IR (-O2):
define void @ZType_finalize(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_is_ip_address() {
  printf("NOT IMPLEMENTED:"
         "pa_is_ip_address"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_is_ip_address\00"
define i32 @pa_is_ip_address() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ string_append(int, char *, char *);
void handle_hisilicon(int which, int part, char *model_string) {
  switch (part) {
  case 0xd01:
    string_append(which, "Kunpeng-920", model_string);
    break;
  default:
    string_append(which, "Unknown", model_string);
    break;
  }
}


x86 assembly (clang, -O0):
<handle_hisilicon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xd01,%eax
jne    114d <handle_hisilicon+0x3d>
jmp    1135 <handle_hisilicon+0x25>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <string_append@plt>
jmp    1160 <handle_hisilicon+0x50>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1030 <string_append@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_hisilicon>:
cmp    $0xd01,%esi
lea    0xee3(%rip),%rax
lea    0xee8(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <string_append@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Kunpeng-920\00"
@.str.1 = [8 x i8] c"Unknown\00"
define void @handle_hisilicon(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
switch i32 %7, label %12 [
i32 3329, label %8
]
8: ; preds = %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %6
%11 = call i32 @string_append(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %16
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %6
%15 = call i32 @string_append(i32 %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Kunpeng-920\00"
@.str.1 = [8 x i8] c"Unknown\00"
define void @handle_hisilicon(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 3329
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @string_append(i32 %0, i8* %5, i8* %2)
ret void
}
void plugin_desc() {
  printf("%s %s -- start\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/seabat/TohriSDK/refs/heads/master/sources/"
         "apps/sample/plugin-dynamic-lib/plugin/take/plugin_take.c",
         __func__);
  printf("%s %s -- exit\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/seabat/TohriSDK/refs/heads/master/sources/"
         "apps/sample/plugin-dynamic-lib/plugin/take/plugin_take.c",
         __func__);
}


x86 assembly (clang, -O0):
<plugin_desc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xfa4(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa2(%rip),%rdi
lea    0xed2(%rip),%rsi
lea    0xf88(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_desc>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rbx
lea    0xfa4(%rip),%r14
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf9c(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s %s -- start\0A\00"
@.str.1 = [189 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/seabat/TohriSDK/refs/heads/master/sources/apps/sample/plugin-dynamic-lib/plugin/take/plugin_take.c\00"
@__func__.plugin_desc = [12 x i8] c"plugin_desc\00"
@.str.2 = [15 x i8] c"%s %s -- exit\0A\00"
define void @plugin_desc() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.plugin_desc, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.plugin_desc, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s %s -- start\0A\00"
@.str.1 = [189 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/seabat/TohriSDK/refs/heads/master/sources/apps/sample/plugin-dynamic-lib/plugin/take/plugin_take.c\00"
@__func__.plugin_desc = [12 x i8] c"plugin_desc\00"
@.str.2 = [15 x i8] c"%s %s -- exit\0A\00"
define void @plugin_desc() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.plugin_desc, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.plugin_desc, i64 0, i64 0))
ret void
}
void check_enable_amd_mmconf_dmi(void) {}


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

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

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

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

/* Variables and functions */
unsigned long *counter_entry(unsigned long *addr) {
  return addr + sizeof(pthread_mutex_t);
}


x86 assembly (clang, -O0):
<counter_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter_entry>:
lea    0x20(%rdi),%rax
ret

LLVM IR (-O0):
define i64* @counter_entry(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 4
ret i64* %4
}

LLVM IR (-O2):
define i64* @counter_entry(i64* readnone %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 4
ret i64* %2
}
/* Variables and functions */
int /*<<< orphan*/ endSPI(int);
int /*<<< orphan*/ startSQI(int);
int /*<<< orphan*/ writeSQI(int, int);
void toSPI() {
  startSQI(1);
  writeSQI(0x000000FF, 8);
  endSPI(1);
}


x86 assembly (clang, -O0):
<toSPI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <startSQI@plt>
mov    $0xff,%edi
mov    $0x8,%esi
call   1040 <writeSQI@plt>
mov    $0x1,%edi
call   1050 <endSPI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<toSPI>:
push   %rax
mov    $0x1,%edi
call   1030 <startSQI@plt>
mov    $0xff,%edi
mov    $0x8,%esi
call   1040 <writeSQI@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <endSPI@plt>

LLVM IR (-O0):
define void @toSPI() {
%1 = call i32 @startSQI(i32 1)
%2 = call i32 @writeSQI(i32 255, i32 8)
%3 = call i32 @endSPI(i32 1)
ret void
}

LLVM IR (-O2):
define void @toSPI() {
%1 = tail call i32 @startSQI(i32 1)
%2 = tail call i32 @writeSQI(i32 255, i32 8)
%3 = tail call i32 @endSPI(i32 1)
ret void
}