void pcmpistri_debug(const char *s1, const char *s2) {
  int ecx;
  int eax;
  __asm__ __volatile__("movups  (%%rsi), %%xmm1                \n"
                       "movups  (%%rdi), %%xmm2                \n"
                       "xor      %%rax, %%rax                  \n"
                       "pcmpistri %[setup], %%xmm2, %%xmm1     \n"
                       "lahf                                   \n"
                       "seto %%al                              \n"
                       : "=c"(ecx), "=a"(eax)
                       : "S"(s1), "D"(s2), [setup] "i"(0 | 0b1000000));
  printf("s1  = '%s'\n", s1);
  printf("s2  = '%s'\n", s2);
  printf("ecx = %d\n", ecx);
  printf("eax = %x\n", eax);
  printf(" CF = %d\n", (eax & (0b00000001 << 8)) != 0);
  printf(" ZF = %d\n", (eax & (0b01000000 << 8)) != 0);
  printf(" SF = %d\n", (eax & (0b10000000 << 8)) != 0);
  printf(" OF = %d\n", (eax & 1) != 0);
  printf(" AF = %d\n", (eax & (0b00010000 << 8)) != 0);
}


x86 assembly (clang, -O0):
<pcmpistri_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
movups (%rsi),%xmm1
movups (%rdi),%xmm2
xor    %rax,%rax
pcmpistri $0x40,%xmm2,%xmm1
lahf
seto   %al
mov    %ecx,-0x14(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcmpistri_debug>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %r14,%rdi
movups (%rsi),%xmm1
movups (%rdi),%xmm2
xor    %rax,%rax
pcmpistri $0x40,%xmm2,%xmm1
lahf
seto   %al
mov    %eax,%ebx
mov    %ecx,%ebp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%esi
shr    $0x8,%esi
and    $0x1,%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%esi
shr    $0xe,%esi
and    $0x1,%esi
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%esi
shr    $0xf,%esi
and    $0x1,%esi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%esi
and    $0x1,%esi
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
shr    $0xc,%ebx
and    $0x1,%ebx
lea    0xe7f(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"s1 = '%s'\0A\00"
@.str.1 = [12 x i8] c"s2 = '%s'\0A\00"
@.str.2 = [10 x i8] c"ecx = %d\0A\00"
@.str.3 = [10 x i8] c"eax = %x\0A\00"
@.str.4 = [10 x i8] c" CF = %d\0A\00"
@.str.5 = [10 x i8] c" ZF = %d\0A\00"
@.str.6 = [10 x i8] c" SF = %d\0A\00"
@.str.7 = [10 x i8] c" OF = %d\0A\00"
@.str.8 = [10 x i8] c" AF = %d\0A\00"
define void @pcmpistri_debug(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call { i32, i32 } asm sideeffect "movups (%rsi), %xmm1 \0Amovups (%rdi), %xmm2 \0Axor %rax, %rax \0Apcmpistri $4, %xmm2, %xmm1 \0Alahf \0Aseto %al \0A", "={cx},={ax},{si},{di},i,~{dirflag},~{fpsr},~{flags}"(i8* %7, i8* %8, i32 64)
%10 = extractvalue { i32, i32 } %9, 0
%11 = extractvalue { i32, i32 } %9, 1
store i32 %10, i32* %5
store i32 %11, i32* %6
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %6
%21 = and i32 %20, 256
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %6
%26 = and i32 %25, 16384
%27 = icmp ne i32 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %6
%31 = and i32 %30, 32768
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %6
%36 = and i32 %35, 1
%37 = icmp ne i32 %36, 0
%38 = zext i1 %37 to i32
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %6
%41 = and i32 %40, 4096
%42 = icmp ne i32 %41, 0
%43 = zext i1 %42 to i32
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %43)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"s1 = '%s'\0A\00"
@.str.1 = [12 x i8] c"s2 = '%s'\0A\00"
@.str.2 = [10 x i8] c"ecx = %d\0A\00"
@.str.3 = [10 x i8] c"eax = %x\0A\00"
@.str.4 = [10 x i8] c" CF = %d\0A\00"
@.str.5 = [10 x i8] c" ZF = %d\0A\00"
@.str.6 = [10 x i8] c" SF = %d\0A\00"
@.str.7 = [10 x i8] c" OF = %d\0A\00"
@.str.8 = [10 x i8] c" AF = %d\0A\00"
define void @pcmpistri_debug(i8* %0, i8* %1) {
%3 = tail call { i32, i32 } asm sideeffect "movups (%rsi), %xmm1 \0Amovups (%rdi), %xmm2 \0Axor %rax, %rax \0Apcmpistri $4, %xmm2, %xmm1 \0Alahf \0Aseto %al \0A", "={cx},={ax},{si},{di},i,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i32 64)
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%10 = lshr i32 %5, 8
%11 = and i32 %10, 1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = lshr i32 %5, 14
%14 = and i32 %13, 1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = lshr i32 %5, 15
%17 = and i32 %16, 1
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %17)
%19 = and i32 %5, 1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %19)
%21 = lshr i32 %5, 12
%22 = and i32 %21, 1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %22)
ret void
}