void aesni_setkey_enc_192(unsigned char *rk, const unsigned char *key) {
  asm("movdqu (%1), %%xmm0   \n\t"
      "movdqu %%xmm0, (%0)   \n\t"
      "add $16, %0           \n\t"
      "movq 16(%1), %%xmm1   \n\t"
      "movq %%xmm1, (%0)     \n\t"
      "add $8, %0            \n\t"
      "jmp 2f                \n\t"
      "1:                            \n\t"
      "pshufd $0x55, %%xmm2, %%xmm2  \n\t"
      "pxor %%xmm0, %%xmm2           \n\t"
      "pslldq $4, %%xmm0             \n\t"
      "pxor %%xmm0, %%xmm2           \n\t"
      "pslldq $4, %%xmm0             \n\t"
      "pxor %%xmm0, %%xmm2           \n\t"
      "pslldq $4, %%xmm0             \n\t"
      "pxor %%xmm2, %%xmm0           \n\t"
      "movdqu %%xmm0, (%0)           \n\t"
      "add $16, %0                   \n\t"
      "pshufd $0xff, %%xmm0, %%xmm2  \n\t"
      "pxor %%xmm1, %%xmm2           \n\t"
      "pslldq $4, %%xmm1             \n\t"
      "pxor %%xmm2, %%xmm1           \n\t"
      "movq %%xmm1, (%0)             \n\t"
      "add $8, %0                    \n\t"
      "ret                           \n\t"
      "2:                            \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x01    \n\tcall 1b \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x02    \n\tcall 1b \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x04    \n\tcall 1b \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x08    \n\tcall 1b \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x10    \n\tcall 1b \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x20    \n\tcall 1b \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x40    \n\tcall 1b \n\t"
      ".byte 0x66,0x0F,0x3A,0xDF,"
      "0xD1"
      ",0x80    \n\tcall 1b \n\t"
      :
      : "r"(rk), "r"(key)
      : "memory", "cc", "0");
}


x86 assembly (clang, -O0):
<aesni_setkey_enc_192>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
movdqu (%rdx),%xmm0
movdqu %xmm0,(%rcx)
add    $0x10,%rcx
movq   0x10(%rdx),%xmm1
movq   %xmm1,(%rcx)
add    $0x8,%rcx
jmp    1179 <aesni_setkey_enc_192+0x79>
pshufd $0x55,%xmm2,%xmm2
pxor   %xmm0,%xmm2
pslldq $0x4,%xmm0
pxor   %xmm0,%xmm2
pslldq $0x4,%xmm0
pxor   %xmm0,%xmm2
pslldq $0x4,%xmm0
pxor   %xmm2,%xmm0
movdqu %xmm0,(%rcx)
add    $0x10,%rcx
pshufd $0xff,%xmm0,%xmm2
pxor   %xmm1,%xmm2
pslldq $0x4,%xmm1
pxor   %xmm2,%xmm1
movq   %xmm1,(%rcx)
add    $0x8,%rcx
ret
aeskeygenassist $0x1,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
aeskeygenassist $0x2,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
aeskeygenassist $0x4,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
aeskeygenassist $0x8,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
aeskeygenassist $0x10,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
aeskeygenassist $0x20,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
aeskeygenassist $0x40,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
aeskeygenassist $0x80,%xmm1,%xmm2
call   1132 <aesni_setkey_enc_192+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aesni_setkey_enc_192>:
movdqu (%rsi),%xmm0
movdqu %xmm0,(%rdi)
add    $0x10,%rdi
movq   0x10(%rsi),%xmm1
movq   %xmm1,(%rdi)
add    $0x8,%rdi
jmp    1162 <aesni_setkey_enc_192+0x62>
pshufd $0x55,%xmm2,%xmm2
pxor   %xmm0,%xmm2
pslldq $0x4,%xmm0
pxor   %xmm0,%xmm2
pslldq $0x4,%xmm0
pxor   %xmm0,%xmm2
pslldq $0x4,%xmm0
pxor   %xmm2,%xmm0
movdqu %xmm0,(%rdi)
add    $0x10,%rdi
pshufd $0xff,%xmm0,%xmm2
pxor   %xmm1,%xmm2
pslldq $0x4,%xmm1
pxor   %xmm2,%xmm1
movq   %xmm1,(%rdi)
add    $0x8,%rdi
ret
aeskeygenassist $0x1,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
aeskeygenassist $0x2,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
aeskeygenassist $0x4,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
aeskeygenassist $0x8,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
aeskeygenassist $0x10,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
aeskeygenassist $0x20,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
aeskeygenassist $0x40,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
aeskeygenassist $0x80,%xmm1,%xmm2
call   111b <aesni_setkey_enc_192+0x1b>
ret

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

LLVM IR (-O2):
define void @aesni_setkey_enc_192(i8* %0, i8* %1) {
tail call void asm sideeffect "movdqu ($1), %xmm0 \0A\09movdqu %xmm0, ($0) \0A\09add $$16, $0 \0A\09movq 16($1), %xmm1 \0A\09movq %xmm1, ($0) \0A\09add $$8, $0 \0A\09jmp 2f \0A\091: \0A\09pshufd $$0x55, %xmm2, %xmm2 \0A\09pxor %xmm0, %xmm2 \0A\09pslldq $$4, %xmm0 \0A\09pxor %xmm0, %xmm2 \0A\09pslldq $$4, %xmm0 \0A\09pxor %xmm0, %xmm2 \0A\09pslldq $$4, %xmm0 \0A\09pxor %xmm2, %xmm0 \0A\09movdqu %xmm0, ($0) \0A\09add $$16, $0 \0A\09pshufd $$0xff, %xmm0, %xmm2 \0A\09pxor %xmm1, %xmm2 \0A\09pslldq $$4, %xmm1 \0A\09pxor %xmm2, %xmm1 \0A\09movq %xmm1, ($0) \0A\09add $$8, $0 \0A\09ret \0A\092: \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x01 \0A\09call 1b \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x02 \0A\09call 1b \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x04 \0A\09call 1b \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x08 \0A\09call 1b \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x10 \0A\09call 1b \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x20 \0A\09call 1b \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x40 \0A\09call 1b \0A\09.byte 0x66,0x0F,0x3A,0xDF,0xD1,0x80 \0A\09call 1b \0A\09", "r,r,~{memory},~{cc},~{ax},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
ret void
}