#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ nullf(char *, unsigned int, unsigned int);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int, unsigned int, unsigned int);
void emit_cvttpd2dq(unsigned int ssereg1, unsigned int ssereg2) {
  nullf("cvttpd2dq xmm%d,xmm%d\n", ssereg1, ssereg2);
  assert(ssereg1 < 8);
  assert(ssereg2 < 8);
  output_byte(0x66);
  output_byte(0x0f);
  output_byte(0xe6);
  output_modrm(3, ssereg1, ssereg2);
}


x86 assembly (clang, -O0):
<emit_cvttpd2dq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <nullf@plt>
cmpl   $0x8,-0x4(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x8,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x66,%edi
call   1040 <output_byte@plt>
mov    $0xf,%edi
call   1040 <output_byte@plt>
mov    $0xe6,%edi
call   1040 <output_byte@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x3,%edi
call   1050 <output_modrm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cvttpd2dq>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <nullf@plt>
xor    %edi,%edi
cmp    $0x8,%ebp
setb   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmp    $0x8,%ebx
setb   %dil
call   1060 <assert@plt>
mov    $0x66,%edi
call   1040 <output_byte@plt>
mov    $0xf,%edi
call   1040 <output_byte@plt>
mov    $0xe6,%edi
call   1040 <output_byte@plt>
mov    $0x3,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <output_modrm@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"cvttpd2dq xmm%d,xmm%d\0A\00"
define void @emit_cvttpd2dq(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @nullf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %4
%13 = icmp ult i32 %12, 8
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i32 @output_byte(i32 102)
%17 = call i32 @output_byte(i32 15)
%18 = call i32 @output_byte(i32 230)
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @output_modrm(i32 3, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"cvttpd2dq xmm%d,xmm%d\0A\00"
define void @emit_cvttpd2dq(i32 %0, i32 %1) {
%3 = tail call i32 @nullf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = icmp ult i32 %0, 8
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ult i32 %1, 8
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @output_byte(i32 102)
%11 = tail call i32 @output_byte(i32 15)
%12 = tail call i32 @output_byte(i32 230)
%13 = tail call i32 @output_modrm(i32 3, i32 %0, i32 %1)
ret void
}