xunge/DecIR huggingface dataset:
/* Type definitions */
struct hda_codec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alc889_coef_init(struct hda_codec *);
int /*<<< orphan*/ alc_hp_automute(struct hda_codec *);
void alc889_intel_init_hook(struct hda_codec *codec) {
  alc889_coef_init(codec);
  alc_hp_automute(codec);
}


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

x86 assembly (clang, -O2):
<alc889_intel_init_hook>:
push   %rbx
mov    %rdi,%rbx
call   1040 <alc889_coef_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <alc_hp_automute@plt>

LLVM IR (-O0):
%struct.hda_codec = type { i32 }
define void @alc889_intel_init_hook(%struct.hda_codec* %0) {
%2 = alloca %struct.hda_codec*
store %struct.hda_codec* %0, %struct.hda_codec** %2
%3 = load %struct.hda_codec*, %struct.hda_codec** %2
%4 = call i32 @alc889_coef_init(%struct.hda_codec* %3)
%5 = load %struct.hda_codec*, %struct.hda_codec** %2
%6 = call i32 @alc_hp_automute(%struct.hda_codec* %5)
ret void
}

LLVM IR (-O2):
%struct.hda_codec = type { i32 }
define void @alc889_intel_init_hook(%struct.hda_codec* %0) {
%2 = tail call i32 @alc889_coef_init(%struct.hda_codec* %0)
%3 = tail call i32 @alc_hp_automute(%struct.hda_codec* %0)
ret void
}
int contNum(int num, int k, int cont) {
  if (num < 1)
    return cont;
  if (num % 10 == k)
    cont++;
  return contNum(num / 10, k, cont);
}


x86 assembly (clang, -O0):
<contNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1136 <contNum+0x26>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <contNum+0x5e>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0xc(%rbp),%edx
jne    1153 <contNum+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <contNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contNum>:
mov    %edx,%eax
test   %edi,%edi
jle    1139 <contNum+0x39>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%ecx
lea    (%rcx,%rcx,4),%r9d
mov    %edi,%ecx
sub    %r9d,%ecx
xor    %r9d,%r9d
cmp    %esi,%ecx
sete   %r9b
add    %r9d,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <contNum+0x10>
ret

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

LLVM IR (-O2):
define i32 @contNum(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 1
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ %2, %3 ]
%7 = phi i32 [ %12, %5 ], [ %0, %3 ]
%8 = urem i32 %7, 10
%9 = icmp eq i32 %8, %1
%10 = zext i1 %9 to i32
%11 = add nsw i32 %6, %10
%12 = udiv i32 %7, 10
%13 = icmp ult i32 %7, 10
br i1 %13, label %14, label %5
14: ; preds = %5, %3
%15 = phi i32 [ %2, %3 ], [ %11, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print() { printf("hello world.."); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world..\00"
define void @print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello world..\00"
define void @print() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kill_children();
void signal_handler(int signum) { kill_children(); }


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

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

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @kill_children()
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @kill_children()
ret void
}
int networkInit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @networkInit() {
ret i32 0
}
/* Variables and functions */
void *memalign(int, size_t);
void *_FAT_mem_align(size_t size) { return memalign(32, size); }


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

x86 assembly (clang, -O2):
<_FAT_mem_align>:
mov    %rdi,%rsi
mov    $0x20,%edi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @_FAT_mem_align(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @memalign(i32 32, i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @_FAT_mem_align(i64 %0) {
%2 = tail call align 32 i8* @memalign(i32 32, i64 %0)
ret i8* %2
}
unsigned xrop3_67_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_67_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_67_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_67_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = and i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @xrop3_67_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
char *THAlloc(long);
int /*<<< orphan*/ memcpy(char *, char const *, long);
char *THMemoryFile_cloneString(const char *str, long size) {
  char *cstr = THAlloc(size);
  memcpy(cstr, str, size);
  return cstr;
}


x86 assembly (clang, -O0):
<THMemoryFile_cloneString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <THAlloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<THMemoryFile_cloneString>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <THAlloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @THMemoryFile_cloneString(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @THAlloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @THMemoryFile_cloneString(i8* %0, i64 %1) {
%3 = tail call i8* @THAlloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
double pow(double, int);
double f1(double x) { return pow(x, 2.); }


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

x86 assembly (clang, -O2):
<f1>:
mov    $0x2,%edi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @f1(double %0) {
%2 = tail call double @pow(double %0, i32 2)
ret double %2
}
char *swap_4bytes(const char *s, char *d) {
  d[0] = s[3];
  d[1] = s[2];
  d[2] = s[1];
  d[3] = s[0];
  return d;
}


x86 assembly (clang, -O0):
<swap_4bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_4bytes>:
mov    %rsi,%rax
mov    0x3(%rdi),%cl
mov    %cl,(%rsi)
mov    0x2(%rdi),%cl
mov    %cl,0x1(%rsi)
mov    0x1(%rdi),%cl
mov    %cl,0x2(%rsi)
mov    (%rdi),%cl
mov    %cl,0x3(%rsi)
ret

LLVM IR (-O0):
define i8* @swap_4bytes(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 = getelementptr inbounds i8, i8* %5, i64 3
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 3
store i8 %22, i8* %24
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @swap_4bytes(i8* nocapture %0, i8* returned writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = load i8, i8* %0
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret i8* %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int format;
};
struct TYPE_4__ {
  TYPE_1__ xclient;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xclient_format(void *_p, int _v) {
  ((XEvent *)_p)->xclient.format = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xclient_format(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xclient_format(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ds_vector_destroy(void *);
void ds_vector_destructor(void *vector) { ds_vector_destroy(vector); }


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

x86 assembly (clang, -O2):
<ds_vector_destructor>:
jmp    1030 <ds_vector_destroy@plt>

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

LLVM IR (-O2):
define void @ds_vector_destructor(i8* %0) {
%2 = tail call i32 @ds_vector_destroy(i8* %0)
ret void
}
void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00rfkill_free(%struct.rt2x00_dev* nocapture %0) {
ret void
}
/* Type definitions */
struct mtop {
  int mt_count;
  int /*<<< orphan*/ mt_op;
};

/* Variables and functions */
int /*<<< orphan*/ MTIOCTOP;
int /*<<< orphan*/ MTREW;
int ioctl(int, int /*<<< orphan*/, struct mtop *);
int rewind_tape(int fd) {
  struct mtop op;
  op.mt_count = 1;
  op.mt_op = MTREW;
  if (ioctl(fd, MTIOCTOP, &op) == -1)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<rewind_tape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1158 <rewind_tape+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <rewind_tape+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind_tape>:
push   %rax
movl   $0x1,(%rsp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mtop = type { i32, i32 }
@MTREW = global i32 0
@MTIOCTOP = global i32 0
define i32 @rewind_tape(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.mtop
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.mtop, %struct.mtop* %4, i32 0, i32 0
store i32 1, i32* %5
%6 = load i32, i32* @MTREW
%7 = getelementptr inbounds %struct.mtop, %struct.mtop* %4, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i32, i32* %3
%9 = load i32, i32* @MTIOCTOP
%10 = call i32 @ioctl(i32 %8, i32 %9, %struct.mtop* %4)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.mtop = type { i32, i32 }
@MTREW = global i32 0
@MTIOCTOP = global i32 0
define i32 @rewind_tape(i32 %0) {
%2 = alloca %struct.mtop
%3 = bitcast %struct.mtop* %2 to i8*
%4 = getelementptr inbounds %struct.mtop, %struct.mtop* %2, i64 0, i32 0
store i32 1, i32* %4
%5 = load i32, i32* @MTREW
%6 = getelementptr inbounds %struct.mtop, %struct.mtop* %2, i64 0, i32 1
store i32 %5, i32* %6
%7 = load i32, i32* @MTIOCTOP
%8 = call i32 @ioctl(i32 %0, i32 %7, %struct.mtop* %2)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
ret i32 %10
}
void ARGBToARGB1555Row_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB1555Row_Any_NEON() {
ret void
}
/* Variables and functions */
int tolower(unsigned char);
int toLower(const char *ptr) { return tolower(*(unsigned char *)ptr); }


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

x86 assembly (clang, -O2):
<toLower>:
movzbl (%rdi),%edi
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @toLower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @tolower(i8 zeroext %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @toLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @tolower(i8 zeroext %2)
ret i32 %3
}
int am_open_index_scan(int AM_fd, int op, char *value) { return -1; }


x86 assembly (clang, -O0):
<am_open_index_scan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @am_open_index_scan(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y_root;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
int get_XEnterWindowEvent_y_root(void *_p) {
  return (int)((XEnterWindowEvent *)_p)->y_root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XEnterWindowEvent_y_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_y_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t prevecmid(int32_t ecmid) {
  if (ecmid < 1)
    ecmid = 4096 - 1;
  else
    ecmid--;
  return ecmid;
}


x86 assembly (clang, -O0):
<prevecmid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    111d <prevecmid+0x1d>
movl   $0xfff,-0x4(%rbp)
jmp    1126 <prevecmid+0x26>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prevecmid>:
lea    -0x1(%rdi),%ecx
test   %edi,%edi
mov    $0xfff,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @prevecmid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 4095, i32* %2
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @prevecmid(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = add nsw i32 %0, -1
%4 = select i1 %2, i32 4095, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void *thr_fun(void *arg) {
  static int n = 0;
  printf("this is turn %d\n", n++);
  return thr_fun(arg);
}


x86 assembly (clang, -O0):
<thr_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f02(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2ef7(%rip)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <thr_fun@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fun>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x2f06(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2efd(%rip)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <thr_fun+0x10>

LLVM IR (-O0):
@thr_fun.n = internal global i32 0
@.str = [17 x i8] c"this is turn %d\0A\00"
define i8* @thr_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @thr_fun.n
%4 = add nsw i32 %3, 1
store i32 %4, i32* @thr_fun.n
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = load i8*, i8** %2
%7 = call i8* @thr_fun(i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@thr_fun.n = internal unnamed_addr global i32 0
@.str = [17 x i8] c"this is turn %d\0A\00"
define noalias i8* @thr_fun(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @thr_fun.n
%4 = add nsw i32 %3, 1
store i32 %4, i32* @thr_fun.n
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %2
}
int _udp_check_len_arg(int len) {
  int err = 0;
  if (len < 0) {
    err = -17;
  }
  return err;
}


x86 assembly (clang, -O0):
<_udp_check_len_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <_udp_check_len_arg+0x1f>
movl   $0xffffffef,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_udp_check_len_arg>:
mov    %edi,%eax
sar    $0x1f,%eax
and    $0xffffffef,%eax
ret

LLVM IR (-O0):
define i32 @_udp_check_len_arg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -17, i32* %3
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @_udp_check_len_arg(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 -17, i32 0
ret i32 %3
}
int mylibB() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @mylibB() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ decode(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  printf("Input disk file name:");
  char filename[256];
  scanf("%s", filename);
  decode(filename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <decode@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <decode@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Input disk file name:\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @decode(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Input disk file name:\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @decode(i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
void test(void) {
  pid_t pid = 0;
  pid_t pgid = 0;
  int result;
  result = setpgid(pid, pgid);
}


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

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <setpgid@plt>

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @setpgid(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void f11_1(void) {
  int x;
  ++x;
  clang_analyzer_warnIfReached();
}


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

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

LLVM IR (-O0):
define void @f11_1() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = call i32 (...) @clang_analyzer_warnIfReached()
ret void
}

LLVM IR (-O2):
define void @f11_1() {
%1 = tail call i32 (...) @clang_analyzer_warnIfReached()
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *dae_strdup(const char *str) {
  char *dup = NULL;
  if (str != NULL && *str != '\0') {
    size_t sz = strlen(str) + 1;
    dup = (char *)malloc(sz);
    memcpy(dup, str, sz);
  }
  return dup;
}


x86 assembly (clang, -O0):
<dae_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118f <dae_strdup+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     118f <dae_strdup+0x5f>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dae_strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     116b <dae_strdup+0x3b>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     116b <dae_strdup+0x3b>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    116e <dae_strdup+0x3e>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @dae_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = tail call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @memcpy(i8* %11, i8* %0, i64 %9)
br label %13
13: ; preds = %6, %3, %1
%14 = phi i8* [ %11, %6 ], [ null, %3 ], [ null, %1 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ IPC_listen(int /*<<< orphan*/);
void ipc_update(void) { IPC_listen(0); }


x86 assembly (clang, -O0):
<ipc_update>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <IPC_listen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_update>:
xor    %edi,%edi
jmp    1030 <IPC_listen@plt>

LLVM IR (-O0):
define void @ipc_update() {
%1 = call i32 @IPC_listen(i32 0)
ret void
}

LLVM IR (-O2):
define void @ipc_update() {
%1 = tail call i32 @IPC_listen(i32 0)
ret void
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec4_max(float *, float *, float *);
__attribute__((always_)) struct vec4 *
psvec4_max(struct vec4 *result, struct vec4 *a, struct vec4 *b) {
  vec4_max((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4_max>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4_max@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_max(%struct.vec4* %0, %struct.vec4* %1, %struct.vec4* %2) {
%4 = alloca %struct.vec4*
%5 = alloca %struct.vec4*
%6 = alloca %struct.vec4*
store %struct.vec4* %0, %struct.vec4** %4
store %struct.vec4* %1, %struct.vec4** %5
store %struct.vec4* %2, %struct.vec4** %6
%7 = load %struct.vec4*, %struct.vec4** %4
%8 = bitcast %struct.vec4* %7 to float*
%9 = load %struct.vec4*, %struct.vec4** %5
%10 = bitcast %struct.vec4* %9 to float*
%11 = load %struct.vec4*, %struct.vec4** %6
%12 = bitcast %struct.vec4* %11 to float*
%13 = call i32 @vec4_max(float* %8, float* %10, float* %12)
%14 = load %struct.vec4*, %struct.vec4** %4
ret %struct.vec4* %14
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_max(%struct.vec4* returned %0, %struct.vec4* %1, %struct.vec4* %2) {
%4 = bitcast %struct.vec4* %0 to float*
%5 = bitcast %struct.vec4* %1 to float*
%6 = bitcast %struct.vec4* %2 to float*
%7 = tail call i32 @vec4_max(float* %4, float* %5, float* %6)
ret %struct.vec4* %0
}
/* Variables and functions */
int /*<<< orphan*/ clitest(char *);
void *client_thread(void *arg) { clitest("129.135.107.64"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"129.135.107.64\00"
define noalias i8* @client_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @clitest(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
unsigned short xchg_16(void *ptr, unsigned short x) {
  asm volatile("xchgw %0,%1"
               : "=r"(x)
               : "m"(*(volatile unsigned short *)ptr), "0"(x)
               : "memory");
  return x;
}


x86 assembly (clang, -O0):
<xchg_16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xa(%rbp),%ax
xchg   %ax,(%rcx)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xchg_16>:
mov    %esi,%eax
xchg   %ax,(%rdi)
ret

LLVM IR (-O0):
define zeroext i16 @xchg_16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i16*
%7 = load i16, i16* %4
%8 = call i16 asm sideeffect "xchgw $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %6, i16 %7)
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @xchg_16(i8* %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
%4 = tail call i16 asm sideeffect "xchgw $0,$1", "=r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %3, i16 %1)
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ _or(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ _shiftL(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ _shiftR(unsigned char *, unsigned char *, unsigned char);
void ROR(unsigned char ans[8], unsigned char x[8], unsigned char r) {
  unsigned char r1[8];
  unsigned char r2[8];
  _shiftR(r1, x, r);
  _shiftL(r2, x, 64 - r);
  _or(ans, r1, r2);
}


x86 assembly (clang, -O0):
<ROR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
lea    -0x19(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <_shiftR@plt>
lea    -0x21(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%eax
mov    $0x40,%edx
sub    %eax,%edx
call   1040 <_shiftL@plt>
mov    -0x8(%rbp),%rdi
lea    -0x19(%rbp),%rsi
lea    -0x21(%rbp),%rdx
call   1050 <_or@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROR>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x10(%rsp),%r12
mov    %r12,%rdi
call   1030 <_shiftR@plt>
mov    $0x40,%edx
sub    %ebx,%edx
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_shiftL@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <_or@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ROR(i8* %0, i8* %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca [8 x i8]
%8 = alloca [8 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = load i8, i8* %6
%12 = call i32 @_shiftR(i8* %9, i8* %10, i8 zeroext %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%14 = load i8*, i8** %5
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = sub nsw i32 64, %16
%18 = call i32 @_shiftL(i8* %13, i8* %14, i32 %17)
%19 = load i8*, i8** %4
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%22 = call i32 @_or(i8* %19, i8* %20, i8* %21)
ret void
}

LLVM IR (-O2):
define void @ROR(i8* %0, i8* %1, i8 zeroext %2) {
%4 = alloca [8 x i8]
%5 = alloca [8 x i8]
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%8 = call i32 @_shiftR(i8* %6, i8* %1, i8 zeroext %2)
%9 = zext i8 %2 to i32
%10 = sub nsw i32 64, %9
%11 = call i32 @_shiftL(i8* %7, i8* %1, i32 %10)
%12 = call i32 @_or(i8* %0, i8* %6, i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int strlen(char *);
main() {
  void reverse(char[], int, int);
  char test[] = "the test string";
  printf("%s\n", test);
  reverse(test, 0, strlen(test) - 1);
  printf("%s\n", test);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1050 <printf@plt>
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
lea    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec7(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.test = [16 x i8] c"the test string\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = bitcast [16 x i8]* %1 to i8*
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [16 x i8] c"the test string\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = add nsw i32 %4, -1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
char *private_strerror(errnum)
int errnum;
{
  extern char *sys_errlist[];
  extern int sys_nerr;
  if (errnum > 0 && errnum <= sys_nerr)
    return sys_errlist[errnum];
  return "Unknown system error";
}


x86 assembly (clang, -O0):
<private_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113b <private_strerror+0x3b>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jg     113b <private_strerror+0x3b>
movslq -0xc(%rbp),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <private_strerror+0x46>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<private_strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
jle    1123 <private_strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jl     1123 <private_strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [21 x i8] c"Unknown system error\00"
define i8* @private_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %16
15: ; preds = %6, %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [21 x i8] c"Unknown system error\00"
define i8* @private_strerror(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = load i32, i32* @sys_nerr
%4 = icmp slt i32 %3, %0
%5 = select i1 %2, i1 true, i1 %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}
int main(int argc, char *argv[]) {
  char date[16], time[16];
  char cmdn[16], cmdr[16];
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca [16 x i8]
%8 = alloca [16 x i8]
%9 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xe6() {
  Assert_real((ispunct(230) == 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",
              1155, ("ispunct should be 0 for 0xe6"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xe6>:
push   %rax
mov    $0xe6,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x483,%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 0xe6\00"
define void @t_ispunct_0xe6() {
%1 = call i64 @ispunct(i32 230)
%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 1155, 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 0xe6\00"
define void @t_ispunct_0xe6() {
%1 = tail call i64 @ispunct(i32 230)
%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 1155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}