#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*/ printf(char *, char, char, float, float);
void main() {
  char a = 'a', b = 'b';
  float pi = 3.14, x = 9.999;
  printf("before swap a=%c, b=%c, pi=%f, x=%f\n", a, b, pi, x);
  {
    char tmp;
    tmp = a;
    a = b;
    b = tmp;
  };
  {
    float tmp;
    tmp = pi;
    pi = x;
    x = tmp;
  };
  printf("after swap a=%c, b=%c, pi=%f, x=%f\n", a, b, pi, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x61,-0x1(%rbp)
movb   $0x62,-0x2(%rbp)
movss  0xedc(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xeb7(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x1(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x2(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xe8a(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
mov    $0x61,%esi
mov    $0x62,%edx
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x62,%esi
mov    $0x61,%edx
movss  0xeb4(%rip),%xmm0
movss  0xea8(%rip),%xmm1
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"before swap a=%c, b=%c, pi=%f, x=%f\0A\00"
@.str.1 = [36 x i8] c"after swap a=%c, b=%c, pi=%f, x=%f\0A\00"
define void @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca float
%4 = alloca float
%5 = alloca i8
%6 = alloca float
store i8 97, i8* %1
store i8 98, i8* %2
store float 0x40091EB860000000, float* %3
store float 0x4023FF7CE0000000, float* %4
%7 = load i8, i8* %1
%8 = load i8, i8* %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 signext %7, i8 signext %8, float %9, float %10)
%12 = load i8, i8* %1
store i8 %12, i8* %5
%13 = load i8, i8* %2
store i8 %13, i8* %1
%14 = load i8, i8* %5
store i8 %14, i8* %2
%15 = load float, float* %3
store float %15, float* %6
%16 = load float, float* %4
store float %16, float* %3
%17 = load float, float* %6
store float %17, float* %4
%18 = load i8, i8* %1
%19 = load i8, i8* %2
%20 = load float, float* %3
%21 = load float, float* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8 signext %18, i8 signext %19, float %20, float %21)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"before swap a=%c, b=%c, pi=%f, x=%f\0A\00"
@.str.1 = [36 x i8] c"after swap a=%c, b=%c, pi=%f, x=%f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 98, float 0x40091EB860000000, float 0x4023FF7CE0000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8 signext 98, i8 signext 97, float 0x4023FF7CE0000000, float 0x40091EB860000000)
ret void
}