xunge/DecIR huggingface dataset:
/* Variables and functions */
int maj_elem(int *, int);
int test_maj_elem_odd() {
  int array[] = {1, 2, 5, 9, 5, 9, 5, 5, 5};
  return 5 == maj_elem(array, 9);
}


x86 assembly (clang, -O0):
<test_maj_elem_odd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1040 <maj_elem@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_maj_elem_odd>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <maj_elem@plt>
xor    %ecx,%ecx
cmp    $0x5,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_maj_elem_odd.array = [9 x i32] [i32 1, i32 2, i32 5, i32 9, i32 5, i32 9, i32 5, i32 5, i32 5]
define i32 @test_maj_elem_odd() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @maj_elem(i32* %3, i32 9)
%5 = icmp eq i32 5, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_maj_elem_odd.array = [9 x i32] [i32 1, i32 2, i32 5, i32 9, i32 5, i32 9, i32 5, i32 5, i32 5]
define i32 @test_maj_elem_odd() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @maj_elem(i32* %3, i32 9)
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int stateparent(int);
int tcparent(int tc) {
  int parentccode = stateparent(tc - 1);
  if (parentccode >= 0)
    return parentccode + 1;
  return -1;
}


x86 assembly (clang, -O0):
<tcparent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <stateparent@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1141 <tcparent+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <tcparent+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcparent>:
push   %rax
add    $0xffffffff,%edi
call   1030 <stateparent@plt>
lea    0x1(%rax),%ecx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tcparent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @stateparent(i32 %2)
%4 = icmp sgt i32 %3, -1
%5 = add nsw i32 %3, 1
%6 = select i1 %4, i32 %5, i32 -1
ret i32 %6
}
void g_hash_table_new() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int revoke(const char *file) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<revoke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revoke>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @revoke(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @revoke(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
int media_snd_device_create(struct snd_usb_audio *chip,
                            struct usb_interface *iface) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_usb_audio = type opaque
%struct.usb_interface = type opaque
define i32 @media_snd_device_create(%struct.snd_usb_audio* %0, %struct.usb_interface* %1) {
%3 = alloca %struct.snd_usb_audio*
%4 = alloca %struct.usb_interface*
store %struct.snd_usb_audio* %0, %struct.snd_usb_audio** %3
store %struct.usb_interface* %1, %struct.usb_interface** %4
ret i32 0
}

LLVM IR (-O2):
%struct.snd_usb_audio = type opaque
%struct.usb_interface = type opaque
define i32 @media_snd_device_create(%struct.snd_usb_audio* nocapture readnone %0, %struct.usb_interface* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_error_msg(char *, char *);
void print_redef(char *name) {
  print_error_msg("redefinition of function '%s'!", name);
}


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

x86 assembly (clang, -O2):
<print_redef>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <print_error_msg@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"redefinition of function '%s'!\00"
define void @print_redef(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print_error_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"redefinition of function '%s'!\00"
define void @print_redef(i8* %0) {
%2 = tail call i32 @print_error_msg(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t get_hi(const uint64_t x) { return (uint32_t)(x >> 32); }


x86 assembly (clang, -O0):
<get_hi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_hi(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ read_num_from_file(char *, int *);
int inotifytools_get_max_user_instances() {
  int ret;
  if (!read_num_from_file("/proc/sys/fs/inotify/"
                          "max_user_instances",
                          &ret))
    return -1;
  return ret;
}


x86 assembly (clang, -O0):
<inotifytools_get_max_user_instances>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <read_num_from_file@plt>
cmp    $0x0,%eax
jne    113d <inotifytools_get_max_user_instances+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <inotifytools_get_max_user_instances+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotifytools_get_max_user_instances>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <read_num_from_file@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"/proc/sys/fs/inotify/max_user_instances\00"
define i32 @inotifytools_get_max_user_instances() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @read_num_from_file(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 -1, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [40 x i8] c"/proc/sys/fs/inotify/max_user_instances\00"
define i32 @inotifytools_get_max_user_instances() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_num_from_file(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* %1
%6 = select i1 %4, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
char *android_alloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *substring_dup(const char *start, const char *end) {
  int len = end - start;
  char *result = android_alloc(len + 1);
  memcpy(result, start, len);
  result[len] = 0;
  return result;
}


x86 assembly (clang, -O0):
<substring_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1030 <android_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1030 <android_alloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @substring_dup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = call i8* @android_alloc(i32 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
%20 = load i8*, i8** %6
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @substring_dup(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, 1
%8 = tail call i8* @android_alloc(i32 %7)
%9 = tail call i32 @memcpy(i8* %8, i8* %0, i32 %6)
%10 = shl i64 %5, 32
%11 = ashr exact i64 %10, 32
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 0, i8* %12
ret i8* %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_write_standard_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(21, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_standard_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x15,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_standard_system>:
mov    $0x15,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_write_standard_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 21, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_write_standard_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 21, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int uint_fast8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
void softfloat_shortShiftLeft64To96M(uint64_t a, uint_fast8_t dist,
                                     uint32_t *zPtr) {
  zPtr[(0)] = (uint32_t)a << dist;
  a >>= 32 - dist;
  zPtr[(2)] = a >> 32;
  zPtr[(1)] = a;
}


x86 assembly (clang, -O0):
<softfloat_shortShiftLeft64To96M>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_shortShiftLeft64To96M>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    %eax,(%rdx)
neg    %cl
sar    %cl,%edi
mov    %edi,0x4(%rdx)
ret

LLVM IR (-O0):
define void @softfloat_shortShiftLeft64To96M(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = shl i32 %7, %8
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %5
%13 = sub nsw i32 32, %12
%14 = load i32, i32* %4
%15 = ashr i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = ashr i32 %16, 32
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 1
store i32 %20, i32* %22
ret void
}

LLVM IR (-O2):
define void @softfloat_shortShiftLeft64To96M(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = shl i32 %0, %1
store i32 %4, i32* %2
%5 = sub nsw i32 32, %1
%6 = ashr i32 %0, %5
%7 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %6, i32* %7
ret void
}
filler(s) char *s;
{ return (point(s) && s[0] == '\\' && s[1] == 'R'); }


x86 assembly (clang, -O0):
<filler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <point@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     115d <filler+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x9(%rbp)
jne    115d <filler+0x4d>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x52,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filler>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <point@plt>
test   %eax,%eax
je     1132 <filler+0x22>
cmpb   $0x5c,(%rbx)
jne    1132 <filler+0x22>
xor    %ebp,%ebp
cmpb   $0x52,0x1(%rbx)
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @filler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @point to i32 (i8*, ...)*)(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 92
br i1 %11, label %12, label %18
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 82
br label %18
18: ; preds = %12, %6, %1
%19 = phi i1 [ false, %6 ], [ false, %1 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @filler(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @point to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 92
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 82
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %4, %1
%13 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_double_get(double *dest, const double *src, size_t len,
                             int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_double_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_double_get(double* %0, double* %1, i64 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i64
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_double_get(double* nocapture readnone %0, double* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_5_recursive(double *, int);
void helper_double_5(double *buf) { helper_double_5_recursive(buf, 5); }


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

x86 assembly (clang, -O2):
<helper_double_5>:
mov    $0x5,%esi
jmp    1030 <helper_double_5_recursive@plt>

LLVM IR (-O0):
define void @helper_double_5(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @helper_double_5_recursive(double* %3, i32 5)
ret void
}

LLVM IR (-O2):
define void @helper_double_5(double* %0) {
%2 = tail call i32 @helper_double_5_recursive(double* %0, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, int *);
scalar_t__ waitForChar();
int getCharInBuff(void) {
  int nb;
  if (waitForChar() != 0) {
    ioctl(0, FIONREAD, &nb);
    return (nb);
  }
  return (0);
}


x86 assembly (clang, -O0):
<getCharInBuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <waitForChar@plt>
cmp    $0x0,%rax
je     1158 <getCharInBuff+0x38>
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <getCharInBuff+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCharInBuff>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <waitForChar@plt>
test   %rax,%rax
je     114c <getCharInBuff+0x2c>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @getCharInBuff() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @waitForChar()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @FIONREAD
%7 = call i32 @ioctl(i32 0, i32 %6, i32* %2)
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @getCharInBuff() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i64 (...) @waitForChar()
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i32, i32* @FIONREAD
%7 = call i32 @ioctl(i32 0, i32 %6, i32* %1)
%8 = load i32, i32* %1
br label %9
9: ; preds = %0, %5
%10 = phi i32 [ %8, %5 ], [ 0, %0 ]
ret i32 %10
}
OP(fd, ab) {
  illegal_1();
  op_ab();
}


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_ab()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ab()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void infinifree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<infinifree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @infinifree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @infinifree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ ff_bfin_put_pixels8uc_nornd(int /*<<< orphan*/ *,
                                               int /*<<< orphan*/ const *,
                                               int /*<<< orphan*/ const *,
                                               int /*<<< orphan*/, int);
void bfin_put_pixels8_x2_nornd(uint8_t *block, const uint8_t *pixels,
                               ptrdiff_t line_size, int h) {
  ff_bfin_put_pixels8uc_nornd(block, pixels, pixels + 1, line_size, h);
}


x86 assembly (clang, -O0):
<bfin_put_pixels8_x2_nornd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x4,%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <ff_bfin_put_pixels8uc_nornd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfin_put_pixels8_x2_nornd>:
mov    %ecx,%r8d
mov    %edx,%ecx
lea    0x4(%rsi),%rdx
jmp    1030 <ff_bfin_put_pixels8uc_nornd@plt>

LLVM IR (-O0):
define void @bfin_put_pixels8_x2_nornd(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @ff_bfin_put_pixels8uc_nornd(i32* %9, i32* %10, i32* %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @bfin_put_pixels8_x2_nornd(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = tail call i32 @ff_bfin_put_pixels8uc_nornd(i32* %0, i32* %1, i32* %5, i32 %2, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
u_int32_t swap_u_int32_t(u_int32_t t) { return t; }


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

x86 assembly (clang, -O2):
<swap_u_int32_t>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @swap_u_int32_t(i32 returned %0) {
ret i32 %0
}
int pcap_wrap() { return 1; }


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

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

LLVM IR (-O0):
define i32 @pcap_wrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @pcap_wrap() {
ret i32 1
}
int hash(char *key, int size) {
  int i = 0, index = 0;
  while (key[i] != '\0') {
    index += (int)key[i++];
  }
  return index % size;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114f <hash+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <hash+0x19>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <hash+0x22>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
jmp    1124 <hash+0x24>
xor    %eax,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8 [ %13, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = sext i8 %7 to i32
%10 = add nuw nsw i64 %6, 1
%11 = add nsw i32 %8, %9
%12 = getelementptr inbounds i8, i8* %0, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = srem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  const int length = 10;
  const int width = 5;
  const char newline = '\n';
  int area = length * width;
  printf("Value of area : %d%c", area, newline);
  printf("Value of area : %d\n", 50);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movb   $0xa,-0x9(%rbp)
movl   $0x32,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0xa,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x32,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"Value of area : %d%c\00"
@.str.1 = [20 x i8] c"Value of area : %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 50, i32 10)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 50)
ret i32 0
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ warn(char *);
int serv_accept(int listenfd) {
  int connfd;
  connfd = accept(listenfd, NULL, NULL);
  if (connfd < 0)
    warn("accept");
  return connfd;
}


x86 assembly (clang, -O0):
<serv_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1040 <accept@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1153 <serv_accept+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <warn@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_accept>:
push   %rbx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <accept@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    113c <serv_accept+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <warn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"accept\00"
define i32 @serv_accept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @accept(i32 %4, i32* null, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @warn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"accept\00"
define i32 @serv_accept(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @warn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
float __slong2fs(int);
float __sint2fs(signed int si) { return __slong2fs(si); }


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

x86 assembly (clang, -O2):
<__sint2fs>:
jmp    1030 <__slong2fs@plt>

LLVM IR (-O0):
define float @__sint2fs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call float @__slong2fs(i32 %3)
ret float %4
}

LLVM IR (-O2):
define float @__sint2fs(i32 %0) {
%2 = tail call float @__slong2fs(i32 %0)
ret float %2
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ err(char *, struct obj *);
void err_ctrl_c(void) { err("control-c interrupt", ((struct obj *)0)); }


x86 assembly (clang, -O0):
<err_ctrl_c>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_ctrl_c>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <err@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [20 x i8] c"control-c interrupt\00"
define void @err_ctrl_c() {
%1 = call i32 @err(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [20 x i8] c"control-c interrupt\00"
define void @err_ctrl_c() {
%1 = tail call i32 @err(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.obj* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ bj_get_aligment(void *);
int /*<<< orphan*/ bjk_ilog(int /*<<< orphan*/);
void prt_aligns(void *ptr) {
  int8_t alg = bj_get_aligment(ptr);
  bjk_ilog(alg);
}


x86 assembly (clang, -O0):
<prt_aligns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bj_get_aligment@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <bjk_ilog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prt_aligns>:
push   %rax
call   1040 <bj_get_aligment@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <bjk_ilog@plt>

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

LLVM IR (-O2):
define void @prt_aligns(i8* %0) {
%2 = tail call i32 @bj_get_aligment(i8* %0)
%3 = tail call i32 @bjk_ilog(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int /*<<< orphan*/, int,
                           char *);
const char *SMake_Version() {
  static char sVersion[128];
  sprintf(sVersion, "%d.%d build %d (%s)", 1, 0, 25, "Mar 19 2022");
  return sVersion;
}


x86 assembly (clang, -O0):
<SMake_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x19,%r8d
lea    0xede(%rip),%r9
call   1030 <sprintf@plt>
lea    0x2efe(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMake_Version>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
lea    0xeee(%rip),%r9
mov    %rbx,%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x19,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@SMake_Version.sVersion = internal global [128 x i8] zeroinitializer
@.str = [20 x i8] c"%d.%d build %d (%s)\00"
@.str.1 = [12 x i8] c"Mar 19 2022\00"
define i8* @SMake_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_Version.sVersion, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 25, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_Version.sVersion, i64 0, i64 0)
}

LLVM IR (-O2):
@SMake_Version.sVersion = internal global [128 x i8] zeroinitializer
@.str = [20 x i8] c"%d.%d build %d (%s)\00"
@.str.1 = [12 x i8] c"Mar 19 2022\00"
define i8* @SMake_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_Version.sVersion, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 25, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @SMake_Version.sVersion, i64 0, i64 0)
}
int test_imm_A2uint16_reg(unsigned short val) {
  return ((val) & (-0xA2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A2uint16_reg>:
test   $0xff5e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -162
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void exynos_drm_iommu_unmap_gem(struct drm_gem_object *obj) { return; }


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

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

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

LLVM IR (-O2):
%struct.drm_gem_object = type opaque
define void @exynos_drm_iommu_unmap_gem(%struct.drm_gem_object* nocapture %0) {
ret void
}
unsigned char gt_rmq_clearbits(unsigned char n, unsigned long x) {
  return n & (unsigned char)(255 << x);
}


x86 assembly (clang, -O0):
<gt_rmq_clearbits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    $0xff,%edx
shl    %cl,%edx
mov    %edx,%ecx
movzbl %cl,%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_rmq_clearbits>:
mov    %rsi,%rcx
mov    $0xff,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @gt_rmq_clearbits(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 255, %8
%10 = trunc i32 %9 to i8
%11 = zext i8 %10 to i32
%12 = and i32 %6, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @gt_rmq_clearbits(i8 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 255, %3
%5 = trunc i32 %4 to i8
%6 = and i8 %5, %0
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xbd() {
  Assert_real((ispunct(189) == 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_ispunct.c",
              950, ("ispunct should be 0 for 0xbd"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xbd>:
push   %rax
mov    $0xbd,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3b6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xbd\00"
define void @t_ispunct_0xbd() {
%1 = call i64 @ispunct(i32 189)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 950, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xbd\00"
define void @t_ispunct_0xbd() {
%1 = tail call i64 @ispunct(i32 189)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 950, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_camera(char const *, struct timeval *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ usleep(int);
void *camera_loop(void *ipPointer) {
  const char *ip = (const char *)ipPointer;
  struct timeval last_capture;
  gettimeofday(&last_capture, NULL);
  while (1) {
    check_camera(ip, &last_capture);
    usleep(50000);
  }
}


x86 assembly (clang, -O0):
<camera_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <check_camera@plt>
mov    $0xc350,%edi
call   1050 <usleep@plt>
jmp    1151 <camera_loop+0x21>

x86 assembly (clang, -O2):
<camera_loop>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <check_camera@plt>
mov    $0xc350,%edi
call   1050 <usleep@plt>
jmp    1150 <camera_loop+0x20>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i8* @camera_loop(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.timeval
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
br label %7
7: ; preds = %1, %7
%8 = load i8*, i8** %3
%9 = call i32 @check_camera(i8* %8, %struct.timeval* %4)
%10 = call i32 @usleep(i32 50000)
br label %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define noalias i8* @camera_loop(i8* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
br label %5
5: ; preds = %5, %1
%6 = call i32 @check_camera(i8* %0, %struct.timeval* %2)
%7 = call i32 @usleep(i32 50000)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ _test_trim(char *);
int /*<<< orphan*/ printf(char *);
void test_trim() {
  printf("Test trim:\n");
  _test_trim("  \t asdf asdf \n ");
  _test_trim("a");
  _test_trim("");
}


x86 assembly (clang, -O0):
<test_trim>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <_test_trim@plt>
lea    0xeda(%rip),%rdi
call   1030 <_test_trim@plt>
lea    0xebc(%rip),%rdi
call   1030 <_test_trim@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trim>:
push   %rax
lea    0xeeb(%rip),%rdi
call   1040 <puts@plt>
lea    0xecc(%rip),%rdi
call   1030 <_test_trim@plt>
lea    0xed1(%rip),%rdi
call   1030 <_test_trim@plt>
lea    0xec4(%rip),%rdi
pop    %rax
jmp    1030 <_test_trim@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Test trim:\0A\00"
@.str.1 = [17 x i8] c" \09 asdf asdf \0A \00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [1 x i8] zeroinitializer
define void @test_trim() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_test_trim(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @_test_trim(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @_test_trim(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c" \09 asdf asdf \0A \00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [1 x i8] zeroinitializer
@str = [11 x i8] c"Test trim:\00"
define void @test_trim() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @_test_trim(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @_test_trim(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @_test_trim(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, int);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void unlock(pthread_mutex_t *mutex) {
  int err = 0;
  if ((err = pthread_mutex_unlock(mutex)) != 0) {
    printf("Failed to aquire globbal lock %d\n", err);
    abort();
  }
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     116e <unlock+0x3e>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
push   %rax
call   1050 <pthread_mutex_unlock@plt>
test   %eax,%eax
jne    113c <unlock+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Failed to aquire globbal lock %d\0A\00"
define void @unlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Failed to aquire globbal lock %d\0A\00"
define void @unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
int startIncommingChannel() { return -1; }


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

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

LLVM IR (-O0):
define i32 @startIncommingChannel() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @startIncommingChannel() {
ret i32 -1
}
int test_imm_05int64_lowword_mem(long long *val) {
  return ((*val) & (0x05 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_05int64_lowword_mem>:
testb  $0x5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_05int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}