xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strerror_r(int, char *, size_t);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *ne_strerror(int errnum, char *buf, size_t buflen) {
  char *ret = strerror_r(errnum, buf, buflen);
  if (ret != buf)
    do {
      strncpy(buf, ret, buflen - 1);
      buf[buflen - 1] = '\0';
    } while (0);
  return buf;
}


x86 assembly (clang, -O0):
<ne_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strerror_r@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1184 <ne_strerror+0x64>
jmp    115a <ne_strerror+0x3a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1184 <ne_strerror+0x64>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_strerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <strerror_r@plt>
cmp    %rbx,%rax
je     1149 <ne_strerror+0x29>
lea    -0x1(%r14),%rdx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ne_strerror(i32 %0, i8* returned %1, i64 %2) {
%4 = tail call i8* @strerror_r(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i8* %4, %1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = add i64 %2, -1
%8 = tail call i32 @strncpy(i8* %1, i8* %4, i64 %7)
%9 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %9
br label %10
10: ; preds = %6, %3
ret i8* %1
}
int test_imm_03int16_mem(short *val) {
  return ((*val) & (-0x03 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_03int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -3
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return c - 'A';
  else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <tolower+0x29>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = select i1 %3, i32 %2, i32 %0
ret i32 %4
}
/* Variables and functions */
bool isPowerOfTwo1(int n) {
  while (n) {
    if (n == 1)
      return true;
    if (n % 2)
      return false;
    n /= 2;
  }
}


x86 assembly (clang, -O0):
<isPowerOfTwo1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115a <isPowerOfTwo1+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1127 <isPowerOfTwo1+0x27>
movl   $0x1,-0x4(%rbp)
jmp    115a <isPowerOfTwo1+0x5a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1147 <isPowerOfTwo1+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115a <isPowerOfTwo1+0x5a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1107 <isPowerOfTwo1+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo1>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     1126 <isPowerOfTwo1+0x26>
nopw   0x0(%rax,%rax,1)
test   $0x1,%dil
jne    1127 <isPowerOfTwo1+0x27>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
cmp    $0x1,%ecx
ja     1110 <isPowerOfTwo1+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isPowerOfTwo1(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = sdiv i32 %4, 2
%9 = icmp ult i32 %8, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %7, %1
%11 = phi i32 [ 1, %1 ], [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int AF_INET;
int AF_INET6;
scalar_t__ inet_pton(int, char const *, void *);
scalar_t__ strchr(char const *, char);
int raw_addr(void *dst, const char *src) {
  int af;
  if (strchr(src, ':'))
    af = AF_INET6;
  else
    af = AF_INET;
  if (inet_pton(af, src, dst) <= 0)
    return -1;
  return af;
}


x86 assembly (clang, -O0):
<raw_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1159 <raw_addr+0x39>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1165 <raw_addr+0x45>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <inet_pton@plt>
cmp    $0x0,%rax
jg     118b <raw_addr+0x6b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <raw_addr+0x71>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_addr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1145 <raw_addr+0x25>
mov    0x2ea5(%rip),%rax
jmp    114c <raw_addr+0x2c>
mov    0x2e94(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <inet_pton@plt>
test   %rax,%rax
mov    $0xffffffff,%eax
cmovg  %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@AF_INET6 = global i32 0
@AF_INET = global i32 0
define i32 @raw_addr(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i64 @strchr(i8* %7, i8 signext 58)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @AF_INET6
store i32 %11, i32* %6
br label %14
12: ; preds = %2
%13 = load i32, i32* @AF_INET
store i32 %13, i32* %6
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %6
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i64 @inet_pton(i32 %15, i8* %16, i8* %17)
%19 = icmp sle i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 -1, i32* %3
br label %23
21: ; preds = %14
%22 = load i32, i32* %6
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %20
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
@AF_INET = global i32 0
define i32 @raw_addr(i8* %0, i8* %1) {
%3 = tail call i64 @strchr(i8* %1, i8 signext 58)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* @AF_INET
%6 = load i32, i32* @AF_INET6
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i64 @inet_pton(i32 %7, i8* %1, i8* %0)
%9 = icmp slt i64 %8, 1
%10 = select i1 %9, i32 -1, i32 %7
ret i32 %10
}
/* Variables and functions */
int CL_ServerStatus(char const *, char *, int);
int LAN_GetServerStatus(const char *serverAddress, char *serverStatus,
                        int maxLen) {
  return CL_ServerStatus(serverAddress, serverStatus, maxLen);
}


x86 assembly (clang, -O0):
<LAN_GetServerStatus>:
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),%rsi
mov    -0x14(%rbp),%edx
call   1030 <CL_ServerStatus@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LAN_GetServerStatus>:
jmp    1030 <CL_ServerStatus@plt>

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

LLVM IR (-O2):
define i32 @LAN_GetServerStatus(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @CL_ServerStatus(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double get_wallclock_sample() {
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC_RAW, &tp);
  return (double)tp.tv_sec + (double)tp.tv_nsec / 1e9;
}


x86 assembly (clang, -O0):
<get_wallclock_sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wallclock_sample>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define double @get_wallclock_sample() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+09
%11 = fadd double %6, %10
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC_RAW = global i32 0
define double @get_wallclock_sample() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC_RAW
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+09
%12 = fadd double %11, %7
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ knot_random_buffer(int /*<<< orphan*/ *, int);
uint32_t knot_random_uint32_t(void) {
  uint32_t buffer;
  knot_random_buffer(&buffer, sizeof(buffer));
  return buffer;
}


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

x86 assembly (clang, -O2):
<knot_random_uint32_t>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <knot_random_buffer@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @knot_random_uint32_t() {
%1 = alloca i32
%2 = call i32 @knot_random_buffer(i32* %1, i32 4)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @knot_random_uint32_t() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @knot_random_buffer(i32* %1, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
void ciicF(int x) {
  char *y;
  y = x;
}


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

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

LLVM IR (-O0):
define void @ciicF(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
ret void
}

LLVM IR (-O2):
define void @ciicF(i32 %0) {
ret void
}
void o2i_ECPublicKey(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ wcsncmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void uninitvar_wcsncmp(wchar_t *Ct, wchar_t *S, size_t N) {
  wchar_t *ct;
  wchar_t *s;
  size_t n;
  (void)wcsncmp(ct, s, n);
  (void)wcsncmp(ct, S, N);
  (void)wcsncmp(Ct, s, N);
  (void)wcsncmp(Ct, S, n);
  (void)wcsncmp(Ct, S, N);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcsncmp>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <wcsncmp@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <wcsncmp@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <wcsncmp@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <wcsncmp@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <wcsncmp@plt>

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

LLVM IR (-O2):
define void @uninitvar_wcsncmp(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @wcsncmp(i32* undef, i32* undef, i64 undef)
%5 = tail call i32 @wcsncmp(i32* undef, i32* %1, i64 %2)
%6 = tail call i32 @wcsncmp(i32* %0, i32* undef, i64 %2)
%7 = tail call i32 @wcsncmp(i32* %0, i32* %1, i64 undef)
%8 = tail call i32 @wcsncmp(i32* %0, i32* %1, i64 %2)
ret void
}
double Sleef_pown_u10(double x, int y) { return __builtin_pow(x, (double)y); }


x86 assembly (clang, -O0):
<Sleef_pown_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_pown_u10>:
cvtsi2sd %edi,%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @Sleef_pown_u10(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to double
%8 = call double @pow(double %5, double %7)
ret double %8
}

LLVM IR (-O2):
define double @Sleef_pown_u10(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = tail call double @pow(double %0, double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ DebugTerms(char);
void IFD_DebugTOff(void) { DebugTerms('s'); }


x86 assembly (clang, -O0):
<IFD_DebugTOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x73,%edi
call   1030 <DebugTerms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IFD_DebugTOff>:
mov    $0x73,%edi
jmp    1030 <DebugTerms@plt>

LLVM IR (-O0):
define void @IFD_DebugTOff() {
%1 = call i32 @DebugTerms(i8 signext 115)
ret void
}

LLVM IR (-O2):
define void @IFD_DebugTOff() {
%1 = tail call i32 @DebugTerms(i8 signext 115)
ret void
}
int test_imm_2Auint8_reg(unsigned char val) {
  return ((val) & (-0x2A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Auint8_reg>:
test   $0xd6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -42
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ff_hevc_put_hevc_uni_w_qpel_h4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h4_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ K_set_wall_clock(int, int, int);
int /*<<< orphan*/ atomic(int);
void set_wall_clock(int hrs, int min, int sec) {
  atomic(1);
  K_set_wall_clock(hrs % 24, min % 60, sec % 60);
  atomic(0);
}


x86 assembly (clang, -O0):
<set_wall_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%edi
call   1040 <atomic@plt>
mov    -0x4(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
call   1030 <K_set_wall_clock@plt>
xor    %edi,%edi
call   1040 <atomic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_wall_clock>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <atomic@plt>
movslq %ebx,%rdi
imul   $0x2aaaaaab,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
shl    $0x3,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%edi
movslq %ebp,%rsi
imul   $0xffffffff88888889,%rsi,%rax
shr    $0x20,%rax
add    %esi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%esi
movslq %r14d,%rdx
imul   $0xffffffff88888889,%rdx,%rax
shr    $0x20,%rax
add    %edx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%edx
call   1030 <K_set_wall_clock@plt>
xor    %edi,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <atomic@plt>

LLVM IR (-O0):
define void @set_wall_clock(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @atomic(i32 1)
%8 = load i32, i32* %4
%9 = srem i32 %8, 24
%10 = load i32, i32* %5
%11 = srem i32 %10, 60
%12 = load i32, i32* %6
%13 = srem i32 %12, 60
%14 = call i32 @K_set_wall_clock(i32 %9, i32 %11, i32 %13)
%15 = call i32 @atomic(i32 0)
ret void
}

LLVM IR (-O2):
define void @set_wall_clock(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @atomic(i32 1)
%5 = srem i32 %0, 24
%6 = srem i32 %1, 60
%7 = srem i32 %2, 60
%8 = tail call i32 @K_set_wall_clock(i32 %5, i32 %6, i32 %7)
%9 = tail call i32 @atomic(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void NEG_HOST_REG_W(int reg) {
  addbyte(0x66);
  addbyte(0xf7);
  addbyte(0xd8 | reg);
}


x86 assembly (clang, -O0):
<NEG_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf7,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xd8,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NEG_HOST_REG_W>:
push   %rbx
mov    %edi,%ebx
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf7,%edi
call   1030 <addbyte@plt>
or     $0xd8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @NEG_HOST_REG_W(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 102)
%4 = call i32 @addbyte(i32 247)
%5 = load i32, i32* %2
%6 = or i32 216, %5
%7 = call i32 @addbyte(i32 %6)
ret void
}

LLVM IR (-O2):
define void @NEG_HOST_REG_W(i32 %0) {
%2 = tail call i32 @addbyte(i32 102)
%3 = tail call i32 @addbyte(i32 247)
%4 = or i32 %0, 216
%5 = tail call i32 @addbyte(i32 %4)
ret void
}
/* Variables and functions */
int bar(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
        int /*<<< orphan*/);
int /*<<< orphan*/ foo(int);
int main(void) { return bar(foo(1), foo(2), foo(3), foo(4)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <foo@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    %eax,%ecx
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%edi
call   1040 <foo@plt>
mov    %eax,%r14d
mov    $0x2,%edi
call   1040 <foo@plt>
mov    %eax,%ebp
mov    $0x3,%edi
call   1040 <foo@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1040 <foo@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1)
%3 = call i32 @foo(i32 2)
%4 = call i32 @foo(i32 3)
%5 = call i32 @foo(i32 4)
%6 = call i32 @bar(i32 %2, i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @foo(i32 2)
%3 = tail call i32 @foo(i32 3)
%4 = tail call i32 @foo(i32 4)
%5 = tail call i32 @bar(i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_print_bottom(int x) {
  ft_putchar('C');
  while (x > 2) {
    ft_putchar('B');
    x--;
  }
  if (x > 1) {
    ft_putchar('C');
  }
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_print_bottom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x43,%edi
call   1030 <ft_putchar@plt>
cmpl   $0x2,-0x4(%rbp)
jle    1147 <ft_print_bottom+0x37>
mov    $0x42,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <ft_print_bottom+0x15>
cmpl   $0x1,-0x4(%rbp)
jle    115b <ft_print_bottom+0x4b>
mov    $0x43,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_bottom>:
push   %rbx
mov    %edi,%ebx
mov    $0x43,%edi
call   1030 <ft_putchar@plt>
cmp    $0x3,%ebx
jl     1144 <ft_print_bottom+0x34>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x42,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1130 <ft_print_bottom+0x20>
jmp    1149 <ft_print_bottom+0x39>
cmp    $0x2,%ebx
jne    1153 <ft_print_bottom+0x43>
mov    $0x43,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_bottom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ft_putchar(i8 signext 67)
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 2
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 @ft_putchar(i8 signext 66)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @ft_putchar(i8 signext 67)
br label %16
16: ; preds = %14, %11
%17 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_print_bottom(i32 %0) {
%2 = tail call i32 @ft_putchar(i8 signext 67)
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @ft_putchar(i8 signext 66)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %4, label %11
9: ; preds = %1
%10 = icmp eq i32 %0, 2
br i1 %10, label %11, label %13
11: ; preds = %4, %9
%12 = tail call i32 @ft_putchar(i8 signext 67)
br label %13
13: ; preds = %11, %9
%14 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *lobject_get_attr(struct lemon *, struct lobject *,
                                 struct lobject *);
struct lobject *lobject_get_default_get_attr(struct lemon *lemon,
                                             struct lobject *self, int argc,
                                             struct lobject *argv[]) {
  return lobject_get_attr(lemon, self, argv[0]);
}


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

x86 assembly (clang, -O2):
<lobject_get_default_get_attr>:
mov    (%rcx),%rdx
jmp    1030 <lobject_get_attr@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_get_default_get_attr(%struct.lemon* %0, %struct.lobject* %1, i32 %2, %struct.lobject** %3) {
%5 = alloca %struct.lemon*
%6 = alloca %struct.lobject*
%7 = alloca i32
%8 = alloca %struct.lobject**
store %struct.lemon* %0, %struct.lemon** %5
store %struct.lobject* %1, %struct.lobject** %6
store i32 %2, i32* %7
store %struct.lobject** %3, %struct.lobject*** %8
%9 = load %struct.lemon*, %struct.lemon** %5
%10 = load %struct.lobject*, %struct.lobject** %6
%11 = load %struct.lobject**, %struct.lobject*** %8
%12 = getelementptr inbounds %struct.lobject*, %struct.lobject** %11, i64 0
%13 = load %struct.lobject*, %struct.lobject** %12
%14 = call %struct.lobject* @lobject_get_attr(%struct.lemon* %9, %struct.lobject* %10, %struct.lobject* %13)
ret %struct.lobject* %14
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_get_default_get_attr(%struct.lemon* %0, %struct.lobject* %1, i32 %2, %struct.lobject** nocapture %3) {
%5 = load %struct.lobject*, %struct.lobject** %3
%6 = tail call %struct.lobject* @lobject_get_attr(%struct.lemon* %0, %struct.lobject* %1, %struct.lobject* %5)
ret %struct.lobject* %6
}
/* Variables and functions */
int write(int, short const *, int);
int write_int2_array(int f, const short *iarray, int n) {
  int nwritten;
  nwritten = write(f, iarray, 2 * n);
  if (nwritten <= 0)
    return 0;
  return nwritten / 2;
}


x86 assembly (clang, -O0):
<write_int2_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     114d <write_int2_array+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    115b <write_int2_array+0x4b>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int2_array>:
push   %rax
add    %edx,%edx
call   1030 <write@plt>
test   %eax,%eax
jle    1127 <write_int2_array+0x17>
mov    %eax,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_int2_array(i32 %0, i16* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i16* %1, i16** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i16*, i16** %6
%11 = load i32, i32* %7
%12 = mul nsw i32 2, %11
%13 = call i32 @write(i32 %9, i16* %10, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 0, i32* %4
br label %20
17: ; preds = %3
%18 = load i32, i32* %8
%19 = sdiv i32 %18, 2
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %16
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @write_int2_array(i32 %0, i16* nocapture %1, i32 %2) {
%4 = shl nsw i32 %2, 1
%5 = tail call i32 @write(i32 %0, i16* %1, i32 %4)
%6 = sdiv i32 %5, 2
%7 = icmp sgt i32 %5, 0
%8 = select i1 %7, i32 %6, i32 0
ret i32 %8
}
void SetKeyHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @SetKeyHandler() {
ret void
}
/* Variables and functions */
char *config_get(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int ppp_mode(void) {
  char *p = config_get("wan_proto");
  return !strcmp(p, "pppoe") || !strcmp(p, "pptp");
}


x86 assembly (clang, -O0):
<ppp_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <config_get@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1173 <ppp_mode+0x53>
mov    -0x8(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%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):
<ppp_mode>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <config_get@plt>
mov    %rax,%rbx
lea    0xed3(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     115d <ppp_mode+0x3d>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"wan_proto\00"
@.str.1 = [6 x i8] c"pppoe\00"
@.str.2 = [5 x i8] c"pptp\00"
define i32 @ppp_mode() {
%1 = alloca i8*
%2 = call i8* @config_get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i8*, i8** %1
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %0
%12 = phi i1 [ true, %0 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [10 x i8] c"wan_proto\00"
@.str.1 = [6 x i8] c"pppoe\00"
@.str.2 = [5 x i8] c"pptp\00"
define i32 @ppp_mode() {
%1 = tail call i8* @config_get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %0
%9 = phi i32 [ 1, %0 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ nxtDisplayCenteredBigTextLine(int, char *);
int /*<<< orphan*/ nxtDisplayCenteredTextLine(int, char *);
void showEnd() {
  nxtDisplayCenteredBigTextLine(1, "Fertig!");
  nxtDisplayCenteredTextLine(3, "Programm");
  nxtDisplayCenteredTextLine(4, "beendet.");
}


x86 assembly (clang, -O0):
<showEnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
mov    $0x3,%edi
lea    0xec7(%rip),%rsi
call   1040 <nxtDisplayCenteredTextLine@plt>
mov    $0x4,%edi
lea    0xebf(%rip),%rsi
call   1040 <nxtDisplayCenteredTextLine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showEnd>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
lea    0xecf(%rip),%rsi
mov    $0x3,%edi
call   1040 <nxtDisplayCenteredTextLine@plt>
lea    0xec7(%rip),%rsi
mov    $0x4,%edi
pop    %rax
jmp    1040 <nxtDisplayCenteredTextLine@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Fertig!\00"
@.str.1 = [9 x i8] c"Programm\00"
@.str.2 = [9 x i8] c"beendet.\00"
define void @showEnd() {
%1 = call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @nxtDisplayCenteredTextLine(i32 3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @nxtDisplayCenteredTextLine(i32 4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Fertig!\00"
@.str.1 = [9 x i8] c"Programm\00"
@.str.2 = [9 x i8] c"beendet.\00"
define void @showEnd() {
%1 = tail call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @nxtDisplayCenteredTextLine(i32 3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @nxtDisplayCenteredTextLine(i32 4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int test_imm_EBuint16_reg(unsigned short val) {
  return ((val) & (0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xeb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBuint16_reg>:
test   $0xeb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_EBuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 235
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int precedence(char elem) {
  switch (elem) {
  case '+':
  case '-':
    return 1;
  case '*':
  case '/':
    return 2;
  case '^':
    return 3;
  case '(':
  case '#':
    return 0;
  }
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3b,%eax
ja     115f <precedence+0x5f>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    115f <precedence+0x5f>
movl   $0x2,-0x4(%rbp)
jmp    115f <precedence+0x5f>
movl   $0x3,-0x4(%rbp)
jmp    115f <precedence+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
mov    $0x1,%eax
lea    -0x23(%rdi),%ecx
cmp    $0xc,%ecx
ja     1126 <precedence+0x26>
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
xor    %eax,%eax
ret
mov    $0x2,%eax
ret
cmp    $0x5e,%edi
jne    111f <precedence+0x1f>
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @precedence(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 94, label %8
i32 40, label %9
i32 35, label %9
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %10
7: ; preds = %1, %1
store i32 2, i32* %2
br label %10
8: ; preds = %1
store i32 3, i32* %2
br label %10
9: ; preds = %1, %1
store i32 0, i32* %2
br label %10
10: ; preds = %6, %7, %8, %9, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @precedence(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 35, label %5
i32 40, label %5
i32 42, label %3
i32 47, label %3
i32 94, label %4
]
3: ; preds = %1, %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1, %1
br label %6
6: ; preds = %3, %4, %5, %1
%7 = phi i32 [ 0, %5 ], [ 3, %4 ], [ 2, %3 ], [ 1, %1 ]
ret i32 %7
}
void test4(void) {
  int a[] = {1, 2, 3, 4};
  int b = 0;
  __asm__("leaq %1, %%r10 \n\t"
          "mov %2, %%r15d \n\t"
          "leaq (, %%r15, 4), %%rax \n\t"
          "mov (%%r10, %%rax, 1), %0 \n\t"
          : "=r"(b)
          : "m"(a[0]), "r"(a[1])
          : "rax", "r10", "r15");
  assert(b == a[2]);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
push   %r15
sub    $0x28,%rsp
mov    0xedf(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rcx
mov    -0x1c(%rbp),%edx
lea    (%rcx),%r10
mov    %edx,%r15d
lea    0x0(,%r15,4),%rax
mov    (%r10,%rax,1),%ecx
mov    %ecx,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
add    $0x28,%rsp
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %r15
sub    $0x10,%rsp
movaps 0xee3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x2,%ecx
lea    (%rsp),%r10
mov    %ecx,%r15d
lea    0x0(,%r15,4),%rax
mov    (%r10,%rax,1),%ecx
xor    %edi,%edi
cmp    $0x3,%ecx
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %r15
ret

LLVM IR (-O0):
@__const.test4.a = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define void @test4() {
%1 = alloca [4 x i32]
%2 = alloca i32
%3 = bitcast [4 x i32]* %1 to i8*
store i32 0, i32* %2
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = call i32 asm "leaq $1, %r10 \0A\09mov $2, %r15d \0A\09leaq (, %r15, 4), %rax \0A\09mov (%r10, %rax, 1), $0 \0A\09", "=r,*m,r,~{rax},~{r10},~{r15},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4, i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%10 = load i32, i32* %9
%11 = icmp eq i32 %8, %10
%12 = zext i1 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %12)
ret void
}

LLVM IR (-O2):
@__const.test4.a = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
define void @test4() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 asm "leaq $1, %r10 \0A\09mov $2, %r15d \0A\09leaq (, %r15, 4), %rax \0A\09mov (%r10, %rax, 1), $0 \0A\09", "=r,*m,r,~{rax},~{r10},~{r15},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32 2)
%5 = icmp eq i32 %4, 3
%6 = zext i1 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %6)
ret void
}
/* Variables and functions */
int getch();
int tty_getchar() { return getch(); }


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

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

LLVM IR (-O0):
define i32 @tty_getchar() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @tty_getchar() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
short int print_num(short int num) {
  printf("%d ", num);
  if (num != 10)
    return print_num(num + 1);
}


x86 assembly (clang, -O0):
<print_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
lea    0xeca(%rip),%rdi
movswl -0x4(%rbp),%esi
call   1030 <printf@plt>
movswl -0x4(%rbp),%eax
cmp    $0xa,%eax
je     115f <print_num+0x3f>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
movswl %ax,%edi
call   1040 <print_num@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_num>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movswl %bx,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xb,%bx
jne    1120 <print_num+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define signext i16 @print_num(i16 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i16 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %3)
%5 = icmp eq i16 %3, 10
%6 = add i16 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i16 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void disp_chkerror(int cond, char *e) {
  if (!cond)
    return;
  fprintf(stderr, "error: %s\n", e ? e : "?");
  abort();
}


x86 assembly (clang, -O0):
<disp_chkerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113f <disp_chkerror+0x1f>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <disp_chkerror+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1173 <disp_chkerror+0x53>
lea    0xea1(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1173 <disp_chkerror+0x53>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rdx
lea    0xe7f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<disp_chkerror>:
test   %edi,%edi
jne    1125 <disp_chkerror+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
test   %rsi,%rsi
lea    0xed2(%rip),%rdx
cmovne %rsi,%rdx
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
@.str.1 = [2 x i8] c"?\00"
define void @disp_chkerror(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = icmp eq i8* %1, null
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %1
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 (...) @abort()
unreachable
}