xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int my_rand(unsigned int *);
double my_drand(unsigned *seed_p) {
  unsigned x = my_rand(seed_p);
  double y = x / ((double)4294967291U);
  return y;
}


x86 assembly (clang, -O0):
<my_drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_drand>:
push   %rax
call   1030 <my_rand@plt>
mov    %eax,%eax
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @my_drand(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @my_rand(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = uitofp i32 %7 to double
%9 = fdiv double %8, 0x41EFFFFFFF600000
store double %9, double* %4
%10 = load double, double* %4
ret double %10
}

LLVM IR (-O2):
define double @my_drand(i32* %0) {
%2 = tail call i32 @my_rand(i32* %0)
%3 = uitofp i32 %2 to double
%4 = fdiv double %3, 0x41EFFFFFFF600000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ vfunc();
void baz() {
  int x;
  vfunc();
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <vfunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @baz() {
%1 = alloca i32
%2 = call i32 (...) @vfunc()
ret void
}

LLVM IR (-O2):
define void @baz() {
%1 = tail call i32 (...) @vfunc()
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
bool isValidComponent0(int32_t const x0) { return ((x0 >= 0) && (x0 <= 255)); }


x86 assembly (clang, -O0):
<isValidComponent0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <isValidComponent0+0x23>
cmpl   $0xff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidComponent0>:
xor    %eax,%eax
cmp    $0x100,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isValidComponent0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 255
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isValidComponent0(i32 %0) {
%2 = icmp ult i32 %0, 256
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_CREAT;
int S_IRUSR;
int S_IXOTH;
int /*<<< orphan*/ open(char *, int /*<<< orphan*/, int);
void test3() { open("testFile", O_CREAT, S_IRUSR | S_IXOTH); }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%esi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    0x2eb3(%rip),%rax
or     (%rax),%edx
lea    0xeca(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0xece(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"testFile\00"
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IXOTH = global i32 0
define void @test3() {
%1 = load i32, i32* @O_CREAT
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IXOTH
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"testFile\00"
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IXOTH = global i32 0
define void @test3() {
%1 = load i32, i32* @O_CREAT
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IXOTH
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void assert2(void) { assert(1 == 1); }


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

x86 assembly (clang, -O2):
<assert2>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @assert2() {
%1 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @assert2() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
char tolower(char);
int img_hex_val(char c) {
  c = tolower(c);
  if (isdigit(c))
    return c - '0';
  return c - 'a' + 10;
}


x86 assembly (clang, -O0):
<img_hex_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <tolower@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115c <img_hex_val+0x3c>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <img_hex_val+0x49>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<img_hex_val>:
push   %rbx
call   1040 <tolower@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
lea    -0x30(%rbx),%ecx
add    $0xffffffa9,%ebx
test   %rax,%rax
cmovne %ecx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @img_hex_val(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call signext i8 @tolower(i8 signext %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = call i64 @isdigit(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
store i32 %12, i32* %2
br label %18
13: ; preds = %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 97
%17 = add nsw i32 %16, 10
store i32 %17, i32* %2
br label %18
18: ; preds = %13, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @img_hex_val(i8 signext %0) {
%2 = tail call signext i8 @tolower(i8 signext %0)
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
%5 = sext i8 %2 to i32
%6 = select i1 %4, i32 -87, i32 -48
%7 = add nsw i32 %6, %5
ret i32 %7
}
void gtk_text_child_anchor_get_widgets() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ RSA_F_RSA_NULL;
int /*<<< orphan*/ RSA_R_RSA_OPERATIONS_NOT_SUPPORTED;
int /*<<< orphan*/ RSAerr(int /*<<< orphan*/, int /*<<< orphan*/);
int RSA_null_public_decrypt(int flen, unsigned char *from, unsigned char *to,
                            RSA *rsa, int padding) {
  RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
  return -1;
}


x86 assembly (clang, -O0):
<RSA_null_public_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1030 <RSAerr@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_null_public_decrypt>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
call   1030 <RSAerr@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RSA_F_RSA_NULL = global i32 0
@RSA_R_RSA_OPERATIONS_NOT_SUPPORTED = global i32 0
define i32 @RSA_null_public_decrypt(i32 %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* @RSA_F_RSA_NULL
%12 = load i32, i32* @RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
%13 = call i32 @RSAerr(i32 %11, i32 %12)
ret i32 -1
}

LLVM IR (-O2):
@RSA_F_RSA_NULL = global i32 0
@RSA_R_RSA_OPERATIONS_NOT_SUPPORTED = global i32 0
define i32 @RSA_null_public_decrypt(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32* nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @RSA_F_RSA_NULL
%7 = load i32, i32* @RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
%8 = tail call i32 @RSAerr(i32 %6, i32 %7)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int f_proj4_ll2i(int mode, unsigned char **sec, float *data, unsigned int ndata,
                 char *inv_out, void **local, const char *arg1,
                 const char *arg2) {
  if (mode == -1) {
    fprintf(stderr, "Proj4 package not installed\n");
    return 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<f_proj4_ll2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1161 <f_proj4_ll2i+0x51>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <f_proj4_ll2i+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_proj4_ll2i>:
cmp    $0xffffffff,%edi
je     111b <f_proj4_ll2i+0xb>
mov    $0x1,%eax
ret
push   %rax
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Proj4 package not installed\0A\00"
define i32 @f_proj4_ll2i(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca float*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8**
%16 = alloca i8*
%17 = alloca i8*
store i32 %0, i32* %10
store i8** %1, i8*** %11
store float* %2, float** %12
store i32 %3, i32* %13
store i8* %4, i8** %14
store i8** %5, i8*** %15
store i8* %6, i8** %16
store i8* %7, i8** %17
%18 = load i32, i32* %10
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %23
20: ; preds = %8
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %9
br label %24
23: ; preds = %8
store i32 1, i32* %9
br label %24
24: ; preds = %23, %20
%25 = load i32, i32* %9
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Proj4 package not installed\0A\00"
define i32 @f_proj4_ll2i(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7) {
%9 = icmp eq i32 %0, -1
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %8, %10
ret i32 1
}
int cont(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cont() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int example_fcall(int *array, int array_size) {
  compute(10);
  return 0;
}


x86 assembly (clang, -O0):
<example_fcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_fcall>:
push   %rax
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @example_fcall(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @compute(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @example_fcall(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret i32 0
}
/* Variables and functions */
char *strchr(char const *, char);
void str_removenl(const char *str) {
  char *nl = strchr(str, '\n');
  if (nl != NULL)
    *nl = '\0';
}


x86 assembly (clang, -O0):
<str_removenl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <str_removenl+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_removenl>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <str_removenl+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @str_removenl(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @str_removenl(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_storer_pd(void *, int /*<<< orphan*/);
void test_storer_pd(__m128d x, void *y) { _mm_storer_pd(y, x); }


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

x86 assembly (clang, -O2):
<test_storer_pd>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <_mm_storer_pd@plt>

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

LLVM IR (-O2):
define void @test_storer_pd(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_storer_pd(i8* %1, i32 %0)
ret void
}
unsigned dectou(const char *buffer, const char **endptr) {
  const char *p = buffer;
  unsigned n = 0;
  for (;;) {
    char c = *p;
    if (c < '0' || c > '9')
      break;
    p++;
    n = 10 * n + (c - '0');
  }
  *endptr = p;
  return n;
}


x86 assembly (clang, -O0):
<dectou>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%eax
cmp    $0x30,%eax
jl     113e <dectou+0x3e>
movsbl -0x1d(%rbp),%eax
cmp    $0x39,%eax
jle    1143 <dectou+0x43>
jmp    1164 <dectou+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
imul   $0xa,-0x1c(%rbp),%eax
movsbl -0x1d(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <dectou+0x1b>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dectou>:
add    $0xffffffffffffffff,%rdi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%eax
movsbl 0x1(%rdi),%ecx
add    $0x1,%rdi
lea    -0x3a(%rcx),%r8d
lea    (%rax,%rax,4),%edx
lea    (%rcx,%rdx,2),%ecx
add    $0xffffffd0,%ecx
cmp    $0xf5,%r8b
ja     1110 <dectou+0x10>
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @dectou(i8* %0, i8** nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %13, %3 ]
%5 = phi i8* [ %0, %2 ], [ %10, %3 ]
%6 = load i8, i8* %5
%7 = add i8 %6, -58
%8 = icmp ult i8 %7, -10
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = mul i32 %4, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %9
br i1 %8, label %14, label %3
14: ; preds = %3
store i8* %5, i8** %1
ret i32 %4
}
void device_pm_move_after(struct device *deva, struct device *devb) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @device_pm_move_after(%struct.device* nocapture %0, %struct.device* nocapture %1) {
ret void
}
int mod(int x, int a) {
  int n = (x / a);
  int v = 0.0;
  v = v - n * a;
  if (v < 0)
    v += a;
  return v;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    113d <mod+0x3d>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edi,%edx
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub i32 %3, %0
%5 = icmp slt i32 %4, 0
%6 = select i1 %5, i32 %1, i32 0
%7 = add nsw i32 %6, %4
ret i32 %7
}
unsigned mydivu(unsigned x, unsigned y) { return x / y; }


x86 assembly (clang, -O0):
<mydivu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mydivu>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i32 @mydivu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = udiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mydivu(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct zint_symbol {
  int dummy;
};

/* Variables and functions */
int render_plot(struct zint_symbol *, float const, float const);
int ZBarcode_Render(struct zint_symbol *symbol, const float width,
                    const float height) {
  return render_plot(symbol, width, height);
}


x86 assembly (clang, -O0):
<ZBarcode_Render>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <render_plot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZBarcode_Render>:
jmp    1030 <render_plot@plt>

LLVM IR (-O0):
%struct.zint_symbol = type { i32 }
define i32 @ZBarcode_Render(%struct.zint_symbol* %0, float %1, float %2) {
%4 = alloca %struct.zint_symbol*
%5 = alloca float
%6 = alloca float
store %struct.zint_symbol* %0, %struct.zint_symbol** %4
store float %1, float* %5
store float %2, float* %6
%7 = load %struct.zint_symbol*, %struct.zint_symbol** %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call i32 @render_plot(%struct.zint_symbol* %7, float %8, float %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.zint_symbol = type { i32 }
define i32 @ZBarcode_Render(%struct.zint_symbol* %0, float %1, float %2) {
%4 = tail call i32 @render_plot(%struct.zint_symbol* %0, float %1, float %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x98() {
  Assert_real((isodigit(152) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              765, ("isodigit should be 0 for 0x98"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x98>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2fd,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x98>:
push   %rax
mov    $0x98,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2fd,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x98\00"
define void @t_isodigit_0x98() {
%1 = call i64 @isodigit(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x98\00"
define void @t_isodigit_0x98() {
%1 = tail call i64 @isodigit(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *strcpy(dst, src)
char *dst;
const char *src;
{ return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @strcpy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
double TPU_ch3_unit_in_sec();
int TPU_count_ch(int);
double tcnt_get_in_ms(void) {
  int n;
  double t;
  n = TPU_count_ch(3);
  t = TPU_ch3_unit_in_sec() * 1000.0 * (double)n;
  return t;
}


x86 assembly (clang, -O0):
<tcnt_get_in_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <TPU_count_ch@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <TPU_ch3_unit_in_sec@plt>
movsd  0xebc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcnt_get_in_ms>:
push   %rbx
mov    $0x3,%edi
call   1030 <TPU_count_ch@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <TPU_ch3_unit_in_sec@plt>
mulsd  0xec4(%rip),%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @tcnt_get_in_ms() {
%1 = alloca i32
%2 = alloca double
%3 = call i32 @TPU_count_ch(i32 3)
store i32 %3, i32* %1
%4 = call double (...) @TPU_ch3_unit_in_sec()
%5 = fmul double %4, 1.000000e+03
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = fmul double %5, %7
store double %8, double* %2
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @tcnt_get_in_ms() {
%1 = tail call i32 @TPU_count_ch(i32 3)
%2 = tail call double (...) @TPU_ch3_unit_in_sec()
%3 = fmul double %2, 1.000000e+03
%4 = sitofp i32 %1 to double
%5 = fmul double %3, %4
ret double %5
}
int smack_label_ip_out_fd(int fd, const char *label) { return 0; }


x86 assembly (clang, -O0):
<smack_label_ip_out_fd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @smack_label_ip_out_fd(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SDCard_EnableRxInt();
int /*<<< orphan*/ SDCard_EnableTxInt();
void SDCard_EnableInt(void) {
  SDCard_EnableRxInt();
  SDCard_EnableTxInt();
}


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

x86 assembly (clang, -O2):
<SDCard_EnableInt>:
push   %rax
xor    %eax,%eax
call   1040 <SDCard_EnableRxInt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SDCard_EnableTxInt@plt>

LLVM IR (-O0):
define void @SDCard_EnableInt() {
%1 = call i32 (...) @SDCard_EnableRxInt()
%2 = call i32 (...) @SDCard_EnableTxInt()
ret void
}

LLVM IR (-O2):
define void @SDCard_EnableInt() {
%1 = tail call i32 (...) @SDCard_EnableRxInt()
%2 = tail call i32 (...) @SDCard_EnableTxInt()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void test_vorr_u8x8(uint8_t *__restrict__ dest, uint8_t *a, uint8_t *b) {
  int i;
  for (i = 0; i < 8; i++) {
    dest[i] = a[i] | b[i];
  }
}


x86 assembly (clang, -O0):
<test_vorr_u8x8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1150 <test_vorr_u8x8+0x50>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_vorr_u8x8+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorr_u8x8>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,(%rdi)
movups 0x10(%rsi),%xmm0
movups 0x10(%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorr_u8x8(i32* noalias nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = bitcast i32* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = bitcast i32* %2 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = or <4 x i32> %7, %5
%9 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %8, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %1, i64 4
%11 = getelementptr inbounds i32, i32* %2, i64 4
%12 = getelementptr inbounds i32, i32* %0, i64 4
%13 = bitcast i32* %10 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = bitcast i32* %11 to <4 x i32>*
%16 = load <4 x i32>, <4 x i32>* %15
%17 = or <4 x i32> %16, %14
%18 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %17, <4 x i32>* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stop_here();
int main() {
  stop_here();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stop_here@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @stop_here()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @stop_here()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void sing(int bottles) {
  printf("%d green %s, standing on the wall.\n", bottles,
         bottles == 1 ? "bottle" : "bottles");
}


x86 assembly (clang, -O0):
<sing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xf03(%rip),%rdx
lea    0xef5(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sing>:
mov    %edi,%esi
cmp    $0x1,%edi
lea    0xf08(%rip),%rax
lea    0xf08(%rip),%rdx
cmove  %rax,%rdx
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"%d green %s, standing on the wall.\0A\00"
@.str.1 = [7 x i8] c"bottle\00"
@.str.2 = [8 x i8] c"bottles\00"
define void @sing(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"%d green %s, standing on the wall.\0A\00"
@.str.1 = [7 x i8] c"bottle\00"
@.str.2 = [8 x i8] c"bottles\00"
define void @sing(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
ret void
}
void ff_hevc_put_hevc_qpel_h8_10_sse4() {}


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

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

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

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

/* Variables and functions */
int mk_wcwidth(int /*<<< orphan*/);
__attribute__((visibility("default"))) unsigned int
tsm_ucs4_get_width(uint32_t ucs4) {
  int ret;
  ret = mk_wcwidth(ucs4);
  if (ret <= 0)
    return 0;
  return ret;
}


x86 assembly (clang, -O0):
<tsm_ucs4_get_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <mk_wcwidth@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     113c <tsm_ucs4_get_width+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1142 <tsm_ucs4_get_width+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsm_ucs4_get_width>:
push   %rax
call   1030 <mk_wcwidth@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tsm_ucs4_get_width(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @mk_wcwidth(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @tsm_ucs4_get_width(i32 %0) {
%2 = tail call i32 @mk_wcwidth(i32 %0)
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ digitToHex(unsigned char);
int /*<<< orphan*/ kpchar(int /*<<< orphan*/);
void kprintHexByte(unsigned char byte) {
  kpchar(digitToHex((byte & 0xF0) >> 4));
  kpchar(digitToHex(byte & 0xF));
}


x86 assembly (clang, -O0):
<kprintHexByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1030 <digitToHex@plt>
mov    %eax,%edi
call   1040 <kpchar@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <digitToHex@plt>
mov    %eax,%edi
call   1040 <kpchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprintHexByte>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <digitToHex@plt>
mov    %eax,%edi
call   1040 <kpchar@plt>
and    $0xf,%ebx
mov    %ebx,%edi
call   1030 <digitToHex@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <kpchar@plt>

LLVM IR (-O0):
define void @kprintHexByte(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, 240
%6 = ashr i32 %5, 4
%7 = trunc i32 %6 to i8
%8 = call i32 @digitToHex(i8 zeroext %7)
%9 = call i32 @kpchar(i32 %8)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 15
%13 = trunc i32 %12 to i8
%14 = call i32 @digitToHex(i8 zeroext %13)
%15 = call i32 @kpchar(i32 %14)
ret void
}

LLVM IR (-O2):
define void @kprintHexByte(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @digitToHex(i8 zeroext %2)
%4 = tail call i32 @kpchar(i32 %3)
%5 = and i8 %0, 15
%6 = tail call i32 @digitToHex(i8 zeroext %5)
%7 = tail call i32 @kpchar(i32 %6)
ret void
}
/* Variables and functions */
int calibrate_cpu_cycles_1(int);
int calibrate_cpu_cycles_2(int);
int calibrate_cpu_cycles(int clock) {
  int calib1, calib2;
  calib1 = calibrate_cpu_cycles_1(clock);
  calib2 = calibrate_cpu_cycles_2(clock);
  if (calib1 < calib2)
    return calib1;
  else
    return calib2;
}


x86 assembly (clang, -O0):
<calibrate_cpu_cycles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <calibrate_cpu_cycles_1@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <calibrate_cpu_cycles_2@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1158 <calibrate_cpu_cycles+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <calibrate_cpu_cycles+0x3e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calibrate_cpu_cycles>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <calibrate_cpu_cycles_1@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <calibrate_cpu_cycles_2@plt>
cmp    %eax,%ebp
cmovl  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @calibrate_cpu_cycles(i32 %0) {
%2 = tail call i32 @calibrate_cpu_cycles_1(i32 %0)
%3 = tail call i32 @calibrate_cpu_cycles_2(i32 %0)
%4 = icmp slt i32 %2, %3
%5 = select i1 %4, i32 %2, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bomb(char *);
extern int dup(int _fildes) { bomb("dup"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"dup\00"
define i32 @dup(i32 %0) {
%2 = tail call i32 @bomb(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct rte_page {
  int dummy;
};
struct rte_mem_cache {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_slab(struct rte_mem_cache *, struct rte_page *);
void discard_slab(struct rte_mem_cache *s, struct rte_page *page) {
  free_slab(s, page);
}


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

x86 assembly (clang, -O2):
<discard_slab>:
jmp    1030 <free_slab@plt>

LLVM IR (-O0):
%struct.rte_mem_cache = type { i32 }
%struct.rte_page = type { i32 }
define void @discard_slab(%struct.rte_mem_cache* %0, %struct.rte_page* %1) {
%3 = alloca %struct.rte_mem_cache*
%4 = alloca %struct.rte_page*
store %struct.rte_mem_cache* %0, %struct.rte_mem_cache** %3
store %struct.rte_page* %1, %struct.rte_page** %4
%5 = load %struct.rte_mem_cache*, %struct.rte_mem_cache** %3
%6 = load %struct.rte_page*, %struct.rte_page** %4
%7 = call i32 @free_slab(%struct.rte_mem_cache* %5, %struct.rte_page* %6)
ret void
}

LLVM IR (-O2):
%struct.rte_mem_cache = type { i32 }
%struct.rte_page = type { i32 }
define void @discard_slab(%struct.rte_mem_cache* %0, %struct.rte_page* %1) {
%3 = tail call i32 @free_slab(%struct.rte_mem_cache* %0, %struct.rte_page* %1)
ret void
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
int is_zero_ether_addr(const void *addr) {
  const __u8 *_addr = addr;
  return !(_addr[0] | _addr[1] | _addr[2] | _addr[3] | _addr[4] | _addr[5]);
}


x86 assembly (clang, -O0):
<is_zero_ether_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
mov    -0x10(%rbp),%rcx
or     0x8(%rcx),%eax
mov    -0x10(%rbp),%rcx
or     0xc(%rcx),%eax
mov    -0x10(%rbp),%rcx
or     0x10(%rcx),%eax
mov    -0x10(%rbp),%rcx
or     0x14(%rcx),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero_ether_addr>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
por    %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%ecx
or     0x10(%rdi),%ecx
xor    %eax,%eax
or     0x14(%rdi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_zero_ether_addr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = or i32 %8, %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = or i32 %12, %15
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 4
%23 = load i32, i32* %22
%24 = or i32 %20, %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 5
%27 = load i32, i32* %26
%28 = or i32 %24, %27
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
%31 = zext i1 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @is_zero_ether_addr(i8* nocapture %0) {
%2 = bitcast i8* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = getelementptr inbounds i8, i8* %0, i64 16
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = getelementptr inbounds i8, i8* %0, i64 20
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %3)
%11 = or i32 %10, %6
%12 = or i32 %11, %9
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
void R(int *s, int max) { *s = max; }


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

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

LLVM IR (-O0):
define void @R(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 = load i32*, i32** %3
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @R(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
volatile int func() { return 4; }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 4
}

LLVM IR (-O2):
define i32 @func() {
ret i32 4
}
void ranvec(int n, double pbuf[]) {
  int i;
  double ran1();
  for (i = 0; i < n; i++)
    pbuf[i] = ran1();
  return;
}


x86 assembly (clang, -O0):
<ranvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <ranvec+0x44>
mov    $0x0,%al
call   1030 <ran1@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <ranvec+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranvec>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <ranvec+0x36>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ran1@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ranvec+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ranvec(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call double (...) @ran1()
%12 = load double*, double** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double %11, double* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ranvec(i32 %0, double* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call double (...) @ran1()
%9 = getelementptr inbounds double, double* %1, i64 %7
store double %8, double* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int print_function(int prime_num, int i) {
  printf("Prime %d: %d\n", prime_num, i);
}


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

x86 assembly (clang, -O2):
<print_function>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"Prime %d: %d\0A\00"
define i32 @print_function(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}