int main(void) {
  char *junk = malloc(48);
  assert(junk);
  printf("\nComplain int64\n");
  __asm__ __volatile__("movq   0(%0), %%rax\n\t"
                       "movq   8(%0), %%r8\n\t"
                       "xorq   %%r8, %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "r8", "rax", "cc");
  printf("\nNo complain int64\n");
  __asm__ __volatile__("movq   0(%0), %%rax\n\t"
                       "movq   8(%0), %%r8\n\t"
                       "xorq   %%rax, %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "r8", "rax", "cc");
  printf("\nComplain mmx\n");
  __asm__ __volatile__("emms\n\t"
                       "movq   0(%0), %%mm0\n\t"
                       "movq   8(%0), %%mm7\n\t"
                       "pxor   %%mm7, %%mm0\n\t"
                       "movq   %%mm0, 16(%0)\n\t"
                       "cmpq   $0,16(%0)\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "mm7", "mm0", "cc", "memory");
  printf("\nNo complain mmx\n");
  __asm__ __volatile__("emms\n\t"
                       "movq   0(%0), %%mm0\n\t"
                       "movq   8(%0), %%mm7\n\t"
                       "pxor   %%mm0, %%mm0\n\t"
                       "movq   %%mm0, 16(%0)\n\t"
                       "cmpq   $0,16(%0)\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "mm7", "mm0", "cc", "memory");
  printf("\nComplain sse xorps\n");
  __asm__ __volatile__("movups   0(%0),  %%xmm0\n\t"
                       "movups   16(%0), %%xmm8\n\t"
                       "xorps    %%xmm8, %%xmm0\n\t"
                       "movups   %%xmm0, 32(%0)\n\t"
                       "movq 32(%0), %%rax\n\t"
                       "addq 40(%0), %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "rax", "xmm8", "xmm0", "cc", "memory");
  printf("\nNo complain sse xorps\n");
  __asm__ __volatile__("movups   0(%0),  %%xmm0\n\t"
                       "movups   16(%0), %%xmm8\n\t"
                       "xorps    %%xmm0, %%xmm0\n\t"
                       "movups   %%xmm0, 32(%0)\n\t"
                       "movq 32(%0), %%rax\n\t"
                       "addq 40(%0), %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "rax", "xmm8", "xmm0", "cc", "memory");
  printf("\nComplain sse2 pxor\n");
  __asm__ __volatile__("movups   0(%0),  %%xmm0\n\t"
                       "movups   16(%0), %%xmm8\n\t"
                       "pxor     %%xmm8, %%xmm0\n\t"
                       "movups   %%xmm0, 32(%0)\n\t"
                       "movq 32(%0), %%rax\n\t"
                       "addq 40(%0), %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "rax", "xmm8", "xmm0", "cc", "memory");
  printf("\nNo complain sse2 pxor\n");
  __asm__ __volatile__("movups   0(%0),  %%xmm0\n\t"
                       "movups   16(%0), %%xmm8\n\t"
                       "pxor     %%xmm0, %%xmm0\n\t"
                       "movups   %%xmm0, 32(%0)\n\t"
                       "movq 32(%0), %%rax\n\t"
                       "addq 40(%0), %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "rax", "xmm8", "xmm0", "cc", "memory");
  printf("\nComplain sse2 xorpd\n");
  __asm__ __volatile__("movups   0(%0),  %%xmm0\n\t"
                       "movups   16(%0), %%xmm8\n\t"
                       "xorpd    %%xmm8, %%xmm0\n\t"
                       "movups   %%xmm0, 32(%0)\n\t"
                       "movq 32(%0), %%rax\n\t"
                       "addq 40(%0), %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "rax", "xmm8", "xmm0", "cc", "memory");
  printf("\nNo complain sse2 xorpd\n");
  __asm__ __volatile__("movups   0(%0),  %%xmm0\n\t"
                       "movups   16(%0), %%xmm8\n\t"
                       "xorpd    %%xmm0, %%xmm0\n\t"
                       "movups   %%xmm0, 32(%0)\n\t"
                       "movq 32(%0), %%rax\n\t"
                       "addq 40(%0), %%rax\n\t"
                       ".byte 0x74,0x00"
                       :
                       : "r"(junk)
                       : "rax", "xmm8", "xmm0", "cc", "memory");
  free(junk);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x30,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <assert@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    0x8(%rcx),%r8
xor    %r8,%rax
je     1186 <main+0x46>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    0x8(%rcx),%r8
xor    %rax,%rax
je     11a4 <main+0x64>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
emms
movq   (%rax),%mm0
movq   0x8(%rax),%mm7
pxor   %mm7,%mm0
movq   %mm0,0x10(%rax)
cmpq   $0x0,0x10(%rax)
je     11cd <main+0x8d>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
emms
movq   (%rax),%mm0
movq   0x8(%rax),%mm7
pxor   %mm0,%mm0
movq   %mm0,0x10(%rax)
cmpq   $0x0,0x10(%rax)
je     11f6 <main+0xb6>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm8
xorps  %xmm8,%xmm0
movups %xmm0,0x20(%rcx)
mov    0x20(%rcx),%rax
add    0x28(%rcx),%rax
je     1222 <main+0xe2>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm8
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rcx)
mov    0x20(%rcx),%rax
add    0x28(%rcx),%rax
je     124d <main+0x10d>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm8
pxor   %xmm8,%xmm0
movups %xmm0,0x20(%rcx)
mov    0x20(%rcx),%rax
add    0x28(%rcx),%rax
je     127a <main+0x13a>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm8
pxor   %xmm0,%xmm0
movups %xmm0,0x20(%rcx)
mov    0x20(%rcx),%rax
add    0x28(%rcx),%rax
je     12a6 <main+0x166>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm8
xorpd  %xmm8,%xmm0
movups %xmm0,0x20(%rcx)
mov    0x20(%rcx),%rax
add    0x28(%rcx),%rax
je     12d3 <main+0x193>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rcx
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm8
xorpd  %xmm0,%xmm0
movups %xmm0,0x20(%rcx)
mov    0x20(%rcx),%rax
add    0x28(%rcx),%rax
je     12ff <main+0x1bf>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x30,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %eax,%eax
call   1050 <assert@plt>
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rax
mov    0x8(%rbx),%r8
xor    %r8,%rax
je     1170 <main+0x30>
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rax
mov    0x8(%rbx),%r8
xor    %rax,%rax
je     1188 <main+0x48>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
emms
movq   (%rbx),%mm0
movq   0x8(%rbx),%mm7
pxor   %mm7,%mm0
movq   %mm0,0x10(%rbx)
cmpq   $0x0,0x10(%rbx)
je     11ab <main+0x6b>
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
emms
movq   (%rbx),%mm0
movq   0x8(%rbx),%mm7
pxor   %mm0,%mm0
movq   %mm0,0x10(%rbx)
cmpq   $0x0,0x10(%rbx)
je     11ce <main+0x8e>
lea    0xe6d(%rip),%rdi
call   1040 <puts@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm8
xorps  %xmm8,%xmm0
movups %xmm0,0x20(%rbx)
mov    0x20(%rbx),%rax
add    0x28(%rbx),%rax
je     11f4 <main+0xb4>
lea    0xe5b(%rip),%rdi
call   1040 <puts@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm8
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rbx)
mov    0x20(%rbx),%rax
add    0x28(%rbx),%rax
je     1219 <main+0xd9>
lea    0xe4d(%rip),%rdi
call   1040 <puts@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm8
pxor   %xmm8,%xmm0
movups %xmm0,0x20(%rbx)
mov    0x20(%rbx),%rax
add    0x28(%rbx),%rax
je     1240 <main+0x100>
lea    0xe3a(%rip),%rdi
call   1040 <puts@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm8
pxor   %xmm0,%xmm0
movups %xmm0,0x20(%rbx)
mov    0x20(%rbx),%rax
add    0x28(%rbx),%rax
je     1266 <main+0x126>
lea    0xe2b(%rip),%rdi
call   1040 <puts@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm8
xorpd  %xmm8,%xmm0
movups %xmm0,0x20(%rbx)
mov    0x20(%rbx),%rax
add    0x28(%rbx),%rax
je     128d <main+0x14d>
lea    0xe19(%rip),%rdi
call   1040 <puts@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm8
xorpd  %xmm0,%xmm0
movups %xmm0,0x20(%rbx)
mov    0x20(%rbx),%rax
add    0x28(%rbx),%rax
je     12b3 <main+0x173>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0AComplain int64\0A\00"
@.str.1 = [20 x i8] c"\0ANo complain int64\0A\00"
@.str.2 = [15 x i8] c"\0AComplain mmx\0A\00"
@.str.3 = [18 x i8] c"\0ANo complain mmx\0A\00"
@.str.4 = [21 x i8] c"\0AComplain sse xorps\0A\00"
@.str.5 = [24 x i8] c"\0ANo complain sse xorps\0A\00"
@.str.6 = [21 x i8] c"\0AComplain sse2 pxor\0A\00"
@.str.7 = [24 x i8] c"\0ANo complain sse2 pxor\0A\00"
@.str.8 = [22 x i8] c"\0AComplain sse2 xorpd\0A\00"
@.str.9 = [25 x i8] c"\0ANo complain sse2 xorpd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i64 48)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%11 = load i8*, i8** %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%13 = load i8*, i8** %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%15 = load i8*, i8** %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%17 = load i8*, i8** %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%19 = load i8*, i8** %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%21 = load i8*, i8** %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%23 = load i8*, i8** %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
%25 = load i8*, i8** %2
%26 = load i8*, i8** %2
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"\0AComplain int64\00"
@str.10 = [19 x i8] c"\0ANo complain int64\00"
@str.11 = [14 x i8] c"\0AComplain mmx\00"
@str.12 = [17 x i8] c"\0ANo complain mmx\00"
@str.13 = [20 x i8] c"\0AComplain sse xorps\00"
@str.14 = [23 x i8] c"\0ANo complain sse xorps\00"
@str.15 = [20 x i8] c"\0AComplain sse2 pxor\00"
@str.16 = [23 x i8] c"\0ANo complain sse2 pxor\00"
@str.17 = [21 x i8] c"\0AComplain sse2 xorpd\00"
@str.18 = [24 x i8] c"\0ANo complain sse2 xorpd\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(48) i8* @malloc(i64 48)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
tail call void asm sideeffect "movq 0($0), %rax\0A\09movq 8($0), %r8\0A\09xorq %r8, %rax\0A\09.byte 0x74,0x00", "r,~{r8},~{rax},~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
tail call void asm sideeffect "movq 0($0), %rax\0A\09movq 8($0), %r8\0A\09xorq %rax, %rax\0A\09.byte 0x74,0x00", "r,~{r8},~{rax},~{cc},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.11, i64 0, i64 0))
tail call void asm sideeffect "emms\0A\09movq 0($0), %mm0\0A\09movq 8($0), %mm7\0A\09pxor %mm7, %mm0\0A\09movq %mm0, 16($0)\0A\09cmpq $$0,16($0)\0A\09.byte 0x74,0x00", "r,~{mm7},~{mm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0))
tail call void asm sideeffect "emms\0A\09movq 0($0), %mm0\0A\09movq 8($0), %mm7\0A\09pxor %mm0, %mm0\0A\09movq %mm0, 16($0)\0A\09cmpq $$0,16($0)\0A\09.byte 0x74,0x00", "r,~{mm7},~{mm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
tail call void asm sideeffect "movups 0($0), %xmm0\0A\09movups 16($0), %xmm8\0A\09xorps %xmm8, %xmm0\0A\09movups %xmm0, 32($0)\0A\09movq 32($0), %rax\0A\09addq 40($0), %rax\0A\09.byte 0x74,0x00", "r,~{rax},~{xmm8},~{xmm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.14, i64 0, i64 0))
tail call void asm sideeffect "movups 0($0), %xmm0\0A\09movups 16($0), %xmm8\0A\09xorps %xmm0, %xmm0\0A\09movups %xmm0, 32($0)\0A\09movq 32($0), %rax\0A\09addq 40($0), %rax\0A\09.byte 0x74,0x00", "r,~{rax},~{xmm8},~{xmm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.15, i64 0, i64 0))
tail call void asm sideeffect "movups 0($0), %xmm0\0A\09movups 16($0), %xmm8\0A\09pxor %xmm8, %xmm0\0A\09movups %xmm0, 32($0)\0A\09movq 32($0), %rax\0A\09addq 40($0), %rax\0A\09.byte 0x74,0x00", "r,~{rax},~{xmm8},~{xmm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.16, i64 0, i64 0))
tail call void asm sideeffect "movups 0($0), %xmm0\0A\09movups 16($0), %xmm8\0A\09pxor %xmm0, %xmm0\0A\09movups %xmm0, 32($0)\0A\09movq 32($0), %rax\0A\09addq 40($0), %rax\0A\09.byte 0x74,0x00", "r,~{rax},~{xmm8},~{xmm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.17, i64 0, i64 0))
tail call void asm sideeffect "movups 0($0), %xmm0\0A\09movups 16($0), %xmm8\0A\09xorpd %xmm8, %xmm0\0A\09movups %xmm0, 32($0)\0A\09movq 32($0), %rax\0A\09addq 40($0), %rax\0A\09.byte 0x74,0x00", "r,~{rax},~{xmm8},~{xmm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.18, i64 0, i64 0))
tail call void asm sideeffect "movups 0($0), %xmm0\0A\09movups 16($0), %xmm8\0A\09xorpd %xmm0, %xmm0\0A\09movups %xmm0, 32($0)\0A\09movq 32($0), %rax\0A\09addq 40($0), %rax\0A\09.byte 0x74,0x00", "r,~{rax},~{xmm8},~{xmm0},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1)
tail call void @free(i8* %1)
ret i32 0
}