xunge/DecIR huggingface dataset:
/* Variables and functions */
int gethostid();
int /*<<< orphan*/ sprintf(char *, char *, int);
int strlen(char *);
int ec_gethostid(char *buf, int len) {
  (void)sprintf(buf, "H#%d", gethostid());
  return strlen(buf);
}


x86 assembly (clang, -O0):
<ec_gethostid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <gethostid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xea5(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_gethostid>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gethostid@plt>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strlen@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"H#%d\00"
define i32 @ec_gethostid(i8* %0, i32 %1) {
%3 = tail call i32 (...) @gethostid()
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strlen(i8* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
int __raise(int s) { return (kill(getpid(), s)); }


x86 assembly (clang, -O0):
<__raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
define i32 @__raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @__raise(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @kill(i32 %2, i32 %0)
ret i32 %3
}
/* Type definitions */
union bpf_attr {
  int target_fd;
  int attach_bpf_fd;
  int attach_type;
  unsigned int attach_flags;
};
typedef enum bpf_attach_type {
  ____Placeholder_bpf_attach_type
} bpf_attach_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_ATTACH;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_attach(int prog_fd, int target_fd, enum bpf_attach_type type,
                    unsigned int flags) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.target_fd = target_fd;
  attr.attach_bpf_fd = prog_fd;
  attr.attach_type = type;
  attr.attach_flags = flags;
  return sys_bpf(BPF_PROG_ATTACH, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1040 <bzero@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_attach>:
push   %rax
mov    %ecx,(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_PROG_ATTACH = global i32 0
define i32 @bpf_prog_attach(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %union.bpf_attr
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = call i32 @bzero(%union.bpf_attr* %9, i32 4)
%11 = load i32, i32* %6
%12 = bitcast %union.bpf_attr* %9 to i32*
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = bitcast %union.bpf_attr* %9 to i32*
store i32 %13, i32* %14
%15 = load i32, i32* %7
%16 = bitcast %union.bpf_attr* %9 to i32*
store i32 %15, i32* %16
%17 = load i32, i32* %8
%18 = bitcast %union.bpf_attr* %9 to i32*
store i32 %17, i32* %18
%19 = load i32, i32* @BPF_PROG_ATTACH
%20 = call i32 @sys_bpf(i32 %19, %union.bpf_attr* %9, i32 4)
ret i32 %20
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_PROG_ATTACH = global i32 0
define i32 @bpf_prog_attach(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %union.bpf_attr
%6 = bitcast %union.bpf_attr* %5 to i8*
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %5, i64 0, i32 0
store i32 %3, i32* %7
%8 = load i32, i32* @BPF_PROG_ATTACH
%9 = call i32 @sys_bpf(i32 %8, %union.bpf_attr* %5, i32 4)
ret i32 %9
}
unsigned blend_hardlight(register unsigned color1, register unsigned color2) {
  return (
      (color1) < 128
          ? ((((color1) << 1) * ((color2))) >> 8)
          : ((((((color1)-128) << 1) ^ 255) * (((color2)) ^ 255) / 255) ^ 255));
}


x86 assembly (clang, -O0):
<blend_hardlight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x80,-0x4(%rbp)
jae    112c <blend_hardlight+0x2c>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <blend_hardlight+0x59>
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
shl    $0x1,%eax
xor    $0xff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xff,%ecx
imul   %ecx,%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
xor    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_hardlight>:
lea    (%rdi,%rdi,1),%eax
cmp    $0x7f,%edi
ja     110f <blend_hardlight+0xf>
imul   %esi,%eax
shr    $0x8,%eax
ret
add    $0xffffff00,%eax
xor    $0xff,%eax
xor    $0xff,%esi
imul   %eax,%esi
mov    $0x80808081,%eax
imul   %rsi,%rax
shr    $0x27,%rax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @blend_hardlight(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 = icmp ult i32 %5, 128
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = shl i32 %8, 1
%10 = load i32, i32* %4
%11 = mul i32 %9, %10
%12 = lshr i32 %11, 8
br label %23
13: ; preds = %2
%14 = load i32, i32* %3
%15 = sub i32 %14, 128
%16 = shl i32 %15, 1
%17 = xor i32 %16, 255
%18 = load i32, i32* %4
%19 = xor i32 %18, 255
%20 = mul i32 %17, %19
%21 = udiv i32 %20, 255
%22 = xor i32 %21, 255
br label %23
23: ; preds = %13, %7
%24 = phi i32 [ %12, %7 ], [ %22, %13 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @blend_hardlight(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 128
%4 = shl i32 %0, 1
br i1 %3, label %5, label %8
5: ; preds = %2
%6 = mul i32 %4, %1
%7 = lshr i32 %6, 8
br label %15
8: ; preds = %2
%9 = add i32 %4, -256
%10 = xor i32 %9, 255
%11 = xor i32 %1, 255
%12 = mul i32 %10, %11
%13 = udiv i32 %12, 255
%14 = xor i32 %13, 255
br label %15
15: ; preds = %8, %5
%16 = phi i32 [ %7, %5 ], [ %14, %8 ]
ret i32 %16
}
/* Variables and functions */
float INFINITY;
bool is_positive_zerof(float x) { return (x == 0.0f && 1.0f / x == INFINITY); }


x86 assembly (clang, -O0):
<is_positive_zerof>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jne    1147 <is_positive_zerof+0x47>
jp     1147 <is_positive_zerof+0x47>
movss  0xed3(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
mov    0x2eaf(%rip),%rax
ucomiss (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_positive_zerof>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112a <is_positive_zerof+0x2a>
jp     112a <is_positive_zerof+0x2a>
movss  0xeee(%rip),%xmm1
divss  %xmm0,%xmm1
mov    0x2ecb(%rip),%rax
cmpeqss (%rax),%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@INFINITY = global float 0.000000e+00
define i32 @is_positive_zerof(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load float, float* %2
%7 = fdiv float 1.000000e+00, %6
%8 = load float, float* @INFINITY
%9 = fcmp oeq float %7, %8
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@INFINITY = global float 0.000000e+00
define i32 @is_positive_zerof(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fdiv float 1.000000e+00, %0
%5 = load float, float* @INFINITY
%6 = fcmp oeq float %4, %5
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Type definitions */
struct flock {
  int l_type;
  scalar_t__ l_len;
  int /*<<< orphan*/ l_whence;
  scalar_t__ l_start;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ SEEK_SET;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int fcntl_lock(int fd, int type) {
  struct flock flp;
  flp.l_type = type;
  flp.l_start = 0;
  flp.l_whence = SEEK_SET;
  flp.l_len = 0;
  return fcntl(fd, F_SETLKW, &flp);
}


x86 assembly (clang, -O0):
<fcntl_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl_lock>:
sub    $0x28,%rsp
mov    %esi,0x8(%rsp)
movq   $0x0,0x20(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <fcntl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i64, i32, i64 }
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define i32 @fcntl_lock(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.flock
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.flock, %struct.flock* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.flock, %struct.flock* %5, i32 0, i32 3
store i64 0, i64* %8
%9 = load i32, i32* @SEEK_SET
%10 = getelementptr inbounds %struct.flock, %struct.flock* %5, i32 0, i32 2
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %5, i32 0, i32 1
store i64 0, i64* %11
%12 = load i32, i32* %3
%13 = load i32, i32* @F_SETLKW
%14 = call i32 @fcntl(i32 %12, i32 %13, %struct.flock* %5)
ret i32 %14
}

LLVM IR (-O2):
%struct.flock = type { i32, i64, i32, i64 }
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define i32 @fcntl_lock(i32 %0, i32 %1) {
%3 = alloca %struct.flock
%4 = bitcast %struct.flock* %3 to i8*
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 3
store i64 0, i64* %6
%7 = load i32, i32* @SEEK_SET
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 2
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i64 0, i32 1
store i64 0, i64* %9
%10 = load i32, i32* @F_SETLKW
%11 = call i32 @fcntl(i32 %0, i32 %10, %struct.flock* %3)
ret i32 %11
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int getlogin_r(char *name, size_t len) {
  char *foo = getenv("LOGNAME");
  if (!foo)
    return -1;
  strncpy(name, foo, len);
  name[len - 1] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<getlogin_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1157 <getlogin_r+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <getlogin_r+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlogin_r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1153 <getlogin_r+0x33>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
xor    %eax,%eax
jmp    1158 <getlogin_r+0x38>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"LOGNAME\00"
define i32 @getlogin_r(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 -1, i32* %3
br label %20
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %6
%14 = load i64, i64* %5
%15 = call i32 @strncpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = sub i64 %17, 1
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
store i32 0, i32* %3
br label %20
20: ; preds = %11, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [8 x i8] c"LOGNAME\00"
define i32 @getlogin_r(i8* %0, i64 %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strncpy(i8* %0, i8* %3, i64 %1)
%7 = add i64 %1, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *string = "The quick brown fox";
  memcpy(&string[4], "slow ", 5);
  printf("%s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
lea    0xecb(%rip),%rsi
mov    $0x5,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x5,%edx
call   1040 <memcpy@plt>
lea    0xec0(%rip),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"The quick brown fox\00"
@.str.1 = [6 x i8] c"slow \00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = call i32 @memcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"The quick brown fox\00"
@.str.1 = [6 x i8] c"slow \00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @memcpy(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 4), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int get_byte(int /*<<< orphan*/ *);
unsigned int get_le32(FILE *s) {
  unsigned int val;
  val = get_byte(s);
  val |= get_byte(s) << 8;
  val |= get_byte(s) << 16;
  val |= get_byte(s) << 24;
  return val;
}


x86 assembly (clang, -O0):
<get_le32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_byte@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_byte@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_byte@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_byte@plt>
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <get_byte@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <get_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <get_byte@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r15,%rdi
call   1030 <get_byte@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_le32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @get_byte(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @get_byte(i32* %6)
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = call i32 @get_byte(i32* %11)
%13 = shl i32 %12, 16
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32*, i32** %2
%17 = call i32 @get_byte(i32* %16)
%18 = shl i32 %17, 24
%19 = load i32, i32* %3
%20 = or i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_le32(i32* %0) {
%2 = tail call i32 @get_byte(i32* %0)
%3 = tail call i32 @get_byte(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = tail call i32 @get_byte(i32* %0)
%7 = shl i32 %6, 16
%8 = or i32 %5, %7
%9 = tail call i32 @get_byte(i32* %0)
%10 = shl i32 %9, 24
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
bool power_of_two_or_zero(unsigned int i) {
  if ((i & (i - 1)) == 0)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<power_of_two_or_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1127 <power_of_two_or_zero+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <power_of_two_or_zero+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_of_two_or_zero>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @power_of_two_or_zero(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
void ini_Ratfor(void) {}


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

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

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

LLVM IR (-O2):
define void @ini_Ratfor() {
ret void
}
void pstate2(const char *pmess, const unsigned char *st, int len) {}


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

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

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

LLVM IR (-O2):
define void @pstate2(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_ints(int, int, int, int);
int main() { print_ints(3, 1, 2, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
call   1030 <print_ints@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <print_ints@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @print_ints(i32 3, i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_ints(i32 3, i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ testRingSorting(int);
void testRingSorted() {
  testRingSorting(1);
  testRingSorting(2);
  testRingSorting(3);
  testRingSorting(5);
  testRingSorting(64);
  testRingSorting(256);
  testRingSorting(1024);
  testRingSorting(10000);
  testRingSorting(100000);
  testRingSorting(1000000);
}


x86 assembly (clang, -O0):
<testRingSorted>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <testRingSorting@plt>
mov    $0x2,%edi
call   1030 <testRingSorting@plt>
mov    $0x3,%edi
call   1030 <testRingSorting@plt>
mov    $0x5,%edi
call   1030 <testRingSorting@plt>
mov    $0x40,%edi
call   1030 <testRingSorting@plt>
mov    $0x100,%edi
call   1030 <testRingSorting@plt>
mov    $0x400,%edi
call   1030 <testRingSorting@plt>
mov    $0x2710,%edi
call   1030 <testRingSorting@plt>
mov    $0x186a0,%edi
call   1030 <testRingSorting@plt>
mov    $0xf4240,%edi
call   1030 <testRingSorting@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testRingSorted>:
push   %rax
mov    $0x1,%edi
call   1030 <testRingSorting@plt>
mov    $0x2,%edi
call   1030 <testRingSorting@plt>
mov    $0x3,%edi
call   1030 <testRingSorting@plt>
mov    $0x5,%edi
call   1030 <testRingSorting@plt>
mov    $0x40,%edi
call   1030 <testRingSorting@plt>
mov    $0x100,%edi
call   1030 <testRingSorting@plt>
mov    $0x400,%edi
call   1030 <testRingSorting@plt>
mov    $0x2710,%edi
call   1030 <testRingSorting@plt>
mov    $0x186a0,%edi
call   1030 <testRingSorting@plt>
mov    $0xf4240,%edi
pop    %rax
jmp    1030 <testRingSorting@plt>

LLVM IR (-O0):
define void @testRingSorted() {
%1 = call i32 @testRingSorting(i32 1)
%2 = call i32 @testRingSorting(i32 2)
%3 = call i32 @testRingSorting(i32 3)
%4 = call i32 @testRingSorting(i32 5)
%5 = call i32 @testRingSorting(i32 64)
%6 = call i32 @testRingSorting(i32 256)
%7 = call i32 @testRingSorting(i32 1024)
%8 = call i32 @testRingSorting(i32 10000)
%9 = call i32 @testRingSorting(i32 100000)
%10 = call i32 @testRingSorting(i32 1000000)
ret void
}

LLVM IR (-O2):
define void @testRingSorted() {
%1 = tail call i32 @testRingSorting(i32 1)
%2 = tail call i32 @testRingSorting(i32 2)
%3 = tail call i32 @testRingSorting(i32 3)
%4 = tail call i32 @testRingSorting(i32 5)
%5 = tail call i32 @testRingSorting(i32 64)
%6 = tail call i32 @testRingSorting(i32 256)
%7 = tail call i32 @testRingSorting(i32 1024)
%8 = tail call i32 @testRingSorting(i32 10000)
%9 = tail call i32 @testRingSorting(i32 100000)
%10 = tail call i32 @testRingSorting(i32 1000000)
ret void
}
char *procprt_PSIZE_e(struct tstat *curstat, int avgval, int nsecs) {
  return "    0K";
}


x86 assembly (clang, -O0):
<procprt_PSIZE_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_PSIZE_e>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_PSIZE_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_PSIZE_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
char *strdup(char const *);
char *x_strdup(const char *s) {
  char *ret;
  ret = strdup(s);
  if (!ret) {
    fatal("out of memory in strdup\n");
  }
  return ret;
}


x86 assembly (clang, -O0):
<x_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <x_strdup+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_strdup>:
push   %rbx
call   1030 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <x_strdup+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"out of memory in strdup\0A\00"
define i8* @x_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [25 x i8] c"out of memory in strdup\0A\00"
define noalias i8* @x_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int isDalvikInvoke(int opcode) {
  return ((opcode == 0xf0) || ((opcode >= 0xf8) && (opcode <= 0xfb)) ||
          ((opcode >= 0x70) && (opcode <= 0x78) && (opcode != 0x73)));
}


x86 assembly (clang, -O0):
<isDalvikInvoke>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xf0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1166 <isDalvikInvoke+0x66>
cmpl   $0xf8,-0x4(%rbp)
jl     1138 <isDalvikInvoke+0x38>
mov    $0x1,%al
cmpl   $0xfb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1166 <isDalvikInvoke+0x66>
xor    %eax,%eax
cmpl   $0x70,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1160 <isDalvikInvoke+0x60>
xor    %eax,%eax
cmpl   $0x78,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jg     1160 <isDalvikInvoke+0x60>
cmpl   $0x73,-0x4(%rbp)
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDalvikInvoke>:
mov    $0x1,%eax
cmp    $0xf0,%edi
je     112c <isDalvikInvoke+0x2c>
mov    %edi,%ecx
and    $0xfffffffc,%ecx
cmp    $0xf8,%ecx
je     112c <isDalvikInvoke+0x2c>
lea    -0x70(%rdi),%ecx
xor    %eax,%eax
cmp    $0x8,%ecx
ja     112c <isDalvikInvoke+0x2c>
xor    %eax,%eax
cmp    $0x73,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @isDalvikInvoke(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 240
br i1 %4, label %22, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 248
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 251
br i1 %10, label %22, label %11
11: ; preds = %8, %5
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 112
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 120
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 115
br label %20
20: ; preds = %17, %14, %11
%21 = phi i1 [ false, %14 ], [ false, %11 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %8, %1
%23 = phi i1 [ true, %8 ], [ true, %1 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isDalvikInvoke(i32 %0) {
%2 = icmp eq i32 %0, 240
%3 = and i32 %0, -4
%4 = icmp eq i32 %3, 248
%5 = or i1 %2, %4
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = add i32 %0, -112
%8 = icmp ult i32 %7, 9
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = icmp ne i32 %0, 115
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %9, %1
%13 = phi i32 [ 1, %1 ], [ 0, %6 ], [ %11, %9 ]
ret i32 %13
}
int Operand_simm8_encode(unsigned int *valp) {
  unsigned imm8_0, simm8_0;
  simm8_0 = *valp;
  imm8_0 = (simm8_0 & 0xff);
  *valp = imm8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_simm8_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_simm8_encode>:
movzbl (%rdi),%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_simm8_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_simm8_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 255
store i32 %3, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void two_fer(char *buffer, const char *name) {
  sprintf(buffer, "One for %s, one for me.", (name) ? name : "you");
}


x86 assembly (clang, -O0):
<two_fer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <two_fer+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <two_fer+0x40>
lea    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <two_fer+0x40>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_fer>:
test   %rsi,%rsi
lea    0xefe(%rip),%rdx
cmovne %rsi,%rdx
lea    0xedb(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"One for %s, one for me.\00"
@.str.1 = [4 x i8] c"you\00"
define void @two_fer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %4
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %8
%12 = phi i8* [ %9, %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %10 ]
%13 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"One for %s, one for me.\00"
@.str.1 = [4 x i8] c"you\00"
define void @two_fer(i8* nocapture writeonly %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int c_isleap_never(int year, int *leap) {
  *leap = 0;
  return (0);
}


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

x86 assembly (clang, -O2):
<c_isleap_never>:
movl   $0x0,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @c_isleap_never(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
store i32 0, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @c_isleap_never(i32 %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int vfork();
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int pid;
  pid = vfork();
  if (pid < 0)
    return -1;
  if (pid == 0) {
    execl("t-abc", "t-abc", NULL);
    return -1;
  }
  wait(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
call   1030 <vfork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1164 <main+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <main+0x6d>
cmpl   $0x0,-0x14(%rbp)
jne    118d <main+0x5d>
lea    0xe8b(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1040 <execl@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <main+0x6d>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1030 <vfork@plt>
mov    $0xffffffff,%ebx
test   %eax,%eax
js     115f <main+0x2f>
je     114c <main+0x1c>
xor    %ebx,%ebx
mov    %ebx,%edi
call   1050 <wait@plt>
jmp    115f <main+0x2f>
lea    0xead(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdi,%rsi
call   1040 <execl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"t-abc\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @vfork()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %18
11: ; preds = %2
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @execl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
store i32 -1, i32* %3
br label %18
16: ; preds = %11
%17 = call i32 @wait(i32* null)
store i32 0, i32* %3
br label %18
18: ; preds = %16, %14, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [6 x i8] c"t-abc\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = call i32 @vfork()
%4 = icmp slt i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = icmp eq i32 %3, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = call i32 @execl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
br label %11
9: ; preds = %5
%10 = call i32 @wait(i32* null)
br label %11
11: ; preds = %2, %9, %7
%12 = phi i32 [ -1, %7 ], [ 0, %9 ], [ -1, %2 ]
ret i32 %12
}
/* Type definitions */
struct Hoge {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_pointer(struct Hoge *);
void print_struct2(struct Hoge *hoge) { print_pointer(hoge); }


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

x86 assembly (clang, -O2):
<print_struct2>:
jmp    1030 <print_pointer@plt>

LLVM IR (-O0):
%struct.Hoge = type { i32 }
define void @print_struct2(%struct.Hoge* %0) {
%2 = alloca %struct.Hoge*
store %struct.Hoge* %0, %struct.Hoge** %2
%3 = load %struct.Hoge*, %struct.Hoge** %2
%4 = call i32 @print_pointer(%struct.Hoge* %3)
ret void
}

LLVM IR (-O2):
%struct.Hoge = type { i32 }
define void @print_struct2(%struct.Hoge* %0) {
%2 = tail call i32 @print_pointer(%struct.Hoge* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int _m_pextrw(int /*<<< orphan*/, int);
int __m_pextrw(__m64 A, int const I) { return _m_pextrw(A, 1); }


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

x86 assembly (clang, -O2):
<__m_pextrw>:
mov    $0x1,%esi
jmp    1030 <_m_pextrw@plt>

LLVM IR (-O0):
define i32 @__m_pextrw(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 = call i32 @_m_pextrw(i32 %5, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__m_pextrw(i32 %0, i32 %1) {
%3 = tail call i32 @_m_pextrw(i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SystemCall(int);
void HuffUnComp(void *source, void *dest) { SystemCall(19); }


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

x86 assembly (clang, -O2):
<HuffUnComp>:
mov    $0x13,%edi
jmp    1030 <SystemCall@plt>

LLVM IR (-O0):
define void @HuffUnComp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @SystemCall(i32 19)
ret void
}

LLVM IR (-O2):
define void @HuffUnComp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @SystemCall(i32 19)
ret void
}
/* Type definitions */
typedef int comp_t;

/* Variables and functions */
long comp_t2long(comp_t c) { return (c & 0x1fff) << (((c >> 13) & 0x7) * 3); }


x86 assembly (clang, -O0):
<comp_t2long>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1fff,%eax
mov    -0x4(%rbp),%ecx
sar    $0xd,%ecx
and    $0x7,%ecx
imul   $0x3,%ecx,%ecx
shl    %cl,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_t2long>:
mov    %edi,%eax
and    $0x1fff,%eax
shr    $0xd,%edi
and    $0x7,%dil
movzbl %dil,%ecx
lea    (%rcx,%rcx,2),%ecx
shl    %cl,%eax
cltq
ret

LLVM IR (-O0):
define i64 @comp_t2long(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8191
%5 = load i32, i32* %2
%6 = ashr i32 %5, 13
%7 = and i32 %6, 7
%8 = mul nsw i32 %7, 3
%9 = shl i32 %4, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @comp_t2long(i32 %0) {
%2 = and i32 %0, 8191
%3 = lshr i32 %0, 13
%4 = and i32 %3, 7
%5 = mul nuw nsw i32 %4, 3
%6 = shl i32 %2, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
/* Variables and functions */
bool UT64_DIV_OVFCHK(unsigned long long a, unsigned long long b) {
  (void)(a);
  return !b;
}


x86 assembly (clang, -O0):
<UT64_DIV_OVFCHK>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @UT64_DIV_OVFCHK(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
double time_to_exp(double value) {
  double x = 1.0 - 1.0 / (value / 1000.0 * 48000.0);
  return x;
}


x86 assembly (clang, -O0):
<time_to_exp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @time_to_exp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.000000e+03
%6 = fmul double %5, 4.800000e+04
%7 = fdiv double 1.000000e+00, %6
%8 = fsub double 1.000000e+00, %7
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @time_to_exp(double %0) {
%2 = fdiv double %0, 1.000000e+03
%3 = fmul double %2, 4.800000e+04
%4 = fdiv double 1.000000e+00, %3
%5 = fsub double 1.000000e+00, %4
ret double %5
}
int cmp_case_int(int check, int baseline, int when_lt, int when_eq,
                 int when_gt) {
  return (((check) <= (baseline))
              ? (((check) < (baseline)) ? (when_lt) : (when_eq))
              : (when_gt));
}


x86 assembly (clang, -O0):
<cmp_case_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1148 <cmp_case_int+0x48>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1137 <cmp_case_int+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    113d <cmp_case_int+0x3d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <cmp_case_int+0x4e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_case_int>:
mov    %edx,%eax
cmp    %esi,%edi
cmovge %ecx,%eax
cmovg  %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_case_int(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %0, %1
%7 = icmp slt i32 %0, %1
%8 = select i1 %7, i32 %2, i32 %3
%9 = select i1 %6, i32 %4, i32 %8
ret i32 %9
}
int test_imm_60int64_lowword_reg(long long val) {
  return ((val) & (0x60 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_60int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 96
%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_60int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 96
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ff_hevc_put_hevc_bi_w_epel_h6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h6_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf(char *, char const *);
int stress_loop_supported(const char *name) {
  pr_inf("%s: stressor will be skipped, loop is not available\n", name);
  return -1;
}


x86 assembly (clang, -O0):
<stress_loop_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <pr_inf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_loop_supported>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <pr_inf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"%s: stressor will be skipped, loop is not available\0A\00"
define i32 @stress_loop_supported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [53 x i8] c"%s: stressor will be skipped, loop is not available\0A\00"
define i32 @stress_loop_supported(i8* %0) {
%2 = tail call i32 @pr_inf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}