xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ lim_outc(char, size_t *, char *, size_t);
void lim_strcat(const char *s, size_t *pos, char *buf, size_t bufsz) {
  char c;
  while ((c = *s++)) {
    lim_outc(c, pos, buf, bufsz);
  }
}


x86 assembly (clang, -O0):
<lim_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x21(%rbp)
cmp    $0x0,%al
je     1160 <lim_strcat+0x50>
mov    -0x21(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movsbl %al,%edi
call   1030 <lim_outc@plt>
jmp    1128 <lim_strcat+0x18>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lim_strcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114c <lim_strcat+0x3c>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <lim_outc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <lim_strcat+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @lim_strcat(i8* nocapture %0, i64* %1, i8* %2, i64 %3) {
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %12, %7 ], [ %5, %4 ]
%9 = phi i8* [ %10, %7 ], [ %0, %4 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = tail call i32 @lim_outc(i8 signext %8, i64* %1, i8* %2, i64 %3)
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_settime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ ctime_r(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void timet_h() {
  struct timespec *ptp;
  clock_settime(CLOCK_REALTIME, ptp);
  time_t clock = time(0);
  char buf[26];
  ctime_r(&clock, buf);
}


x86 assembly (clang, -O0):
<timet_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1050 <clock_settime@plt>
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0xc(%rbp),%rdi
call   1040 <ctime_r@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timet_h>:
sub    $0x38,%rsp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <clock_settime@plt>
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <ctime_r@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define void @timet_h() {
%1 = alloca %struct.timespec*
%2 = alloca i32
%3 = alloca [26 x i8]
%4 = load i32, i32* @CLOCK_REALTIME
%5 = load %struct.timespec*, %struct.timespec** %1
%6 = call i32 @clock_settime(i32 %4, %struct.timespec* %5)
%7 = call i32 @time(i32 0)
store i32 %7, i32* %2
%8 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 0
%9 = call i32 @ctime_r(i32* %2, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define void @timet_h() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = load i32, i32* @CLOCK_REALTIME
%4 = tail call i32 @clock_settime(i32 %3, %struct.timespec* undef)
%5 = bitcast i32* %1 to i8*
%6 = tail call i32 @time(i32 0)
store i32 %6, i32* %1
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%8 = call i32 @ctime_r(i32* %1, i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
void usage(const char *filepath) {
  error(1, 0,
        "Usage: %s [-C connect_timeout] [-Grtv] [-b addr] [-p port]"
        " [-l pktlen] [-n packetnr] [-R rcv_timeout] [-S gsosize]",
        filepath);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
lea    0xed2(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [115 x i8] c"Usage: %s [-C connect_timeout] [-Grtv] [-b addr] [-p port] [-l pktlen] [-n packetnr] [-R rcv_timeout] [-S gsosize]\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [115 x i8] c"Usage: %s [-C connect_timeout] [-Grtv] [-b addr] [-p port] [-l pktlen] [-n packetnr] [-R rcv_timeout] [-S gsosize]\00"
define void @usage(i8* %0) {
%2 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int rand();
int sorteia(int k) {
  int r;
  r = rand() % k;
  return r;
}


x86 assembly (clang, -O0):
<sorteia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sorteia>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sorteia(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @sorteia(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sRetVal;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *WhiteSpace(const int nLength) {
  static char sRetVal[128];
  memset(sRetVal, 0, sizeof(sRetVal));
  int i = 0;
  for (i = 0; i < nLength; i++)
    sRetVal[i] = ' ';
  return sRetVal;
}


x86 assembly (clang, -O0):
<WhiteSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0x2f1e(%rip),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <WhiteSpace+0x55>
movslq -0x8(%rbp),%rcx
lea    0x2eed(%rip),%rax
movb   $0x20,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <WhiteSpace+0x2c>
lea    0x2ed4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WhiteSpace>:
push   %rbx
mov    %edi,%ebx
lea    0x2f26(%rip),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
test   %ebx,%ebx
jle    113d <WhiteSpace+0x2d>
mov    %ebx,%edx
lea    0x2f0d(%rip),%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
lea    0x2efc(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@WhiteSpace.sRetVal = internal global [128 x i8] zeroinitializer
define i8* @WhiteSpace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @memset(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @WhiteSpace.sRetVal, i64 0, i64 0), i32 0, i32 128)
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [128 x i8], [128 x i8]* @WhiteSpace.sRetVal, i64 0, i64 %11
store i8 32, i8* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @WhiteSpace.sRetVal, i64 0, i64 0)
}

LLVM IR (-O2):
@WhiteSpace.sRetVal = internal global [128 x i8] zeroinitializer
define i8* @WhiteSpace(i32 %0) {
%2 = tail call i32 @memset(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @WhiteSpace.sRetVal, i64 0, i64 0), i32 0, i32 128)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %1
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @WhiteSpace.sRetVal, i64 0, i64 0)
}
/* Type definitions */
struct mem_param {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
struct mem_param *spd_set_memclk();
void main(void) {
  const struct mem_param *param;
  param = spd_set_memclk();
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <spd_set_memclk@plt>
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <spd_set_memclk@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.mem_param = type { i32 }
define void @main() {
%1 = alloca %struct.mem_param*
%2 = call %struct.mem_param* (...) @spd_set_memclk()
store %struct.mem_param* %2, %struct.mem_param** %1
%3 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.mem_param = type { i32 }
define void @main() {
%1 = tail call %struct.mem_param* (...) @spd_set_memclk()
%2 = tail call i32 @_exit(i32 0)
unreachable
}
int test_imm_F4int64_lowword_reg(long long val) {
  return ((val) & (0xF4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F4int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xf4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F4int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 244
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ catchint();
void breakread() { catchint(); }


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

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

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

LLVM IR (-O2):
define void @breakread() {
%1 = tail call i32 (...) @catchint()
ret void
}
void rpmvs_(dx, dy, dz) short *dx, *dy, *dz;
{ rpmv((float)*dx, (float)*dy, (float)*dz); }


x86 assembly (clang, -O0):
<rpmvs_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <rpmv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmvs_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
movswl (%rdx),%eax
cvtsi2sd %eax,%xmm2
mov    $0x3,%al
jmp    1030 <rpmv@plt>

LLVM IR (-O0):
define void @rpmvs_(i16* %0, i16* %1, i16* %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16*
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = fpext float %9 to double
%11 = load i16*, i16** %5
%12 = load i16, i16* %11
%13 = sitofp i16 %12 to float
%14 = fpext float %13 to double
%15 = load i16*, i16** %6
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @rpmv to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @rpmvs_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2) {
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to double
%6 = load i16, i16* %1
%7 = sitofp i16 %6 to double
%8 = load i16, i16* %2
%9 = sitofp i16 %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @rpmv to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void twelve() {
  float *values;
  int i, n = 10;
  for (i = 0; i < n; i++)
    values[i] = (float)i / n;
  for (i = 0; i < n; i++)
    printf("%f ", values[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<twelve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115b <twelve+0x4b>
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <twelve+0x16>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    119b <twelve+0x8b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <twelve+0x52>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [4 x i8] c"%f \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @twelve() {
%1 = alloca float*
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
%13 = fdiv float %10, %12
%14 = load float*, float** %1
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds float, float* %14, i64 %16
store float %13, float* %17
br label %18
18: ; preds = %8
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
store i32 0, i32* %2
br label %22
22: ; preds = %34, %21
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %37
26: ; preds = %22
%27 = load float*, float** %1
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds float, float* %27, i64 %29
%31 = load float, float* %30
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %32)
br label %34
34: ; preds = %26
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %22
37: ; preds = %22
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *program_name) {
  fprintf(stderr,
          "This program copies the phontab, phonindex and phondata files from "
          "a given\n"
          "directory, swapping values to big-endian form if necessary.\n\n"
          "Usage:\n"
          "  %s [INPUT_DIR] [OUTPUT_DIR] [MANIFEST_FILE]\n\n"
          "By default, the MANIFEST_FILE used is a file called "
          "'phondata-manifest' in\n"
          "the current directory. The default INPUT_DIR is "
          "/usr/share/espeak-data and\n"
          "OUTPUT_DIR is the current directory.\n",
          program_name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [378 x i8] c"This program copies the phontab, phonindex and phondata files from a given\0Adirectory, swapping values to big-endian form if necessary.\0A\0AUsage:\0A %s [INPUT_DIR] [OUTPUT_DIR] [MANIFEST_FILE]\0A\0ABy default, the MANIFEST_FILE used is a file called 'phondata-manifest' in\0Athe current directory. The default INPUT_DIR is /usr/share/espeak-data and\0AOUTPUT_DIR is the current directory.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [378 x i8] c"This program copies the phontab, phonindex and phondata files from a given\0Adirectory, swapping values to big-endian form if necessary.\0A\0AUsage:\0A %s [INPUT_DIR] [OUTPUT_DIR] [MANIFEST_FILE]\0A\0ABy default, the MANIFEST_FILE used is a file called 'phondata-manifest' in\0Athe current directory. The default INPUT_DIR is /usr/share/espeak-data and\0AOUTPUT_DIR is the current directory.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void readError() {
  fprintf(stderr, "Bad graph data file\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Bad graph data file\0A\00"
define void @readError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Bad graph data file\0A\00"
define void @readError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double exp(double);
double tanh(double x) {
  double y = exp(x + x);
  return (y - 1.) / (y + 1.);
}


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

x86 assembly (clang, -O2):
<tanh>:
push   %rax
addsd  %xmm0,%xmm0
call   1030 <exp@plt>
movsd  0xede(%rip),%xmm1
addsd  %xmm0,%xmm1
addsd  0xeda(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fadd double %4, %5
%7 = call double @exp(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = fsub double %8, 1.000000e+00
%10 = load double, double* %3
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = fadd double %0, %0
%3 = tail call double @exp(double %2)
%4 = fadd double %3, -1.000000e+00
%5 = fadd double %3, 1.000000e+00
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, long, char *, unsigned char);
void abstract_text___Byte_native_byte_to_s___impl(unsigned char self,
                                                  char *nstr, long strlen) {
  snprintf(nstr, strlen, "0x%02x", self);
}


x86 assembly (clang, -O0):
<abstract_text___Byte_native_byte_to_s___impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xecb(%rip),%rdx
movzbl -0x1(%rbp),%ecx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abstract_text___Byte_native_byte_to_s___impl>:
mov    %edi,%ecx
lea    0xee7(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"0x%02x\00"
define void @abstract_text___Byte_native_byte_to_s___impl(i8 zeroext %0, i8* %1, i64 %2) {
%4 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
ret void
}
const char *config_bool_str(int val) {
  if (val == 0)
    return "false";
  else if (val == 1)
    return "true";
  else
    return "invalid";
}


x86 assembly (clang, -O0):
<config_bool_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <config_bool_str+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <config_bool_str+0x46>
cmpl   $0x1,-0xc(%rbp)
jne    113b <config_bool_str+0x3b>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <config_bool_str+0x46>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_bool_str>:
cmp    $0x1,%edi
lea    0xefc(%rip),%rax
lea    0xefa(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"false\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [8 x i8] c"invalid\00"
define i8* @config_bool_str(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void kputs(char *a) {
  puts("\t[dummy] ");
  puts(a);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"\09[dummy] \00"
define void @kputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\09[dummy] \00"
define void @kputs(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
void davinci_mux_init(void) {}


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

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

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

LLVM IR (-O2):
define void @davinci_mux_init() {
ret void
}
void gtk_cell_view_set_background_color() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_set_background_color() {
ret void
}
void radeon_kfd_interrupt(struct radeon_device *rdev,
                          const void *ih_ring_entry) {}


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

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

LLVM IR (-O0):
%struct.radeon_device = type opaque
define void @radeon_kfd_interrupt(%struct.radeon_device* %0, i8* %1) {
%3 = alloca %struct.radeon_device*
%4 = alloca i8*
store %struct.radeon_device* %0, %struct.radeon_device** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.radeon_device = type opaque
define void @radeon_kfd_interrupt(%struct.radeon_device* nocapture %0, i8* nocapture %1) {
ret void
}
int baud_up(int baud) {
  if (baud < 300)
    baud = 300;
  else if (baud == 38400)
    baud = 57600;
  else
    baud = baud * 2;
  if (baud > 115200)
    baud = 115200;
  return baud;
}


x86 assembly (clang, -O0):
<baud_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x12c,-0x4(%rbp)
jge    1120 <baud_up+0x20>
movl   $0x12c,-0x4(%rbp)
jmp    1147 <baud_up+0x47>
cmpl   $0x9600,-0x4(%rbp)
jne    1139 <baud_up+0x39>
movl   $0xe100,-0x4(%rbp)
jmp    1142 <baud_up+0x42>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <baud_up+0x47>
cmpl   $0x1c200,-0x4(%rbp)
jle    115b <baud_up+0x5b>
movl   $0x1c200,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baud_up>:
lea    (%rdi,%rdi,1),%eax
cmp    $0x9600,%edi
mov    $0xe100,%ecx
cmovne %eax,%ecx
cmp    $0x12c,%edi
mov    $0x12c,%edx
cmovge %ecx,%edx
cmp    $0x1c200,%edx
mov    $0x1c200,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @baud_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 300
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 300, i32* %2
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 38400
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 57600, i32* %2
br label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 2
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
br label %14
14: ; preds = %13, %5
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 115200
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 115200, i32* %2
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @baud_up(i32 %0) {
%2 = icmp slt i32 %0, 300
%3 = icmp eq i32 %0, 38400
%4 = shl nsw i32 %0, 1
%5 = select i1 %3, i32 57600, i32 %4
%6 = select i1 %2, i32 300, i32 %5
%7 = icmp slt i32 %6, 115200
%8 = select i1 %7, i32 %6, i32 115200
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void write_end_switch(FILE *out, size_t depth) {
  fputs("\ndefault: break;\n}", out);
  if (depth > 0)
    fputs("break;", out);
  else
    fputc('\n', out);
}


x86 assembly (clang, -O0):
<write_end_switch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <fputs@plt>
cmpq   $0x0,-0x10(%rbp)
jbe    1160 <write_end_switch+0x40>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <fputs@plt>
jmp    116e <write_end_switch+0x4e>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_end_switch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   %r14,%r14
je     1168 <write_end_switch+0x48>
lea    0xec4(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0Adefault: break;\0A}\00"
@.str.1 = [7 x i8] c"break;\00"
define void @write_end_switch(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = load i64, i64* %4
%8 = icmp ugt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %10)
br label %15
12: ; preds = %2
%13 = load i32*, i32** %3
%14 = call i32 @fputc(i8 signext 10, i32* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0Adefault: break;\0A}\00"
@.str.1 = [7 x i8] c"break;\00"
define void @write_end_switch(i32* nocapture %0, i64 %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 18, i64 1, i32* %0)
%4 = icmp eq i64 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 6, i64 1, i32* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @fputc(i8 signext 10, i32* %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef long uint32_t;

/* Variables and functions */
unsigned char *Z_NULL;
long crc32(long, unsigned char *, size_t);
int test_buffer_crc(unsigned char *in, size_t inlen, uint32_t original_crc) {
  uint32_t crc = crc32(0L, Z_NULL, 0);
  crc = crc32(crc, in, inlen);
  return crc == original_crc ? 0 : -1;
}


x86 assembly (clang, -O0):
<test_buffer_crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
call   1030 <crc32@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <crc32@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_buffer_crc>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <crc32@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <crc32@plt>
xor    %ecx,%ecx
cmp    %r14,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@Z_NULL = global i8* null
define i32 @test_buffer_crc(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** @Z_NULL
%9 = call i64 @crc32(i64 0, i8* %8, i64 0)
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = call i64 @crc32(i64 %10, i8* %11, i64 %12)
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = load i64, i64* %6
%16 = icmp eq i64 %14, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 -1
ret i32 %18
}

LLVM IR (-O2):
@Z_NULL = global i8* null
define i32 @test_buffer_crc(i8* %0, i64 %1, i64 %2) {
%4 = load i8*, i8** @Z_NULL
%5 = tail call i64 @crc32(i64 0, i8* %4, i64 0)
%6 = tail call i64 @crc32(i64 %5, i8* %0, i64 %1)
%7 = icmp ne i64 %6, %2
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ isalnum(char);
int valid_name_char(char c) { return isalnum(c) || (c == '_'); }


x86 assembly (clang, -O0):
<valid_name_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <valid_name_char+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_name_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @valid_name_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @valid_name_char(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int ntohl(int /*<<< orphan*/);
uint64_t ntohll(uint64_t i) {
  union {
    uint64_t ui64;
    struct {
      uint32_t a;
      uint32_t b;
    } ui32;
  } u;
  u.ui64 = i;
  uint64_t word0 = ntohl(u.ui32.a);
  uint64_t word1 = ntohl(u.ui32.b);
  uint64_t reslt = (word0 << 32) ^ (word1 << 0);
  return reslt;
}


x86 assembly (clang, -O0):
<ntohll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    -0x18(%rbp),%ecx
shl    $0x0,%ecx
xor    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohll>:
push   %rax
call   1030 <ntohl@plt>
pop    %rax
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { i32, i32 }
define i32 @ntohll(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = bitcast %union.anon* %3 to i32*
store i32 %7, i32* %8
%9 = bitcast %union.anon* %3 to %struct.anon*
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @ntohl(i32 %11)
store i32 %12, i32* %4
%13 = bitcast %union.anon* %3 to %struct.anon*
%14 = getelementptr inbounds %struct.anon, %struct.anon* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = call i32 @ntohl(i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = shl i32 %17, 32
%19 = load i32, i32* %5
%20 = shl i32 %19, 0
%21 = xor i32 %18, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
ret i32 %22
}

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

/* Variables and functions */
void smpte_hbrmt_set_video_payload_scrambling(uint8_t *p_hbrmt, uint8_t s) {
  p_hbrmt[2] |= (s & 0x3) << 4;
}


x86 assembly (clang, -O0):
<smpte_hbrmt_set_video_payload_scrambling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_hbrmt_set_video_payload_scrambling>:
shl    $0x4,%esi
and    $0x30,%esi
or     %esi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @smpte_hbrmt_set_video_payload_scrambling(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 3
%7 = shl i32 %6, 4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = or i32 %10, %7
store i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @smpte_hbrmt_set_video_payload_scrambling(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 4
%4 = and i32 %3, 48
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
ret void
}
void add_digits(char a, char b, char c, char *d, char *e) {
  char sum = a + b + c;
  *d = sum / 10;
  *e = sum % 10;
}


x86 assembly (clang, -O0):
<add_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
movsbl -0x3(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x19(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_digits>:
add    %dil,%sil
add    %dl,%sil
movsbl %sil,%eax
imul   $0x67,%eax,%edx
movzwl %dx,%esi
shr    $0xa,%edx
shr    $0xf,%esi
add    %dl,%sil
mov    %sil,(%rcx)
movzbl %sil,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
mov    %al,(%r8)
ret

LLVM IR (-O0):
define void @add_digits(i8 signext %0, i8 signext %1, i8 signext %2, i8* %3, i8* %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
%16 = add nsw i32 %13, %15
%17 = load i8, i8* %8
%18 = sext i8 %17 to i32
%19 = add nsw i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %11
%21 = load i8, i8* %11
%22 = sext i8 %21 to i32
%23 = sdiv i32 %22, 10
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %9
store i8 %24, i8* %25
%26 = load i8, i8* %11
%27 = sext i8 %26 to i32
%28 = srem i32 %27, 10
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %10
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @add_digits(i8 signext %0, i8 signext %1, i8 signext %2, i8* nocapture writeonly %3, i8* nocapture writeonly %4) {
%6 = add i8 %1, %0
%7 = add i8 %6, %2
%8 = sdiv i8 %7, 10
store i8 %8, i8* %3
%9 = srem i8 %7, 10
store i8 %9, i8* %4
ret void
}
/* Variables and functions */
long getSystemTime();
int /*<<< orphan*/ heapSort(int *, int);
int /*<<< orphan*/ printf(char *, int, long);
void heapSortTest(int *arr, int size) {
  long startTime = getSystemTime();
  heapSort(arr, size);
  printf("heapSort count %d use time: %ld \n", (1000000),
         (getSystemTime() - startTime));
}


x86 assembly (clang, -O0):
<heapSortTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getSystemTime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <heapSort@plt>
mov    $0x0,%al
call   1050 <getSystemTime@plt>
mov    %rax,%rdx
sub    -0x18(%rbp),%rdx
lea    0xe95(%rip),%rdi
mov    $0xf4240,%esi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapSortTest>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <getSystemTime@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <heapSort@plt>
xor    %eax,%eax
call   1050 <getSystemTime@plt>
sub    %r14,%rax
lea    0xea2(%rip),%rdi
mov    $0xf4240,%esi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"heapSort count %d use time: %ld \0A\00"
define void @heapSortTest(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i64 (...) @getSystemTime()
store i64 %6, i64* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @heapSort(i32* %7, i32 %8)
%10 = call i64 (...) @getSystemTime()
%11 = load i64, i64* %5
%12 = sub nsw i64 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 1000000, i64 %12)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"heapSort count %d use time: %ld \0A\00"
define void @heapSortTest(i32* %0, i32 %1) {
%3 = tail call i64 (...) @getSystemTime()
%4 = tail call i32 @heapSort(i32* %0, i32 %1)
%5 = tail call i64 (...) @getSystemTime()
%6 = sub nsw i64 %5, %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 1000000, i64 %6)
ret void
}
int neg(int x) { return !x; }


x86 assembly (clang, -O0):
<neg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @neg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @neg(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void test_invalid_clause() {
  int i;
#pragma omp parallel
#pragma omp taskloop foo bar
  for (i = 0; i < 16; ++i)
    ;
#pragma omp taskloop nogroup nogroup
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_invalid_clause+0x4c>
jmp    113e <test_invalid_clause+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_invalid_clause+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t msecs_since_epoch() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (uint64_t)(tv.tv_sec) * 1000 + (uint64_t)(tv.tv_usec) / 1000;
}


x86 assembly (clang, -O0):
<msecs_since_epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msecs_since_epoch>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @msecs_since_epoch() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @msecs_since_epoch() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %11, %7
ret i32 %12
}