xunge/DecIR huggingface dataset:
int mus_char_to_bint(const unsigned char *inp) {
  int o;
  unsigned char *outp = (unsigned char *)&o;
  outp[0] = inp[3];
  outp[1] = inp[2];
  outp[2] = inp[1];
  outp[3] = inp[0];
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_bint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mus_char_to_bint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @mus_char_to_bint(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = load i8, i8* %0
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %7 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %5 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %3 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ __NR_close;
int syscall(int /*<<< orphan*/, int);
int my_epoll_close(int epfd) { return syscall(__NR_close, epfd); }


x86 assembly (clang, -O0):
<my_epoll_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_epoll_close>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_close = global i32 0
define i32 @my_epoll_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @__NR_close
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@__NR_close = global i32 0
define i32 @my_epoll_close(i32 %0) {
%2 = load i32, i32* @__NR_close
%3 = tail call i32 @syscall(i32 %2, i32 %0)
ret i32 %3
}
void RTManifestEntryRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTManifestEntryRemove() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ perror(char *);
pid_t safe_fork() {
  pid_t pid = fork();
  if (pid == -1) {
    perror("safe fork failed.");
    exit(EXIT_FAILURE);
  }
  return pid;
}


x86 assembly (clang, -O0):
<safe_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1166 <safe_fork+0x36>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fork>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
cmp    $0xffffffff,%eax
je     113f <safe_fork+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"safe fork failed.\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_fork() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [18 x i8] c"safe fork failed.\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_fork() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i32 %1
}
int sum1(int n, int *pSum) {
  n &&sum1(n - 1, pSum);
  return *pSum += n;
}


x86 assembly (clang, -O0):
<sum1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     1146 <sum1+0x36>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <sum1@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,(%rcx)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum1>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
test   %edi,%edi
je     1128 <sum1+0x18>
lea    -0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <sum1@plt>
add    (%r14),%ebx
mov    %ebx,(%r14)
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sum1(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = load i32*, i32** %4
%11 = call i32 @sum1(i32 %9, i32* %10)
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %7, %2
%14 = phi i1 [ false, %2 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
%16 = load i32, i32* %3
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = add nsw i32 %18, %16
store i32 %19, i32* %17
ret i32 %19
}

LLVM IR (-O2):
define i32 @sum1(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = tail call i32 @sum1(i32 %5, i32* %1)
br label %7
7: ; preds = %4, %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %0
store i32 %9, i32* %1
ret i32 %9
}
/* Variables and functions */
char HID_Read();
char usb_read() { return HID_Read(); }


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

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

LLVM IR (-O0):
define signext i8 @usb_read() {
%1 = call signext i8 (...) @HID_Read()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @usb_read() {
%1 = tail call signext i8 (...) @HID_Read()
ret i8 %1
}
int cmp_dec(int data1, int data2) { return !(data1 > data2); }


x86 assembly (clang, -O0):
<cmp_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_dec>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @cmp_dec(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct baseMatcher {
  int dummy;
};

/* Variables and functions */
scalar_t__ calloc(int, int);
int strlen(char *);
char *ConvertCodeStr(char *codeString, struct baseMatcher *matchArr) {
  int strLen = (strlen(codeString) + 1) * 3;
  char *finalByteStr = (char *)calloc(strLen, sizeof(char));
}


x86 assembly (clang, -O0):
<ConvertCodeStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertCodeStr>:
push   %rax
call   1030 <strlen@plt>
lea    (%rax,%rax,2),%edi
add    $0x3,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <calloc@plt>

LLVM IR (-O0):
%struct.baseMatcher = type { i32 }
define i8* @ConvertCodeStr(i8* %0, %struct.baseMatcher* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.baseMatcher*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store %struct.baseMatcher* %1, %struct.baseMatcher** %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, 3
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i64 @calloc(i32 %12, i32 1)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %7
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
%struct.baseMatcher = type { i32 }
define noalias i8* @ConvertCodeStr(i8* %0, %struct.baseMatcher* nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = mul i32 %3, 3
%5 = add i32 %4, 3
%6 = tail call i64 @calloc(i32 %5, i32 1)
ret i8* undef
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_sample_to_new_slices(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(665, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_sample_to_new_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x299,%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):
<quaddobl_sample_to_new_slices>:
mov    $0x299,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @quaddobl_sample_to_new_slices() {
%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 665, 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 @quaddobl_sample_to_new_slices() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 665, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
unsigned int foo_read(int volatile *);
unsigned int foo(volatile int *mem) {
  foo_read(mem);
  return foo_read(mem);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <foo_read@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <foo_read@plt>

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

LLVM IR (-O2):
define i32 @foo(i32* %0) {
%2 = tail call i32 @foo_read(i32* %0)
%3 = tail call i32 @foo_read(i32* %0)
ret i32 %3
}
unsigned xrop3_217_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 = T & S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_217_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    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -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_217_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_217_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* %7
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_217_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}
/* Variables and functions */
scalar_t__ sbuf_add_str(char const *, int, int /*<<< orphan*/);
scalar_t__ sbuf_add_unum(unsigned long, int /*<<< orphan*/);
int sbuf_add_param_num(const char *param, unsigned long value) {
  int retval = 0;
  if (sbuf_add_str(param, (1 << 0) | (1 << 2), 0))
    ++retval;
  if (!retval && sbuf_add_unum(value, 0))
    ++retval;
  return retval;
}


x86 assembly (clang, -O0):
<sbuf_add_param_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <sbuf_add_str@plt>
cmp    $0x0,%rax
je     115a <sbuf_add_param_num+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1182 <sbuf_add_param_num+0x62>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <sbuf_add_unum@plt>
cmp    $0x0,%rax
je     1182 <sbuf_add_param_num+0x62>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbuf_add_param_num>:
push   %rbx
mov    %rsi,%rbx
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <sbuf_add_str@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113f <sbuf_add_param_num+0x1f>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <sbuf_add_unum@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sbuf_add_param_num(i8* %0, i64 %1) {
%3 = tail call i64 @sbuf_add_str(i8* %0, i32 5, i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @sbuf_add_unum(i64 %1, i32 0)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void serial_write(int fd, char *buf, int bytes) { write(fd, buf, bytes); }


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @serial_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @serial_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret void
}
int fun964() { return 964; }


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

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

LLVM IR (-O0):
define i32 @fun964() {
ret i32 964
}

LLVM IR (-O2):
define i32 @fun964() {
ret i32 964
}
void swap(int arr[], int a, int b) {
  int temp;
  temp = arr[a];
  arr[a] = arr[b];
  arr[b] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
ISR(TWI_vect) {
  DEBUG("ISR "
        "TWI"
        " occured");
}


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

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"ISR TWI occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int test_imm_C9int16_mem(short *val) {
  return ((*val) & (0xC9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 201
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *strchr(char const *, char);
char value(char c) {
  const char *load =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  const char *find = strchr(load, c);
  return (find) ? find - load : 0;
}


x86 assembly (clang, -O0):
<value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <value+0x49>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1164 <value+0x54>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1164 <value+0x54>
mov    -0x20(%rbp),%rax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value>:
push   %rbx
mov    %edi,%esi
lea    0xee6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %bl,%cl
xor    %edx,%edx
test   %rax,%rax
movzbl %cl,%eax
cmove  %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @value(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
store i8 %0, i8* %2
store i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %2
%7 = call i8* @strchr(i8* %5, i8 signext %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %10
%18 = phi i64 [ %15, %10 ], [ 0, %16 ]
%19 = trunc i64 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @value(i8 signext %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(65) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp eq i8* %2, null
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i8
%6 = sub i8 %5, ptrtoint ([65 x i8]* @.str to i8)
%7 = select i1 %3, i8 0, i8 %6
ret i8 %7
}
void _test_no_assertions(struct test_case *__test__,
                         struct test_result *__result__, void *usrptr) {}


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

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

LLVM IR (-O0):
%struct.test_case = type opaque
%struct.test_result = type opaque
define void @_test_no_assertions(%struct.test_case* %0, %struct.test_result* %1, i8* %2) {
%4 = alloca %struct.test_case*
%5 = alloca %struct.test_result*
%6 = alloca i8*
store %struct.test_case* %0, %struct.test_case** %4
store %struct.test_result* %1, %struct.test_result** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.test_case = type opaque
%struct.test_result = type opaque
define void @_test_no_assertions(%struct.test_case* nocapture %0, %struct.test_result* nocapture %1, i8* nocapture %2) {
ret void
}
unsigned be_uint16_read(const void *ptr) {
  const unsigned char *ptr8 = (const unsigned char *)ptr;
  return (unsigned)ptr8[1] | (unsigned)ptr8[0] << 8;
}


x86 assembly (clang, -O0):
<be_uint16_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_uint16_read>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @be_uint16_read(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @be_uint16_read(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *imcomm_simplify_sn(char const *);
scalar_t__ strcmp(char *, char *);
int imcomm_compare_nicks(void *handle, const char *s1, const char *s2) {
  char *s3, *s4;
  int ret = 0;
  s3 = imcomm_simplify_sn(s1);
  s4 = imcomm_simplify_sn(s2);
  if (strcmp(s3, s4) == 0)
    ret = 1;
  free(s3);
  free(s4);
  return ret;
}


x86 assembly (clang, -O0):
<imcomm_compare_nicks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <imcomm_simplify_sn@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <imcomm_simplify_sn@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1183 <imcomm_compare_nicks+0x53>
movl   $0x1,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imcomm_compare_nicks>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdi
call   1050 <imcomm_simplify_sn@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <imcomm_simplify_sn@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @imcomm_compare_nicks(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %9
%10 = load i8*, i8** %5
%11 = call i8* @imcomm_simplify_sn(i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %6
%13 = call i8* @imcomm_simplify_sn(i8* %12)
store i8* %13, i8** %8
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i64 @strcmp(i8* %14, i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %3
store i32 1, i32* %9
br label %19
19: ; preds = %18, %3
%20 = load i8*, i8** %7
%21 = call i32 @free(i8* %20)
%22 = load i8*, i8** %8
%23 = call i32 @free(i8* %22)
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @imcomm_compare_nicks(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i8* @imcomm_simplify_sn(i8* %1)
%5 = tail call i8* @imcomm_simplify_sn(i8* %2)
%6 = tail call i64 @strcmp(i8* %4, i8* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @free(i8* %4)
%10 = tail call i32 @free(i8* %5)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_new();
int /*<<< orphan*/ bind_helper(int /*<<< orphan*/ *);
ENGINE *engine_opencl(void) {
  ENGINE *ret = ENGINE_new();
  if (!ret) {
    return NULL;
  }
  if (!bind_helper(ret)) {
    ENGINE_free(ret);
    return NULL;
  }
  return ret;
}


x86 assembly (clang, -O0):
<engine_opencl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ENGINE_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <engine_opencl+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    118b <engine_opencl+0x5b>
mov    -0x10(%rbp),%rdi
call   1050 <bind_helper@plt>
cmp    $0x0,%eax
jne    1183 <engine_opencl+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <ENGINE_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    118b <engine_opencl+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<engine_opencl>:
push   %rbx
xor    %eax,%eax
call   1040 <ENGINE_new@plt>
test   %rax,%rax
je     1154 <engine_opencl+0x24>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <bind_helper@plt>
test   %eax,%eax
jne    1156 <engine_opencl+0x26>
mov    %rbx,%rdi
call   1030 <ENGINE_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @engine_opencl() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @ENGINE_new()
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %0
store i32* null, i32** %1
br label %16
7: ; preds = %0
%8 = load i32*, i32** %2
%9 = call i32 @bind_helper(i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = load i32*, i32** %2
%13 = call i32 @ENGINE_free(i32* %12)
store i32* null, i32** %1
br label %16
14: ; preds = %7
%15 = load i32*, i32** %2
store i32* %15, i32** %1
br label %16
16: ; preds = %14, %11, %6
%17 = load i32*, i32** %1
ret i32* %17
}

LLVM IR (-O2):
define i32* @engine_opencl() {
%1 = tail call i32* (...) @ENGINE_new()
%2 = icmp eq i32* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @bind_helper(i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ENGINE_free(i32* %1)
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32* [ null, %6 ], [ null, %0 ], [ %1, %3 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_cp_info(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<close_cp_info>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_cp_info(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
struct utmpx {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ updwtmpx(char *, struct utmpx *);
void foo(void) {
  struct utmpx ut = {0};
  updwtmpx("/nonexistent", &ut);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <updwtmpx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
movl   $0x0,(%rsp)
lea    0xee1(%rip),%rdi
mov    %rsp,%rsi
call   1030 <updwtmpx@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.utmpx = type { i32 }
@.str = [13 x i8] c"/nonexistent\00"
define void @foo() {
%1 = alloca %struct.utmpx
%2 = bitcast %struct.utmpx* %1 to i8*
%3 = call i32 @updwtmpx(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.utmpx* %1)
ret void
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
@.str = [13 x i8] c"/nonexistent\00"
define void @foo() {
%1 = alloca %struct.utmpx
%2 = bitcast %struct.utmpx* %1 to i8*
%3 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %1, i64 0, i32 0
store i32 0, i32* %3
%4 = call i32 @updwtmpx(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.utmpx* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _quick_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int array[], int size) { _quick_sort(array, 0, size - 1); }


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <_quick_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <_quick_sort@plt>

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @_quick_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @_quick_sort(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ quad_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_hyper(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_longlong_t(XDR *xdrs, quad_t *llp) { return xdr_hyper(xdrs, llp); }


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

x86 assembly (clang, -O2):
<xdr_longlong_t>:
jmp    1030 <xdr_hyper@plt>

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

LLVM IR (-O2):
define i32 @xdr_longlong_t(i32* %0, i32* %1) {
%3 = tail call i32 @xdr_hyper(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isPerfectSquare(int);
int isFibonacci(int n) {
  return isPerfectSquare(5 * n * n + 4) || isPerfectSquare(5 * n * n - 4);
}


x86 assembly (clang, -O0):
<isFibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%edi
imul   -0x4(%rbp),%edi
add    $0x4,%edi
call   1030 <isPerfectSquare@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isFibonacci+0x47>
imul   $0x5,-0x4(%rbp),%edi
imul   -0x4(%rbp),%edi
sub    $0x4,%edi
call   1030 <isPerfectSquare@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFibonacci>:
push   %rbx
mov    %edi,%ebx
imul   %ebx,%ebx
lea    (%rbx,%rbx,4),%edi
add    $0x4,%edi
call   1030 <isPerfectSquare@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1130 <isFibonacci+0x20>
pop    %rbx
ret
lea    (%rbx,%rbx,4),%edi
add    $0xfffffffc,%edi
call   1030 <isPerfectSquare@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isFibonacci(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 5, %3
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = add nsw i32 %6, 4
%8 = call i64 @isPerfectSquare(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %1
%11 = load i32, i32* %2
%12 = mul nsw i32 5, %11
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %14, 4
%16 = call i64 @isPerfectSquare(i32 %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %10, %1
%19 = phi i1 [ true, %1 ], [ %17, %10 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isFibonacci(i32 %0) {
%2 = mul nsw i32 %0, 5
%3 = mul nsw i32 %2, %0
%4 = add nsw i32 %3, 4
%5 = tail call i64 @isPerfectSquare(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = add nsw i32 %3, -4
%9 = tail call i64 @isPerfectSquare(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %1
%13 = phi i32 [ 1, %1 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ floorf(float);
long iRound(int /*<<< orphan*/);
long int iFloor(float f) { return iRound(floorf(f)); }


x86 assembly (clang, -O0):
<iFloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floorf@plt>
mov    %eax,%edi
call   1030 <iRound@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @iFloor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @floorf(float %3)
%5 = call i64 @iRound(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @iFloor(float %0) {
%2 = tail call i32 @floorf(float %0)
%3 = tail call i64 @iRound(i32 %2)
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void set4BE(unsigned char *buf, uint32_t val) {
  buf[0] = val >> 24;
  buf[1] = val >> 16;
  buf[2] = val >> 8;
  buf[3] = val;
}


x86 assembly (clang, -O0):
<set4BE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @set4BE(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ malloc(int);
char *tostring(char ch) {
  char *buffer = (char *)malloc(sizeof(char) * 2);
  assert(buffer);
  buffer[0] = ch;
  buffer[1] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<tostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tostring>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %bpl,(%rbx)
movb   $0x0,0x1(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @tostring(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = call i64 @malloc(i32 2)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8, i8* %2
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 0, i8* %12
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @tostring(i8 signext %0) {
%2 = tail call i64 @malloc(i32 2)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @assert(i8* %3)
store i8 %0, i8* %3
%5 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: read_fq fastq_file seq_name\n\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: read_fq fastq_file seq_name\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"Usage: read_fq fastq_file seq_name\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
void yy_1_InlineTextBlockMore(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_InlineTextBlockMore(i8* nocapture %0, i32 %1) {
ret void
}
unsigned long int cast_short_ulong_fast(short int x) {
  return (unsigned long int)x;
}


x86 assembly (clang, -O0):
<cast_short_ulong_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_short_ulong_fast>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @cast_short_ulong_fast(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_short_ulong_fast(i16 signext %0) {
%2 = sext i16 %0 to i64
ret i64 %2
}
unsigned int md5_G(unsigned int X, unsigned int Y, unsigned int Z) {
  return (X & Z) | (Y & ~Z);
}


x86 assembly (clang, -O0):
<md5_G>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @md5_G(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* %6
%9 = and i32 %7, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @md5_G(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %0
%5 = xor i32 %2, -1
%6 = and i32 %5, %1
%7 = or i32 %4, %6
ret i32 %7
}
/* Type definitions */
struct delicious {
  int dummy;
};

/* Variables and functions */
struct delicious *bake(struct delicious **cake) {
  int *zero = NULL;
  *zero = 3;
  return NULL;
}


x86 assembly (clang, -O0):
<bake>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.delicious = type { i32 }
define %struct.delicious* @bake(%struct.delicious** %0) {
%2 = alloca %struct.delicious**
%3 = alloca i32*
store %struct.delicious** %0, %struct.delicious*** %2
store i32* null, i32** %3
%4 = load i32*, i32** %3
store i32 3, i32* %4
ret %struct.delicious* null
}

LLVM IR (-O2):