xunge/DecIR huggingface dataset:
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_FILL;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEvalMesh2(int /*<<< orphan*/, int /*<<< orphan*/, int,
                               int /*<<< orphan*/, int);
int /*<<< orphan*/ glFlush();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glColor3f(1.0, 1.0, 1.0);
  glEvalMesh2(GL_FILL, 0, 20, 0, 20);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xe9d(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    $0x14,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   1040 <glEvalMesh2@plt>
mov    $0x0,%al
call   1060 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e90(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xea0(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glColor3f@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x14,%edx
xor    %ecx,%ecx
mov    $0x14,%r8d
call   1040 <glEvalMesh2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_FILL = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%6 = load i32, i32* @GL_FILL
%7 = call i32 @glEvalMesh2(i32 %6, i32 0, i32 20, i32 0, i32 20)
%8 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_FILL = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%6 = load i32, i32* @GL_FILL
%7 = tail call i32 @glEvalMesh2(i32 %6, i32 0, i32 20, i32 0, i32 20)
%8 = tail call i32 (...) @glFlush()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/ const);
float befloattoh(const uint32_t source) {
  union {
    uint32_t src;
    float dst;
  } converter;
  converter.src = ntohl(source);
  return converter.dst;
}


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

x86 assembly (clang, -O2):
<befloattoh>:
push   %rax
call   1030 <ntohl@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @befloattoh(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ntohl(i32 %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @befloattoh(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = bitcast i32 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_RemoteInput_InputKeyPress(void *);
int /*<<< orphan*/ printf(char *, int);
void UpnpRemoteIOClient_RemoteInput_InputKeyPress(void *upnptoken, int key) {
  printf("Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyPress(%d);\r\n", key);
  UpnpResponse_RemoteIOClient_RemoteInput_InputKeyPress(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_RemoteInput_InputKeyPress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputKeyPress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteInput_InputKeyPress>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputKeyPress@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyPress(%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputKeyPress(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 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputKeyPress(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyPress(%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputKeyPress(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputKeyPress(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lock_atom_add();
int /*<<< orphan*/ unlock_atom_add();
long long atom_add(long long *addr, long long value) {
  long long ret;
  lock_atom_add();
  ret = *addr;
  *addr += value;
  unlock_atom_add();
  return ret;
}


x86 assembly (clang, -O0):
<atom_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <lock_atom_add@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1040 <unlock_atom_add@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atom_add>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <lock_atom_add@plt>
mov    (%r14),%r15
add    %r15,%rbx
mov    %rbx,(%r14)
xor    %eax,%eax
call   1040 <unlock_atom_add@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @atom_add(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = call i32 (...) @lock_atom_add()
%7 = load i64*, i64** %3
%8 = load i64, i64* %7
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = load i64*, i64** %3
%11 = load i64, i64* %10
%12 = add nsw i64 %11, %9
store i64 %12, i64* %10
%13 = call i32 (...) @unlock_atom_add()
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
define i64 @atom_add(i64* nocapture %0, i64 %1) {
%3 = tail call i32 (...) @lock_atom_add()
%4 = load i64, i64* %0
%5 = add nsw i64 %4, %1
store i64 %5, i64* %0
%6 = tail call i32 (...) @unlock_atom_add()
ret i64 %4
}
int extractHeaderLength(unsigned char header_length) {
  return 4 * (header_length & 0x0F);
}


x86 assembly (clang, -O0):
<extractHeaderLength>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractHeaderLength>:
shl    $0x2,%dil
and    $0x3c,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @extractHeaderLength(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = mul nsw i32 4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @extractHeaderLength(i8 zeroext %0) {
%2 = shl i8 %0, 2
%3 = and i8 %2, 60
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void wait_for_next() { sleep(60); }


x86 assembly (clang, -O0):
<wait_for_next>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1030 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_next>:
mov    $0x3c,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @wait_for_next() {
%1 = call i32 @sleep(i32 60)
ret void
}

LLVM IR (-O2):
define void @wait_for_next() {
%1 = tail call i32 @sleep(i32 60)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clientServerModel(int);
int main() { clientServerModel(10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <clientServerModel@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <clientServerModel@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @clientServerModel(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @clientServerModel(i32 10)
ret i32 0
}
void *test_anti_range_114(long n) {
  extern void *alloc_anti_range_114(long) __attribute__((alloc_size(1)));
  if ((-0x7fffffffffffffffL - 1) + 2 <= n && n <= -1)
    n = (-0x7fffffffffffffffL - 1) + 2 - 1;
  return alloc_anti_range_114(n);
}


x86 assembly (clang, -O0):
<test_anti_range_114>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000002,%rax
cmp    -0x8(%rbp),%rax
jg     1149 <test_anti_range_114+0x39>
cmpq   $0xffffffffffffffff,-0x8(%rbp)
jg     1149 <test_anti_range_114+0x39>
movabs $0x8000000000000001,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_114@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_114>:
movabs $0x8000000000000001,%rax
cmp    %rax,%rdi
cmovae %rax,%rdi
jmp    1030 <alloc_anti_range_114@plt>

LLVM IR (-O0):
define i8* @test_anti_range_114(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 -9223372036854775806, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -9223372036854775807, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_114(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_114(i64 %0) {
%2 = icmp ult i64 %0, -9223372036854775807
%3 = select i1 %2, i64 %0, i64 -9223372036854775807
%4 = tail call i8* @alloc_anti_range_114(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free_move_parameters();
void free_options(void) { free_move_parameters(); }


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

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

LLVM IR (-O0):
define void @free_options() {
%1 = call i32 (...) @free_move_parameters()
ret void
}

LLVM IR (-O2):
define void @free_options() {
%1 = tail call i32 (...) @free_move_parameters()
ret void
}
/* Variables and functions */
int bit(char *, unsigned int);
int setbit(char *addr, unsigned int nr) {
  int __res = bit(addr, nr);
  addr[nr >> 3] |= (1 << (nr & 7));
  return __res != 0;
}


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bit@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
cmpl   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <bit@plt>
mov    %ebx,%ecx
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
mov    %ebx,%ecx
shr    $0x3,%rcx
or     %dl,(%r14,%rcx,1)
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @setbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @bit(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = shl i32 1, %10
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = lshr i32 %13, 3
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = or i32 %18, %11
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @setbit(i8* %0, i32 %1) {
%3 = tail call i32 @bit(i8* %0, i32 %1)
%4 = and i32 %1, 7
%5 = shl nuw nsw i32 1, %4
%6 = lshr i32 %1, 3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i32 %5 to i8
%11 = or i8 %9, %10
store i8 %11, i8* %8
%12 = icmp ne i32 %3, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
void fb_write_point(int row, int column, unsigned char *fb, int column_max) {
  int i;
  unsigned char word;
  i = row / 8;
  word = *(fb + i * column_max + column);
  word |= 0x1 << (row % 8);
  *(fb + i * column_max + column) = word;
}


x86 assembly (clang, -O0):
<fb_write_point>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x19(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_write_point>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
imul   %ecx,%eax
cltq
add    %rdx,%rax
and    $0x7,%dil
mov    $0x1,%edx
mov    %edi,%ecx
shl    %cl,%edx
movslq %esi,%rcx
or     %dl,(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @fb_write_point(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 8
store i32 %12, i32* %9
%13 = load i8*, i8** %7
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = mul nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
store i8 %22, i8* %10
%23 = load i32, i32* %5
%24 = srem i32 %23, 8
%25 = shl i32 1, %24
%26 = load i8, i8* %10
%27 = zext i8 %26 to i32
%28 = or i32 %27, %25
%29 = trunc i32 %28 to i8
store i8 %29, i8* %10
%30 = load i8, i8* %10
%31 = load i8*, i8** %7
%32 = load i32, i32* %9
%33 = load i32, i32* %8
%34 = mul nsw i32 %32, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %31, i64 %35
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
store i8 %30, i8* %39
ret void
}

LLVM IR (-O2):
define void @fb_write_point(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = sdiv i32 %0, 8
%6 = mul nsw i32 %5, %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = and i32 %0, 7
%13 = shl nuw nsw i32 1, %12
%14 = trunc i32 %13 to i8
%15 = or i8 %11, %14
store i8 %15, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int shutdown(int, int);
int close_connection(int socket_fd) {
  int result = 0;
  result = shutdown(socket_fd, 2);
  if (result < 0)
    perror("shutdown error");
  return result;
}


x86 assembly (clang, -O0):
<close_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1158 <close_connection+0x38>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_connection>:
push   %rbx
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1135 <close_connection+0x15>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec4(%rip),%rdi
call   1040 <perror@plt>
jmp    1131 <close_connection+0x11>

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

LLVM IR (-O2):
@.str = [15 x i8] c"shutdown error\00"
define i32 @close_connection(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
double interp_8_pt(double phim3, double phim2, double phim1, double phi,
                   double phip1, double phip2, double phip3, double phip4) {
  return (1225.0 / 2048.0 * (phi + phip1) - 245.0 / 2048.0 * (phim1 + phip2) +
          49.0 / 2048.0 * (phim2 + phip3) - 5.0 / 2048.0 * (phim3 + phip4));
}


x86 assembly (clang, -O0):
<interp_8_pt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
movsd  0xed0(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x38(%rbp),%xmm1
movsd  0xe83(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  0xe61(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp_8_pt>:
addsd  %xmm5,%xmm2
mulsd  0xef4(%rip),%xmm2
addsd  %xmm4,%xmm3
mulsd  0xef0(%rip),%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm6,%xmm1
mulsd  0xee8(%rip),%xmm1
addsd  %xmm3,%xmm1
addsd  %xmm7,%xmm0
mulsd  0xee0(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @interp_8_pt(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%17 = load double, double* %12
%18 = load double, double* %13
%19 = fadd double %17, %18
%20 = load double, double* %11
%21 = load double, double* %14
%22 = fadd double %20, %21
%23 = fmul double 0x3FBEA00000000000, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double 0x3FE3240000000000, double %19, double %24)
%26 = load double, double* %10
%27 = load double, double* %15
%28 = fadd double %26, %27
%29 = call double @llvm.fmuladd.f64(double 0x3F98800000000000, double %28, double %25)
%30 = load double, double* %9
%31 = load double, double* %16
%32 = fadd double %30, %31
%33 = call double @llvm.fmuladd.f64(double 0xBF64000000000000, double %32, double %29)
ret double %33
}

LLVM IR (-O2):
define double @interp_8_pt(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = fadd double %3, %4
%10 = fadd double %2, %5
%11 = fmul double %10, 0xBFBEA00000000000
%12 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FE3240000000000, double %11)
%13 = fadd double %1, %6
%14 = tail call double @llvm.fmuladd.f64(double %13, double 0x3F98800000000000, double %12)
%15 = fadd double %0, %7
%16 = tail call double @llvm.fmuladd.f64(double %15, double 0xBF64000000000000, double %14)
ret double %16
}
void rotate_word(unsigned char *w) {
  unsigned char temp;
  temp = w[0];
  w[0] = w[1];
  w[1] = w[2];
  w[2] = w[3];
  w[3] = temp;
}


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

x86 assembly (clang, -O2):
<rotate_word>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
mov    %cl,(%rdi)
movzwl 0x2(%rdi),%ecx
mov    %cx,0x1(%rdi)
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @rotate_word(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %2, i8* %7
ret void
}
/* Variables and functions */
int rand();
unsigned int sleep(int);
void *do_something(void *arg) {
  int rand_sec;
  unsigned int act_sec;
  rand_sec = rand() % 30 + 30;
  act_sec = sleep(rand_sec);
  return NULL;
}


x86 assembly (clang, -O0):
<do_something>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x1e,%ecx
cltd
idiv   %ecx
add    $0x1e,%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <sleep@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_something>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x4,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
lea    (%rax,%rsi,1),%edi
add    $0x1e,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @do_something(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 30
%7 = add nsw i32 %6, 30
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @sleep(i32 %8)
store i32 %9, i32* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @do_something(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 30
%4 = add nsw i32 %3, 30
%5 = tail call i32 @sleep(i32 %4)
ret i8* null
}
unsigned char accessDictionaryError(unsigned short index,
                                    unsigned char subIndex,
                                    unsigned long int sizeDataDict,
                                    unsigned long int sizeDataGiven,
                                    unsigned long int code) {
  return 0;
}


x86 assembly (clang, -O0):
<accessDictionaryError>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @accessDictionaryError(i16 zeroext %0, i8 zeroext %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i16
%7 = alloca i8
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i16 %0, i16* %6
store i8 %1, i8* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @accessDictionaryError(i16 zeroext %0, i8 zeroext %1, i64 %2, i64 %3, i64 %4) {
ret i8 0
}
int test_imm_56int8_reg(signed char val) {
  return ((val) & (-0x56 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_56int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_56int8_reg(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, -86
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_56int8_reg(i8 signext %0) {
%2 = and i8 %0, -86
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct cusp_link {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_cusp_link(struct cusp_link *clk) { free_object(16, (short *)clk); }


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

x86 assembly (clang, -O2):
<free_cusp_link>:
mov    %rdi,%rsi
mov    $0x10,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.cusp_link = type { i32 }
define void @free_cusp_link(%struct.cusp_link* %0) {
%2 = alloca %struct.cusp_link*
store %struct.cusp_link* %0, %struct.cusp_link** %2
%3 = load %struct.cusp_link*, %struct.cusp_link** %2
%4 = bitcast %struct.cusp_link* %3 to i16*
%5 = call i32 @free_object(i32 16, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.cusp_link = type { i32 }
define void @free_cusp_link(%struct.cusp_link* %0) {
%2 = bitcast %struct.cusp_link* %0 to i16*
%3 = tail call i32 @free_object(i32 16, i16* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dec_hl();
void opcode_35() { dec_hl(); }


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

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

LLVM IR (-O0):
define void @opcode_35() {
%1 = call i32 (...) @dec_hl()
ret void
}

LLVM IR (-O2):
define void @opcode_35() {
%1 = tail call i32 (...) @dec_hl()
ret void
}
void gmem_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @gmem_fini() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_char(unsigned int);
void print_dec(unsigned int i) {
  if (i > 9) {
    print_dec(i / 10);
    print_dec(i % 10);
  } else {
    print_char(i + '0');
  }
}


x86 assembly (clang, -O0):
<print_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jbe    1160 <print_dec+0x40>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <print_dec@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
call   1030 <print_dec@plt>
jmp    116b <print_dec+0x4b>
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1040 <print_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dec>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
cmp    $0xa,%edi
jb     1147 <print_dec+0x27>
mov    %ebp,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1030 <print_dec@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
add    $0x30,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <print_char@plt>

LLVM IR (-O0):
define void @print_dec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 9
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 10
%8 = load i32, i32* %2
%9 = urem i32 %8, 10
br label %14
10: ; preds = %1
%11 = load i32, i32* %2
%12 = add i32 %11, 48
%13 = call i32 @print_char(i32 %12)
br label %14
14: ; preds = %10, %5
ret void
}

LLVM IR (-O2):
define void @print_dec(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = udiv i32 %0, 10
tail call void @print_dec(i32 %4)
%5 = urem i32 %0, 10
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %0, %1 ], [ %5, %3 ]
%8 = add nuw nsw i32 %7, 48
%9 = tail call i32 @print_char(i32 %8)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int numbtrop_standard_dimension(int *dim) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(729, dim, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_standard_dimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d9,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_standard_dimension>:
mov    %rdi,%rsi
mov    $0x2d9,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @numbtrop_standard_dimension(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 729, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @numbtrop_standard_dimension(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 729, i32* %0, i32* undef, double* undef)
ret i32 %2
}
void trocaMinimo(int *v, int min, int pos) {
  int aux = v[pos];
  v[pos] = v[min];
  v[min] = aux;
}


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

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

LLVM IR (-O0):
define void @trocaMinimo(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* %6
%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* %5
%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* %6
%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* %5
%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 @trocaMinimo(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 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
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  long long x = 8589934592l;
  long long y = 2147483647;
  long long z = x / y;
  if (z == 4) {
    assert(1);
  }
  assert(z == 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x200000000,%rax
mov    %rax,-0x10(%rbp)
movq   $0x7fffffff,-0x18(%rbp)
7f
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x20(%rbp)
cmpq   $0x4,-0x20(%rbp)
jne    1158 <main+0x48>
mov    $0x1,%edi
call   1030 <assert@plt>
cmpq   $0x4,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i64 8589934592, i64* %2
store i64 2147483647, i64* %3
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = sdiv i64 %5, %6
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 4
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @assert(i32 1)
br label %12
12: ; preds = %10, %0
%13 = load i64, i64* %4
%14 = icmp eq i64 %13, 4
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
void outw(unsigned short port, unsigned short data) {
  __asm__ __volatile__("outw %1, %0" : : "dN"(port), "a"(data));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%ax
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
void frontf_(onoff) int *onoff;
{ frontface(*onoff); }


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

x86 assembly (clang, -O2):
<frontf_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <frontface@plt>

LLVM IR (-O0):
define void @frontf_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @frontface to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @frontf_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @frontface to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ OLED_SendBuffer(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ OLED_SetData();
int /*<<< orphan*/ SendCMD(int);
int /*<<< orphan*/ SendData(int);
void WriteFrame(uint8_t *buffer) {
  SendCMD(0x15);
  SendData(0);
  SendData(128 - 1);
  SendCMD(0x75);
  SendData(0);
  SendData(128 - 1);
  SendCMD(0x5C);
  OLED_SetData();
  OLED_SendBuffer(buffer, 32768);
}


x86 assembly (clang, -O0):
<WriteFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x15,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1060 <SendData@plt>
mov    $0x7f,%edi
call   1060 <SendData@plt>
mov    $0x75,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1060 <SendData@plt>
mov    $0x7f,%edi
call   1060 <SendData@plt>
mov    $0x5c,%edi
call   1030 <SendCMD@plt>
mov    $0x0,%al
call   1040 <OLED_SetData@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8000,%esi
call   1050 <OLED_SendBuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteFrame>:
push   %rbx
mov    %rdi,%rbx
mov    $0x15,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1060 <SendData@plt>
mov    $0x7f,%edi
call   1060 <SendData@plt>
mov    $0x75,%edi
call   1030 <SendCMD@plt>
xor    %edi,%edi
call   1060 <SendData@plt>
mov    $0x7f,%edi
call   1060 <SendData@plt>
mov    $0x5c,%edi
call   1030 <SendCMD@plt>
xor    %eax,%eax
call   1040 <OLED_SetData@plt>
mov    %rbx,%rdi
mov    $0x8000,%esi
pop    %rbx
jmp    1050 <OLED_SendBuffer@plt>

LLVM IR (-O0):
define void @WriteFrame(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @SendCMD(i32 21)
%4 = call i32 @SendData(i32 0)
%5 = call i32 @SendData(i32 127)
%6 = call i32 @SendCMD(i32 117)
%7 = call i32 @SendData(i32 0)
%8 = call i32 @SendData(i32 127)
%9 = call i32 @SendCMD(i32 92)
%10 = call i32 (...) @OLED_SetData()
%11 = load i32*, i32** %2
%12 = call i32 @OLED_SendBuffer(i32* %11, i32 32768)
ret void
}

LLVM IR (-O2):
define void @WriteFrame(i32* %0) {
%2 = tail call i32 @SendCMD(i32 21)
%3 = tail call i32 @SendData(i32 0)
%4 = tail call i32 @SendData(i32 127)
%5 = tail call i32 @SendCMD(i32 117)
%6 = tail call i32 @SendData(i32 0)
%7 = tail call i32 @SendData(i32 127)
%8 = tail call i32 @SendCMD(i32 92)
%9 = tail call i32 (...) @OLED_SetData()
%10 = tail call i32 @OLED_SendBuffer(i32* %0, i32 32768)
ret void
}
/* Variables and functions */
double fun(float);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float num;
  scanf("%f", &num);
  printf("%f", fun(num));
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <fun@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1030 <fun@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call double @fun(float %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %5)
%7 = call i32 (...) @getchar()
%8 = call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int64_t print(char *input) { printf("%s\n", input); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
void set_XSelectionClearEvent_time(void *_p, unsigned long _v) {
  ((XSelectionClearEvent *)_p)->time = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XSelectionClearEvent_time>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSelectionClearEvent_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSelectionClearEvent_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int test_imm_7Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x7A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Aint64_highword_reg>:
movabs $0x7a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 523986010112
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void write_frame(uint16_t *p, uint8_t red, uint8_t green, uint8_t blue) {
  uint16_t data = green & 0x1F;
  data <<= 5;
  data |= blue & 0x1F;
  data <<= 5;
  data |= red & 0x1F;
  data |= 0x8000;
  *p = data;
}


x86 assembly (clang, -O0):
<write_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x5,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1f,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x5,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
or     $0x8000,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_frame>:
and    $0x1f,%edx
shl    $0x5,%edx
and    $0x1f,%ecx
or     %edx,%ecx
shl    $0x5,%ecx
and    $0x1f,%esi
lea    (%rcx,%rsi,1),%eax
add    $0x8000,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @write_frame(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = and i32 %10, 31
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = shl i32 %12, 5
store i32 %13, i32* %9
%14 = load i32, i32* %8
%15 = and i32 %14, 31
%16 = load i32, i32* %9
%17 = or i32 %16, %15
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = shl i32 %18, 5
store i32 %19, i32* %9
%20 = load i32, i32* %6
%21 = and i32 %20, 31
%22 = load i32, i32* %9
%23 = or i32 %22, %21
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = or i32 %24, 32768
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = load i32*, i32** %5
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @write_frame(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 5
%6 = and i32 %5, 992
%7 = and i32 %3, 31
%8 = or i32 %6, %7
%9 = shl nuw nsw i32 %8, 5
%10 = and i32 %1, 31
%11 = or i32 %9, %10
%12 = or i32 %11, 32768
store i32 %12, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void d4(int n) { malloc(n); }


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

x86 assembly (clang, -O2):
<d4>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define void @d4(i32 %0) {
%2 = tail call i32 @malloc(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *command) {
  printf("usage :%s portnum filename\n", command);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"usage :%s portnum filename\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"usage :%s portnum filename\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}