void test_xchg(void) {
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("xchgl"
        " %"
        ""
        "0, %"
        ""
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1));
    printf("%-10s A=%08x B=%08x\n", "xchgl", op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("xchgw"
        " %"
        "w"
        "0, %"
        "w"
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1));
    printf("%-10s A=%08x B=%08x\n", "xchgw", op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("xchgb"
        " %"
        "b"
        "0, %"
        "b"
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1));
    printf("%-10s A=%08x B=%08x\n", "xchgb", op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("xchgl"
        " %"
        ""
        "0, %"
        ""
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1));
    printf("%-10s A=%08x B=%08x\n", "xchgl", op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("xchgw"
        " %"
        "w"
        "0, %"
        "w"
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1));
    printf("%-10s A=%08x B=%08x\n", "xchgw", op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("xchgb"
        " %"
        "b"
        "0, %"
        "b"
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1));
    printf("%-10s A=%08x B=%08x\n", "xchgb", op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgl"
        " %"
        ""
        "0, %"
        ""
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1), "a"(0xfbca7654));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgl", 0xfbca7654, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgw"
        " %"
        "w"
        "0, %"
        "w"
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1), "a"(0xfbca7654));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgw", 0xfbca7654, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgb"
        " %"
        "b"
        "0, %"
        "b"
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1), "a"(0xfbca7654));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgb", 0xfbca7654, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgl"
        " %"
        ""
        "0, %"
        ""
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1), "a"(0xfffefdfc));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgl", 0xfffefdfc, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgw"
        " %"
        "w"
        "0, %"
        "w"
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1), "a"(0xfffefdfc));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgw", 0xfffefdfc, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgb"
        " %"
        "b"
        "0, %"
        "b"
        "1"
        : "=q"(op0), "=q"(op1)
        : "0"(op0), "1"(op1), "a"(0xfffefdfc));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgb", 0xfffefdfc, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgl"
        " %"
        ""
        "0, %"
        ""
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1), "a"(0xfbca7654));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgl", 0xfbca7654, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgw"
        " %"
        "w"
        "0, %"
        "w"
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1), "a"(0xfbca7654));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgw", 0xfbca7654, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgb"
        " %"
        "b"
        "0, %"
        "b"
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1), "a"(0xfbca7654));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgb", 0xfbca7654, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgl"
        " %"
        ""
        "0, %"
        ""
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1), "a"(0xfffefdfc));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgl", 0xfffefdfc, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgw"
        " %"
        "w"
        "0, %"
        "w"
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1), "a"(0xfffefdfc));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgw", 0xfffefdfc, op0, op1);
  };
  {
    int op0, op1;
    op0 = 0x12345678;
    op1 = 0xfbca7654;
    asm("cmpxchgb"
        " %"
        "b"
        "0, %"
        "b"
        "1"
        : "=q"(op0), "=m"(op1)
        : "0"(op0), "1"(op1), "a"(0xfffefdfc));
    printf("%-10s EAX=%08x A=%08x C=%08x\n", "cmpxchgb", 0xfffefdfc, op0, op1);
  };
}


x86 assembly (clang, -O0):
<test_xchg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x12345678,-0x4(%rbp)
movl   $0xfbca7654,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
xchg   %eax,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0xc(%rbp)
movl   $0xfbca7654,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
xchg   %ax,%cx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe86(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x14(%rbp)
movl   $0xfbca7654,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
xchg   %al,%cl
mov    %ecx,-0x14(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe4f(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x1c(%rbp)
movl   $0xfbca7654,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
xchg   %eax,-0x20(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe1d(%rip),%rdi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x24(%rbp)
movl   $0xfbca7654,-0x28(%rbp)
mov    -0x24(%rbp),%eax
xchg   %ax,-0x28(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
lea    0xdea(%rip),%rdi
lea    0xe22(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x2c(%rbp)
movl   $0xfbca7654,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
xchg   %al,-0x30(%rbp)
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
lea    0xdb8(%rip),%rdi
lea    0xdf9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x34(%rbp)
movl   $0xfbca7654,-0x38(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%edx
mov    $0xfbca7654,%eax
cmpxchg %ecx,%edx
mov    %edx,%eax
mov    %ecx,-0x34(%rbp)
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
lea    0xd8d(%rip),%rdi
lea    0xda4(%rip),%rsi
mov    $0xfbca7654,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x3c(%rbp)
movl   $0xfbca7654,-0x40(%rbp)
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%edx
mov    $0xfbca7654,%eax
cmpxchg %cx,%dx
mov    %edx,%eax
mov    %ecx,-0x3c(%rbp)
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
lea    0xd47(%rip),%rdi
lea    0xd67(%rip),%rsi
mov    $0xfbca7654,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x44(%rbp)
movl   $0xfbca7654,-0x48(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%edx
mov    $0xfbca7654,%eax
cmpxchg %cl,%dl
mov    %edx,%eax
mov    %ecx,-0x44(%rbp)
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x48(%rbp),%r8d
lea    0xd02(%rip),%rdi
lea    0xd2b(%rip),%rsi
mov    $0xfbca7654,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x4c(%rbp)
movl   $0xfbca7654,-0x50(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x50(%rbp),%edx
mov    $0xfffefdfc,%eax
cmpxchg %ecx,%edx
mov    %edx,%eax
mov    %ecx,-0x4c(%rbp)
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0x50(%rbp),%r8d
lea    0xcbd(%rip),%rdi
lea    0xcd4(%rip),%rsi
mov    $0xfffefdfc,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x54(%rbp)
movl   $0xfbca7654,-0x58(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x58(%rbp),%edx
mov    $0xfffefdfc,%eax
cmpxchg %cx,%dx
mov    %edx,%eax
mov    %ecx,-0x54(%rbp)
mov    %eax,-0x58(%rbp)
mov    -0x54(%rbp),%ecx
mov    -0x58(%rbp),%r8d
lea    0xc77(%rip),%rdi
lea    0xc97(%rip),%rsi
mov    $0xfffefdfc,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x5c(%rbp)
movl   $0xfbca7654,-0x60(%rbp)
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%edx
mov    $0xfffefdfc,%eax
cmpxchg %cl,%dl
mov    %edx,%eax
mov    %ecx,-0x5c(%rbp)
mov    %eax,-0x60(%rbp)
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
lea    0xc32(%rip),%rdi
lea    0xc5b(%rip),%rsi
mov    $0xfffefdfc,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x64(%rbp)
movl   $0xfbca7654,-0x68(%rbp)
mov    -0x64(%rbp),%ecx
mov    $0xfbca7654,%eax
cmpxchg %ecx,-0x68(%rbp)
mov    %ecx,%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%ecx
mov    -0x68(%rbp),%r8d
lea    0xbf2(%rip),%rdi
lea    0xc09(%rip),%rsi
mov    $0xfbca7654,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x6c(%rbp)
movl   $0xfbca7654,-0x70(%rbp)
mov    -0x6c(%rbp),%ecx
mov    $0xfbca7654,%eax
cmpxchg %cx,-0x70(%rbp)
mov    %ecx,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%r8d
lea    0xbb1(%rip),%rdi
lea    0xbd1(%rip),%rsi
mov    $0xfbca7654,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x74(%rbp)
movl   $0xfbca7654,-0x78(%rbp)
mov    -0x74(%rbp),%ecx
mov    $0xfbca7654,%eax
cmpxchg %cl,-0x78(%rbp)
mov    %ecx,%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%ecx
mov    -0x78(%rbp),%r8d
lea    0xb71(%rip),%rdi
lea    0xb9a(%rip),%rsi
mov    $0xfbca7654,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x7c(%rbp)
movl   $0xfbca7654,-0x80(%rbp)
mov    -0x7c(%rbp),%ecx
mov    $0xfffefdfc,%eax
cmpxchg %ecx,-0x80(%rbp)
mov    %ecx,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%ecx
mov    -0x80(%rbp),%r8d
lea    0xb31(%rip),%rdi
lea    0xb48(%rip),%rsi
mov    $0xfffefdfc,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x84(%rbp)
56 34 12
movl   $0xfbca7654,-0x88(%rbp)
76 ca fb
mov    -0x84(%rbp),%ecx
mov    $0xfffefdfc,%eax
cmpxchg %cx,-0x88(%rbp)
ff
mov    %ecx,%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%ecx
mov    -0x88(%rbp),%r8d
lea    0xadb(%rip),%rdi
lea    0xafb(%rip),%rsi
mov    $0xfffefdfc,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x8c(%rbp)
56 34 12
movl   $0xfbca7654,-0x90(%rbp)
76 ca fb
mov    -0x8c(%rbp),%ecx
mov    $0xfffefdfc,%eax
cmpxchg %cl,-0x90(%rbp)
mov    %ecx,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%ecx
mov    -0x90(%rbp),%r8d
lea    0xa86(%rip),%rdi
lea    0xaaf(%rip),%rsi
mov    $0xfffefdfc,%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xchg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xfbca7654,%r14d
mov    $0x12345678,%edx
mov    $0xfbca7654,%ecx
xchg   %ecx,%edx
lea    0xecc(%rip),%rbx
lea    0xefb(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%edx
mov    $0xfbca7654,%ecx
xchg   %cx,%dx
lea    0xee3(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%edx
mov    $0xfbca7654,%ecx
xchg   %cl,%dl
lea    0xecc(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%edx
xchg   %edx,0x4(%rsp)
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%edx
xchg   %dx,0x4(%rsp)
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%edx
xchg   %dl,0x4(%rsp)
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%ecx
mov    $0xfbca7654,%r8d
mov    $0xfbca7654,%eax
cmpxchg %ecx,%r8d
lea    0xe0a(%rip),%rbx
lea    0xe21(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xfbca7654,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%ecx
mov    $0xfbca7654,%r8d
mov    $0xfbca7654,%eax
cmpxchg %cx,%r8w
lea    0xdfc(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xfbca7654,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%ecx
mov    $0xfbca7654,%r8d
mov    $0xfbca7654,%eax
cmpxchg %cl,%r8b
lea    0xdd8(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xfbca7654,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%ecx
mov    $0xfbca7654,%r8d
mov    $0xfffefdfc,%eax
cmpxchg %ecx,%r8d
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xfffefdfc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%ecx
mov    $0xfbca7654,%r8d
mov    $0xfffefdfc,%eax
cmpxchg %cx,%r8w
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xfffefdfc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12345678,%ecx
mov    $0xfffefdfc,%eax
cmpxchg %cl,%r14b
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xfffefdfc,%edx
mov    %r14d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%ecx
mov    $0xfbca7654,%eax
cmpxchg %ecx,0x4(%rsp)
mov    0x4(%rsp),%r8d
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xfbca7654,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%ecx
mov    $0xfbca7654,%eax
cmpxchg %cx,0x4(%rsp)
mov    0x4(%rsp),%r8d
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xfbca7654,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%ecx
mov    $0xfbca7654,%eax
cmpxchg %cl,0x4(%rsp)
mov    0x4(%rsp),%r8d
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xfbca7654,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%ecx
mov    $0xfffefdfc,%eax
cmpxchg %ecx,0x4(%rsp)
mov    0x4(%rsp),%r8d
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xfffefdfc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0x12345678,%ecx
mov    $0xfffefdfc,%eax
cmpxchg %cx,0x4(%rsp)
mov    0x4(%rsp),%r8d
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xfffefdfc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xfbca7654,0x4(%rsp)
fb
mov    $0xfffefdfc,%eax
mov    $0x12345678,%ecx
cmpxchg %cl,0x4(%rsp)
mov    0x4(%rsp),%r8d
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0xfffefdfc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%-10s A=%08x B=%08x\0A\00"
@.str.1 = [6 x i8] c"xchgl\00"
@.str.2 = [6 x i8] c"xchgw\00"
@.str.3 = [6 x i8] c"xchgb\00"
@.str.4 = [30 x i8] c"%-10s EAX=%08x A=%08x C=%08x\0A\00"
@.str.5 = [9 x i8] c"cmpxchgl\00"
@.str.6 = [9 x i8] c"cmpxchgw\00"
@.str.7 = [9 x i8] c"cmpxchgb\00"
define void @test_xchg() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
store i32 305419896, i32* %1
store i32 -70617516, i32* %2
%37 = load i32, i32* %1
%38 = load i32, i32* %2
%39 = call { i32, i32 } asm "xchgl $0, $1", "=q,=q,0,1,~{dirflag},~{fpsr},~{flags}"(i32 %37, i32 %38)
%40 = extractvalue { i32, i32 } %39, 0
%41 = extractvalue { i32, i32 } %39, 1
store i32 %40, i32* %1
store i32 %41, i32* %2
%42 = load i32, i32* %1
%43 = load i32, i32* %2
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %43)
store i32 305419896, i32* %3
store i32 -70617516, i32* %4
%45 = load i32, i32* %3
%46 = load i32, i32* %4
%47 = call { i32, i32 } asm "xchgw ${0:w}, ${1:w}", "=q,=q,0,1,~{dirflag},~{fpsr},~{flags}"(i32 %45, i32 %46)
%48 = extractvalue { i32, i32 } %47, 0
%49 = extractvalue { i32, i32 } %47, 1
store i32 %48, i32* %3
store i32 %49, i32* %4
%50 = load i32, i32* %3
%51 = load i32, i32* %4
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %50, i32 %51)
store i32 305419896, i32* %5
store i32 -70617516, i32* %6
%53 = load i32, i32* %5
%54 = load i32, i32* %6
%55 = call { i32, i32 } asm "xchgb ${0:b}, ${1:b}", "=q,=q,0,1,~{dirflag},~{fpsr},~{flags}"(i32 %53, i32 %54)
%56 = extractvalue { i32, i32 } %55, 0
%57 = extractvalue { i32, i32 } %55, 1
store i32 %56, i32* %5
store i32 %57, i32* %6
%58 = load i32, i32* %5
%59 = load i32, i32* %6
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %58, i32 %59)
store i32 305419896, i32* %7
store i32 -70617516, i32* %8
%61 = load i32, i32* %7
%62 = call i32 asm "xchgl $0, $1", "=q,=*m,0,*1,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %8, i32 %61, i32* elementtype(i32) %8)
store i32 %62, i32* %7
%63 = load i32, i32* %7
%64 = load i32, i32* %8
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %63, i32 %64)
store i32 305419896, i32* %9
store i32 -70617516, i32* %10
%66 = load i32, i32* %9
%67 = call i32 asm "xchgw ${0:w}, ${1:w}", "=q,=*m,0,*1,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %10, i32 %66, i32* elementtype(i32) %10)
store i32 %67, i32* %9
%68 = load i32, i32* %9
%69 = load i32, i32* %10
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %68, i32 %69)
store i32 305419896, i32* %11
store i32 -70617516, i32* %12
%71 = load i32, i32* %11
%72 = call i32 asm "xchgb ${0:b}, ${1:b}", "=q,=*m,0,*1,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %12, i32 %71, i32* elementtype(i32) %12)
store i32 %72, i32* %11
%73 = load i32, i32* %11
%74 = load i32, i32* %12
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %73, i32 %74)
store i32 305419896, i32* %13
store i32 -70617516, i32* %14
%76 = load i32, i32* %13
%77 = load i32, i32* %14
%78 = call { i32, i32 } asm "cmpxchgl $0, $1", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 %76, i32 %77, i32 -70617516)
%79 = extractvalue { i32, i32 } %78, 0
%80 = extractvalue { i32, i32 } %78, 1
store i32 %79, i32* %13
store i32 %80, i32* %14
%81 = load i32, i32* %13
%82 = load i32, i32* %14
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -70617516, i32 %81, i32 %82)
store i32 305419896, i32* %15
store i32 -70617516, i32* %16
%84 = load i32, i32* %15
%85 = load i32, i32* %16
%86 = call { i32, i32 } asm "cmpxchgw ${0:w}, ${1:w}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 %84, i32 %85, i32 -70617516)
%87 = extractvalue { i32, i32 } %86, 0
%88 = extractvalue { i32, i32 } %86, 1
store i32 %87, i32* %15
store i32 %88, i32* %16
%89 = load i32, i32* %15
%90 = load i32, i32* %16
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -70617516, i32 %89, i32 %90)
store i32 305419896, i32* %17
store i32 -70617516, i32* %18
%92 = load i32, i32* %17
%93 = load i32, i32* %18
%94 = call { i32, i32 } asm "cmpxchgb ${0:b}, ${1:b}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 %92, i32 %93, i32 -70617516)
%95 = extractvalue { i32, i32 } %94, 0
%96 = extractvalue { i32, i32 } %94, 1
store i32 %95, i32* %17
store i32 %96, i32* %18
%97 = load i32, i32* %17
%98 = load i32, i32* %18
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -70617516, i32 %97, i32 %98)
store i32 305419896, i32* %19
store i32 -70617516, i32* %20
%100 = load i32, i32* %19
%101 = load i32, i32* %20
%102 = call { i32, i32 } asm "cmpxchgl $0, $1", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 %100, i32 %101, i32 -66052)
%103 = extractvalue { i32, i32 } %102, 0
%104 = extractvalue { i32, i32 } %102, 1
store i32 %103, i32* %19
store i32 %104, i32* %20
%105 = load i32, i32* %19
%106 = load i32, i32* %20
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -66052, i32 %105, i32 %106)
store i32 305419896, i32* %21
store i32 -70617516, i32* %22
%108 = load i32, i32* %21
%109 = load i32, i32* %22
%110 = call { i32, i32 } asm "cmpxchgw ${0:w}, ${1:w}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 %108, i32 %109, i32 -66052)
%111 = extractvalue { i32, i32 } %110, 0
%112 = extractvalue { i32, i32 } %110, 1
store i32 %111, i32* %21
store i32 %112, i32* %22
%113 = load i32, i32* %21
%114 = load i32, i32* %22
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -66052, i32 %113, i32 %114)
store i32 305419896, i32* %23
store i32 -70617516, i32* %24
%116 = load i32, i32* %23
%117 = load i32, i32* %24
%118 = call { i32, i32 } asm "cmpxchgb ${0:b}, ${1:b}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 %116, i32 %117, i32 -66052)
%119 = extractvalue { i32, i32 } %118, 0
%120 = extractvalue { i32, i32 } %118, 1
store i32 %119, i32* %23
store i32 %120, i32* %24
%121 = load i32, i32* %23
%122 = load i32, i32* %24
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -66052, i32 %121, i32 %122)
store i32 305419896, i32* %25
store i32 -70617516, i32* %26
%124 = load i32, i32* %25
%125 = call i32 asm "cmpxchgl $0, $1", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %26, i32 %124, i32* elementtype(i32) %26, i32 -70617516)
store i32 %125, i32* %25
%126 = load i32, i32* %25
%127 = load i32, i32* %26
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -70617516, i32 %126, i32 %127)
store i32 305419896, i32* %27
store i32 -70617516, i32* %28
%129 = load i32, i32* %27
%130 = call i32 asm "cmpxchgw ${0:w}, ${1:w}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %28, i32 %129, i32* elementtype(i32) %28, i32 -70617516)
store i32 %130, i32* %27
%131 = load i32, i32* %27
%132 = load i32, i32* %28
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -70617516, i32 %131, i32 %132)
store i32 305419896, i32* %29
store i32 -70617516, i32* %30
%134 = load i32, i32* %29
%135 = call i32 asm "cmpxchgb ${0:b}, ${1:b}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %30, i32 %134, i32* elementtype(i32) %30, i32 -70617516)
store i32 %135, i32* %29
%136 = load i32, i32* %29
%137 = load i32, i32* %30
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -70617516, i32 %136, i32 %137)
store i32 305419896, i32* %31
store i32 -70617516, i32* %32
%139 = load i32, i32* %31
%140 = call i32 asm "cmpxchgl $0, $1", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %32, i32 %139, i32* elementtype(i32) %32, i32 -66052)
store i32 %140, i32* %31
%141 = load i32, i32* %31
%142 = load i32, i32* %32
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -66052, i32 %141, i32 %142)
store i32 305419896, i32* %33
store i32 -70617516, i32* %34
%144 = load i32, i32* %33
%145 = call i32 asm "cmpxchgw ${0:w}, ${1:w}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %34, i32 %144, i32* elementtype(i32) %34, i32 -66052)
store i32 %145, i32* %33
%146 = load i32, i32* %33
%147 = load i32, i32* %34
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -66052, i32 %146, i32 %147)
store i32 305419896, i32* %35
store i32 -70617516, i32* %36
%149 = load i32, i32* %35
%150 = call i32 asm "cmpxchgb ${0:b}, ${1:b}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %36, i32 %149, i32* elementtype(i32) %36, i32 -66052)
store i32 %150, i32* %35
%151 = load i32, i32* %35
%152 = load i32, i32* %36
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -66052, i32 %151, i32 %152)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%-10s A=%08x B=%08x\0A\00"
@.str.1 = [6 x i8] c"xchgl\00"
@.str.2 = [6 x i8] c"xchgw\00"
@.str.3 = [6 x i8] c"xchgb\00"
@.str.4 = [30 x i8] c"%-10s EAX=%08x A=%08x C=%08x\0A\00"
@.str.5 = [9 x i8] c"cmpxchgl\00"
@.str.6 = [9 x i8] c"cmpxchgw\00"
@.str.7 = [9 x i8] c"cmpxchgb\00"
define void @test_xchg() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = tail call { i32, i32 } asm "xchgl $0, $1", "=q,=q,0,1,~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516)
%11 = extractvalue { i32, i32 } %10, 0
%12 = extractvalue { i32, i32 } %10, 1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
%14 = tail call { i32, i32 } asm "xchgw ${0:w}, ${1:w}", "=q,=q,0,1,~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516)
%15 = extractvalue { i32, i32 } %14, 0
%16 = extractvalue { i32, i32 } %14, 1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16)
%18 = tail call { i32, i32 } asm "xchgb ${0:b}, ${1:b}", "=q,=q,0,1,~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516)
%19 = extractvalue { i32, i32 } %18, 0
%20 = extractvalue { i32, i32 } %18, 1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %19, i32 %20)
%22 = bitcast i32* %1 to i8*
store i32 -70617516, i32* %1
%23 = call i32 asm "xchgl $0, $1", "=q,=*m,0,*1,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %1, i32 305419896, i32* elementtype(i32) %1)
%24 = load i32, i32* %1
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %24)
%26 = bitcast i32* %2 to i8*
store i32 -70617516, i32* %2
%27 = call i32 asm "xchgw ${0:w}, ${1:w}", "=q,=*m,0,*1,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %2, i32 305419896, i32* elementtype(i32) %2)
%28 = load i32, i32* %2
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %28)
%30 = bitcast i32* %3 to i8*
store i32 -70617516, i32* %3
%31 = call i32 asm "xchgb ${0:b}, ${1:b}", "=q,=*m,0,*1,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32 305419896, i32* elementtype(i32) %3)
%32 = load i32, i32* %3
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %31, i32 %32)
%34 = call { i32, i32 } asm "cmpxchgl $0, $1", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516, i32 -70617516)
%35 = extractvalue { i32, i32 } %34, 0
%36 = extractvalue { i32, i32 } %34, 1
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -70617516, i32 %35, i32 %36)
%38 = call { i32, i32 } asm "cmpxchgw ${0:w}, ${1:w}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516, i32 -70617516)
%39 = extractvalue { i32, i32 } %38, 0
%40 = extractvalue { i32, i32 } %38, 1
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -70617516, i32 %39, i32 %40)
%42 = call { i32, i32 } asm "cmpxchgb ${0:b}, ${1:b}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516, i32 -70617516)
%43 = extractvalue { i32, i32 } %42, 0
%44 = extractvalue { i32, i32 } %42, 1
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -70617516, i32 %43, i32 %44)
%46 = call { i32, i32 } asm "cmpxchgl $0, $1", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516, i32 -66052)
%47 = extractvalue { i32, i32 } %46, 0
%48 = extractvalue { i32, i32 } %46, 1
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -66052, i32 %47, i32 %48)
%50 = call { i32, i32 } asm "cmpxchgw ${0:w}, ${1:w}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516, i32 -66052)
%51 = extractvalue { i32, i32 } %50, 0
%52 = extractvalue { i32, i32 } %50, 1
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -66052, i32 %51, i32 %52)
%54 = call { i32, i32 } asm "cmpxchgb ${0:b}, ${1:b}", "=q,=q,0,1,{ax},~{dirflag},~{fpsr},~{flags}"(i32 305419896, i32 -70617516, i32 -66052)
%55 = extractvalue { i32, i32 } %54, 0
%56 = extractvalue { i32, i32 } %54, 1
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -66052, i32 %55, i32 %56)
%58 = bitcast i32* %4 to i8*
store i32 -70617516, i32* %4
%59 = call i32 asm "cmpxchgl $0, $1", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4, i32 305419896, i32* elementtype(i32) %4, i32 -70617516)
%60 = load i32, i32* %4
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -70617516, i32 %59, i32 %60)
%62 = bitcast i32* %5 to i8*
store i32 -70617516, i32* %5
%63 = call i32 asm "cmpxchgw ${0:w}, ${1:w}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5, i32 305419896, i32* elementtype(i32) %5, i32 -70617516)
%64 = load i32, i32* %5
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -70617516, i32 %63, i32 %64)
%66 = bitcast i32* %6 to i8*
store i32 -70617516, i32* %6
%67 = call i32 asm "cmpxchgb ${0:b}, ${1:b}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %6, i32 305419896, i32* elementtype(i32) %6, i32 -70617516)
%68 = load i32, i32* %6
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -70617516, i32 %67, i32 %68)
%70 = bitcast i32* %7 to i8*
store i32 -70617516, i32* %7
%71 = call i32 asm "cmpxchgl $0, $1", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %7, i32 305419896, i32* elementtype(i32) %7, i32 -66052)
%72 = load i32, i32* %7
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 -66052, i32 %71, i32 %72)
%74 = bitcast i32* %8 to i8*
store i32 -70617516, i32* %8
%75 = call i32 asm "cmpxchgw ${0:w}, ${1:w}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %8, i32 305419896, i32* elementtype(i32) %8, i32 -66052)
%76 = load i32, i32* %8
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 -66052, i32 %75, i32 %76)
%78 = bitcast i32* %9 to i8*
store i32 -70617516, i32* %9
%79 = call i32 asm "cmpxchgb ${0:b}, ${1:b}", "=q,=*m,0,*1,{ax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %9, i32 305419896, i32* elementtype(i32) %9, i32 -66052)
%80 = load i32, i32* %9
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 -66052, i32 %79, i32 %80)
ret void
}