xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
uint16_t freertps_htons(uint16_t u) { return htons(u); }


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

x86 assembly (clang, -O2):
<freertps_htons>:
jmp    1030 <htons@plt>

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

LLVM IR (-O2):
define i32 @freertps_htons(i32 %0) {
%2 = tail call i32 @htons(i32 %0)
ret i32 %2
}
void gtk_text_view_set_buffer() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_set_buffer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteMax(int, unsigned char);
void WriteLED(unsigned char value) { WriteMax(7, value); }


x86 assembly (clang, -O0):
<WriteLED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7,%edi
movzbl -0x1(%rbp),%esi
call   1030 <WriteMax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLED>:
mov    %edi,%esi
mov    $0x7,%edi
jmp    1030 <WriteMax@plt>

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

LLVM IR (-O2):
define void @WriteLED(i8 zeroext %0) {
%2 = tail call i32 @WriteMax(i32 7, i8 zeroext %0)
ret void
}
exchange(buffer, zielnr, istnr, ex_buf) char **buffer;
int zielnr, istnr;
char **ex_buf;
{
  if (zielnr != istnr) {
    read(*ex_buf, zielnr);
    write(*buffer, zielnr);
    {
      char *hilfe = *buffer;
      *buffer = *ex_buf;
      *ex_buf = hilfe;
    }
  }
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     1188 <exchange+0x68>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <read@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
cmp    %edx,%esi
je     1156 <exchange+0x36>
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rcx),%rdi
xor    %eax,%eax
call   1040 <read@plt>
mov    (%rbx),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <write@plt>
mov    (%rbx),%rax
mov    (%r14),%rcx
mov    %rcx,(%rbx)
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @exchange(i8** %0, i32 %1, i32 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
store i8** %0, i8*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8** %3, i8*** %9
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %30
14: ; preds = %4
%15 = load i8**, i8*** %9
%16 = load i8*, i8** %15
%17 = load i32, i32* %7
%18 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i8*, i32, ...)*)(i8* %16, i32 %17)
%19 = load i8**, i8*** %6
%20 = load i8*, i8** %19
%21 = load i32, i32* %7
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i8*, i32, ...)*)(i8* %20, i32 %21)
%23 = load i8**, i8*** %6
%24 = load i8*, i8** %23
store i8* %24, i8** %10
%25 = load i8**, i8*** %9
%26 = load i8*, i8** %25
%27 = load i8**, i8*** %6
store i8* %26, i8** %27
%28 = load i8*, i8** %10
%29 = load i8**, i8*** %9
store i8* %28, i8** %29
br label %30
30: ; preds = %14, %4
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @exchange(i8** nocapture %0, i32 %1, i32 %2, i8** nocapture %3) {
%5 = icmp eq i32 %1, %2
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = load i8*, i8** %3
%8 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i8*, i32, ...)*)(i8* %7, i32 %1)
%9 = load i8*, i8** %0
%10 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i8*, i32, ...)*)(i8* %9, i32 %1)
%11 = load i8*, i8** %0
%12 = load i8*, i8** %3
store i8* %12, i8** %0
store i8* %11, i8** %3
br label %13
13: ; preds = %6, %4
ret i32 undef
}
int getpathbufferlen(void) { return 1023; }


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

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

LLVM IR (-O0):
define i32 @getpathbufferlen() {
ret i32 1023
}

LLVM IR (-O2):
define i32 @getpathbufferlen() {
ret i32 1023
}
double mus_char_to_ldouble(const unsigned char *inp) {
  double o;
  int i;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  for (i = 0; i < 8; i++)
    outp[i] = inp[i];
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_ldouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1145 <mus_char_to_ldouble+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <mus_char_to_ldouble+0x17>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_char_to_ldouble>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @mus_char_to_ldouble(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, char);
int CED_SendChar(int fh, char c) { return ioctl(fh, _IO(0xce, 5), c); }


x86 assembly (clang, -O0):
<CED_SendChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xce,%edi
mov    $0x5,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
movsbl -0x5(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_SendChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xce,%edi
mov    $0x5,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_SendChar(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @_IO(i32 206, i32 5)
%7 = load i8, i8* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i8 signext %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @CED_SendChar(i32 %0, i8 signext %1) {
%3 = tail call i32 @_IO(i32 206, i32 5)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i8 signext %1)
ret i32 %4
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};
typedef int __s32;

/* Variables and functions */
scalar_t__ i2c_smbus_access(int, int, int /*<<< orphan*/, int,
                            union i2c_smbus_data *);
__s32 i2c_smbus_read_byte(int file) {
  union i2c_smbus_data data;
  if (i2c_smbus_access(file, 1, 0, 1, &data))
    return -1;
  else
    return 0x0FF & data.byte;
}


x86 assembly (clang, -O0):
<i2c_smbus_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%ecx
xor    %edx,%edx
lea    -0x10(%rbp),%r8
mov    %ecx,%esi
call   1030 <i2c_smbus_access@plt>
cmp    $0x0,%rax
je     1146 <i2c_smbus_read_byte+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <i2c_smbus_read_byte+0x41>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_read_byte>:
push   %rax
mov    %rsp,%r8
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <i2c_smbus_access@plt>
movzbl (%rsp),%ecx
neg    %rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.i2c_smbus_data
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @i2c_smbus_access(i32 %5, i32 1, i32 0, i32 1, %union.i2c_smbus_data* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = bitcast %union.i2c_smbus_data* %4 to i32*
%11 = load i32, i32* %10
%12 = and i32 255, %11
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca %union.i2c_smbus_data
%3 = bitcast %union.i2c_smbus_data* %2 to i8*
%4 = call i64 @i2c_smbus_access(i32 %0, i32 1, i32 0, i32 1, %union.i2c_smbus_data* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 255
%9 = select i1 %5, i32 %8, i32 -1
ret i32 %9
}
/* Type definitions */
struct evbuffer {
  int dummy;
};
struct bufferevent {
  int dummy;
};

/* Variables and functions */
struct evbuffer *bufferevent_get_input(struct bufferevent *);
struct evbuffer *bufferevent_get_output(struct bufferevent *);
int /*<<< orphan*/ evbuffer_add_buffer(struct evbuffer *, struct evbuffer *);
void echo_read_cb(struct bufferevent *bev, void *ctx) {
  struct evbuffer *input = bufferevent_get_input(bev);
  struct evbuffer *output = bufferevent_get_output(bev);
  evbuffer_add_buffer(output, input);
}


x86 assembly (clang, -O0):
<echo_read_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <bufferevent_get_input@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bufferevent_get_output@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <evbuffer_add_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_read_cb>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <bufferevent_get_input@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <bufferevent_get_output@plt>
mov    %rax,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <evbuffer_add_buffer@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
%struct.evbuffer = type { i32 }
define void @echo_read_cb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
%5 = alloca %struct.evbuffer*
%6 = alloca %struct.evbuffer*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
%7 = load %struct.bufferevent*, %struct.bufferevent** %3
%8 = call %struct.evbuffer* @bufferevent_get_input(%struct.bufferevent* %7)
store %struct.evbuffer* %8, %struct.evbuffer** %5
%9 = load %struct.bufferevent*, %struct.bufferevent** %3
%10 = call %struct.evbuffer* @bufferevent_get_output(%struct.bufferevent* %9)
store %struct.evbuffer* %10, %struct.evbuffer** %6
%11 = load %struct.evbuffer*, %struct.evbuffer** %6
%12 = load %struct.evbuffer*, %struct.evbuffer** %5
%13 = call i32 @evbuffer_add_buffer(%struct.evbuffer* %11, %struct.evbuffer* %12)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
%struct.evbuffer = type { i32 }
define void @echo_read_cb(%struct.bufferevent* %0, i8* nocapture readnone %1) {
%3 = tail call %struct.evbuffer* @bufferevent_get_input(%struct.bufferevent* %0)
%4 = tail call %struct.evbuffer* @bufferevent_get_output(%struct.bufferevent* %0)
%5 = tail call i32 @evbuffer_add_buffer(%struct.evbuffer* %4, %struct.evbuffer* %3)
ret void
}
int jodirmd(argc, argv)
char **argv;
{
  showjobs(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<jodirmd>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <showjobs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @jodirmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @showjobs to i32 (i32, ...)*)(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @jodirmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @showjobs to i32 (i32, ...)*)(i32 0)
ret i32 0
}
void genbgez() {}


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

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

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

LLVM IR (-O2):
define void @genbgez() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergeSort(int arr[], int left, int right) {
  int mid;
  if (left < right) {
    mid = (left + right) / 2;
    mergeSort(arr, left, mid);
    mergeSort(arr, mid + 1, right);
    merge(arr, left, mid, right);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %edx,%esi
jge    1172 <mergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <mergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @mergeSort(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergeSort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __aeabi_memmove(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<__aeabi_memmove>:
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 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memmove>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @__aeabi_memmove(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("\n%f\n", a * 0.47);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xec0(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 4.700000e-01
%7 = fptosi double %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 4.700000e-01
%7 = fptosi double %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int rand();
float flrandom(float min, float max) {
  return (((rand() & 0x7FFF) * (max - min)) / 32768.0F) + min;
}


x86 assembly (clang, -O0):
<flrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
cvtsi2ss %eax,%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xeb8(%rip),%xmm1
divss  %xmm1,%xmm0
addss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flrandom>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
mulss  0xeb6(%rip),%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @flrandom(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call i32 (...) @rand()
%6 = and i32 %5, 32767
%7 = sitofp i32 %6 to float
%8 = load float, float* %4
%9 = load float, float* %3
%10 = fsub float %8, %9
%11 = fmul float %7, %10
%12 = fdiv float %11, 3.276800e+04
%13 = load float, float* %3
%14 = fadd float %12, %13
ret float %14
}

LLVM IR (-O2):
define float @flrandom(float %0, float %1) {
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 32767
%5 = sitofp i32 %4 to float
%6 = fsub float %1, %0
%7 = fmul float %6, %5
%8 = fmul float %7, 0x3F00000000000000
%9 = fadd float %8, %0
ret float %9
}
/* Variables and functions */
int getch();
int return_key(void) { return getch(); }


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

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

LLVM IR (-O0):
define i32 @return_key() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @return_key() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
/* Type definitions */
struct confElement {
  int dummy;
};

/* Variables and functions */
char *getValue(struct confElement *, char const *);
const char *getValueDef(struct confElement *main, const char *name,
                        const char *def) {
  const char *val = getValue(main, name);
  return ((val != NULL) ? val : def);
}


x86 assembly (clang, -O0):
<getValueDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <getValue@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <getValueDef+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1155 <getValueDef+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValueDef>:
push   %rbx
mov    %rdx,%rbx
call   1030 <getValue@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.confElement = type { i32 }
define i8* @getValueDef(%struct.confElement* %0, i8* %1, i8* %2) {
%4 = alloca %struct.confElement*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store %struct.confElement* %0, %struct.confElement** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load %struct.confElement*, %struct.confElement** %4
%9 = load i8*, i8** %5
%10 = call i8* @getValue(%struct.confElement* %8, i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i8*, i8** %7
br label %17
15: ; preds = %3
%16 = load i8*, i8** %6
br label %17
17: ; preds = %15, %13
%18 = phi i8* [ %14, %13 ], [ %16, %15 ]
ret i8* %18
}

LLVM IR (-O2):
%struct.confElement = type { i32 }
define i8* @getValueDef(%struct.confElement* %0, i8* %1, i8* readnone %2) {
%4 = tail call i8* @getValue(%struct.confElement* %0, i8* %1)
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* %2, i8* %4
ret i8* %6
}
void putnas(str) register char *str;
{
  register int c;
  while (c = 0xFF & (*str++))
    printf(c <= '~' ? "%c" : "\\%03o", c);
}


x86 assembly (clang, -O0):
<putnas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1166 <putnas+0x56>
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rdi
lea    0xeb0(%rip),%rax
cmp    $0x7e,%ecx
cmovle %rax,%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111c <putnas+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putnas>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1150 <putnas+0x40>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed7(%rip),%r14
lea    0xed3(%rip),%r15
movzbl %al,%esi
cmp    $0x7f,%sil
mov    %r15,%rdi
cmovb  %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <putnas+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [6 x i8] c"\\%03o\00"
define void @putnas(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = and i32 255, %8
store i32 %9, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 126
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* %15, i32 %16)
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [6 x i8] c"\\%03o\00"
define void @putnas(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = zext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = icmp ult i8 %5, 127
%10 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %10, i32 %7)
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret void
}
int gcspy_driverControlIsUnused(char val) { return (val & 4) != 0; }


x86 assembly (clang, -O0):
<gcspy_driverControlIsUnused>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcspy_driverControlIsUnused>:
shr    $0x2,%dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @gcspy_driverControlIsUnused(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @gcspy_driverControlIsUnused(i8 signext %0) {
%2 = lshr i8 %0, 2
%3 = and i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int libc_abort() { abort(); }


x86 assembly (clang, -O0):
<libc_abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<libc_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @libc_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @libc_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ATSFontGetName(char *);
void test_10095131() { ATSFontGetName("Hello"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define void @test_10095131() {
%1 = call i32 @ATSFontGetName(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define void @test_10095131() {
%1 = tail call i32 @ATSFontGetName(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long int confstr(signed int __name, char *__buf,
                          unsigned long int __len) {
  unsigned long int return_value___confstr_chk$1;
  unsigned long int return_value___confstr_chk_warn$2;
  unsigned long int return_value___confstr_alias$3;
  return_value___confstr_alias$3 = __confstr_alias(__name, __buf, __len);
  return return_value___confstr_alias$3;
}


x86 assembly (clang, -O0):
<confstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <__confstr_alias@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confstr>:
push   %rax
xor    %eax,%eax
call   1030 <__confstr_alias@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @confstr(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @__confstr_alias to i32 (i32, i8*, i64, ...)*)(i32 %10, i8* %11, i64 %12)
%14 = sext i32 %13 to i64
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @confstr(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @__confstr_alias to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %1, i64 %2)
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int min_height;
};
typedef TYPE_1__ XIconSize;

/* Variables and functions */
void set_XIconSize_min_height(void *_p, int _v) {
  ((XIconSize *)_p)->min_height = (int)_v;
}


x86 assembly (clang, -O0):
<set_XIconSize_min_height>:
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_XIconSize_min_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XIconSize_min_height(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_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XIconSize_min_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_39(uint64_t x) {
  __asm__("rolq $39, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_39>:
mov    %rdi,%rax
rol    $0x27,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_39(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$39, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_39(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$39, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int rand();
int EMU68error_add(char *format, ...) {
  return (int)((0xDEAD << (sizeof(int) * 8 - 16)) | (rand() & 0xFFF));
}


x86 assembly (clang, -O0):
<EMU68error_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
and    $0xfff,%eax
or     $0xdead0000,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMU68error_add>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0xfff,%eax
or     $0xdead0000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @EMU68error_add(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @rand()
%4 = and i32 %3, 4095
%5 = or i32 -559087616, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @EMU68error_add(i8* nocapture readnone %0, ...) {
%2 = tail call i32 (...) @rand()
%3 = and i32 %2, 4095
%4 = or i32 %3, -559087616
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("NHDP compiled!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"NHDP compiled!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"NHDP compiled!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void NullParams(void *id) {}


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

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

LLVM IR (-O0):
define void @NullParams(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @NullParams(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WDIOC_KEEPALIVE;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
void reset_watchdog(int fd) {
  int dummy;
  ioctl(fd, WDIOC_KEEPALIVE, &dummy);
}


x86 assembly (clang, -O0):
<reset_watchdog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_watchdog>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@WDIOC_KEEPALIVE = global i32 0
define void @reset_watchdog(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WDIOC_KEEPALIVE
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
ret void
}
void do_final_storage(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
extern void cannot_do(int sock_fd) {
  FILE *sock_fp = fdopen(sock_fd, "w");
  fprintf(sock_fp, "HTTP/1.0 501 Not Implemented\r\n"
                   "Content-type: text/plain\r\n"
                   "\r\n"
                   "That command is not yet implementd\r\n");
  fclose(sock_fp);
}


x86 assembly (clang, -O0):
<cannot_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xebb(%rip),%rsi
call   1050 <fdopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cannot_do>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1040 <fdopen@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    $0x5e,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [95 x i8] c"HTTP/1.0 501 Not Implemented\0D\0AContent-type: text/plain\0D\0A\0D\0AThat command is not yet implementd\0D\0A\00"
define void @cannot_do(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @fdopen(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [95 x i8] c"HTTP/1.0 501 Not Implemented\0D\0AContent-type: text/plain\0D\0A\0D\0AThat command is not yet implementd\0D\0A\00"
define void @cannot_do(i32 %0) {
%2 = tail call i32* @fdopen(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.1, i64 0, i64 0), i64 94, i64 1, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cursorshow(void) {
  printf("\x1b["
         "?25h");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
define void @cursorshow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @cursorshow() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((unused)) void oscap_free(void *p) {
  __oscap_free_dbg(&p, __FUNCTION__, 0);
}


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

x86 assembly (clang, -O2):
<oscap_free>:
push   %rax
mov    %rdi,(%rsp)
lea    0xee4(%rip),%rsi
mov    %rsp,%rdi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <__oscap_free_dbg@plt>
pop    %rax
ret

LLVM IR (-O0):
@__FUNCTION__.oscap_free = [11 x i8] c"oscap_free\00"
define void @oscap_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8**, i8*, i32, ...) bitcast (i32 (...)* @__oscap_free_dbg to i32 (i8**, i8*, i32, ...)*)(i8** %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.oscap_free, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.oscap_free = [11 x i8] c"oscap_free\00"
define void @oscap_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8**, i8*, i32, ...) bitcast (i32 (...)* @__oscap_free_dbg to i32 (i8**, i8*, i32, ...)*)(i8** %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.oscap_free, i64 0, i64 0), i32 0)
ret void
}
void gtk_text_iter_get_toggled_tags() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_get_toggled_tags() {
ret void
}
/* Type definitions */
struct shl_htable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ shl_htable_clear(struct shl_htable *,
                                    void (*)(void *, void *), void *);
void shl_htable_clear_str(struct shl_htable *htable,
                          void (*cb)(char **elem, void *ctx), void *ctx) {
  shl_htable_clear(htable, (void (*)(void *, void *))cb, ctx);
}


x86 assembly (clang, -O0):
<shl_htable_clear_str>:
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 <shl_htable_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_htable_clear_str>:
jmp    1030 <shl_htable_clear@plt>

LLVM IR (-O0):
%struct.shl_htable = type { i32 }
define void @shl_htable_clear_str(%struct.shl_htable* %0, void (i8**, i8*)* %1, i8* %2) {
%4 = alloca %struct.shl_htable*
%5 = alloca void (i8**, i8*)*
%6 = alloca i8*
store %struct.shl_htable* %0, %struct.shl_htable** %4
store void (i8**, i8*)* %1, void (i8**, i8*)** %5
store i8* %2, i8** %6
%7 = load %struct.shl_htable*, %struct.shl_htable** %4
%8 = load void (i8**, i8*)*, void (i8**, i8*)** %5
%9 = bitcast void (i8**, i8*)* %8 to void (i8*, i8*)*
%10 = load i8*, i8** %6
%11 = call i32 @shl_htable_clear(%struct.shl_htable* %7, void (i8*, i8*)* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.shl_htable = type { i32 }
define void @shl_htable_clear_str(%struct.shl_htable* %0, void (i8**, i8*)* %1, i8* %2) {
%4 = bitcast void (i8**, i8*)* %1 to void (i8*, i8*)*
%5 = tail call i32 @shl_htable_clear(%struct.shl_htable* %0, void (i8*, i8*)* %4, i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ random();
float ranfu(void) { return (float)random() / ((~0UL >> 1) * 1.0) - 1.0; }


x86 assembly (clang, -O0):
<ranfu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranfu>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed7(%rip),%xmm0
addsd  0xed7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ranfu() {
%1 = call i64 (...) @random()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fdiv double %3, 0x43E0000000000000
%5 = fsub double %4, 1.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @ranfu() {
%1 = tail call i64 (...) @random()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3C00000000000000
%5 = fadd double %4, -1.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void unknown_command_line(char *exe) {
  printf("Unknown command line option...\n");
  printf("Try: %s [-i input file] [-o output file]\n", exe);
  printf("For more informations, type: %s -h\n", exe);
}


x86 assembly (clang, -O0):
<unknown_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_command_line>:
push   %rbx
mov    %rdi,%rbx
lea    0xf23(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Unknown command line option...\0A\00"
@.str.1 = [42 x i8] c"Try: %s [-i input file] [-o output file]\0A\00"
@.str.2 = [36 x i8] c"For more informations, type: %s -h\0A\00"
define void @unknown_command_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"Try: %s [-i input file] [-o output file]\0A\00"
@.str.2 = [36 x i8] c"For more informations, type: %s -h\0A\00"
@str = [31 x i8] c"Unknown command line option...\00"
define void @unknown_command_line(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int lookup_slow(int);
int lookup(int val) {
  static int cache, cache_val;
  if (val == cache_val)
    return cache;
  else {
    cache_val = val;
    cache = lookup_slow(val);
    return cache;
  }
}


x86 assembly (clang, -O0):
<lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    0x2f0c(%rip),%eax
jne    1138 <lookup+0x28>
mov    0x2efc(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <lookup+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,0x2eef(%rip)
mov    -0x8(%rbp),%edi
call   1030 <lookup_slow@plt>
mov    %eax,0x2edd(%rip)
mov    0x2ed7(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup>:
push   %rax
cmp    %edi,0x2f19(%rip)
jne    1121 <lookup+0x11>
mov    0x2f0d(%rip),%eax
pop    %rcx
ret
mov    %edi,0x2f09(%rip)
call   1030 <lookup_slow@plt>
mov    %eax,0x2efa(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@lookup.cache = internal global i32 0
@lookup.cache_val = internal global i32 0
define i32 @lookup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @lookup.cache_val
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @lookup.cache
store i32 %8, i32* %2
br label %14
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* @lookup.cache_val
%11 = load i32, i32* %3
%12 = call i32 @lookup_slow(i32 %11)
store i32 %12, i32* @lookup.cache
%13 = load i32, i32* @lookup.cache
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@lookup.cache = internal unnamed_addr global i32 0
@lookup.cache_val = internal unnamed_addr global i32 0
define i32 @lookup(i32 %0) {
%2 = load i32, i32* @lookup.cache_val
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* @lookup.cache
br label %8
6: ; preds = %1
store i32 %0, i32* @lookup.cache_val
%7 = tail call i32 @lookup_slow(i32 %0)
store i32 %7, i32* @lookup.cache
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
int close(int fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
ret i32 -1
}