#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 *, float, float);
int main(void) {
  int a = 1, b = 2;
  float c = 3.0, d = 4.0;
  printf("%d %d\n", a, b);
  printf("%f %f\n", c, d);
  {
    int k;
    k = a;
    a = b;
    b = k;
  }
  {
    float k;
    k = c;
    c = d;
    d = k;
  }
  printf("%d %d\n", a, b);
  printf("%f %f\n", c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xef5(%rip),%r14
movss  0xedd(%rip),%xmm0
movss  0xed9(%rip),%xmm1
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rbx
movss  0xec6(%rip),%xmm0
movss  0xec2(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
movss  0xea7(%rip),%xmm0
movss  0xe9b(%rip),%xmm1
call   1030 <printf@plt>
mov    %rbx,%rdi
movss  0xe97(%rip),%xmm0
movss  0xe8b(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [7 x i8] c"%f %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store float 3.000000e+00, float* %4
store float 4.000000e+00, float* %5
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %9, float %11)
%13 = load float, float* %4
%14 = load float, float* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %13, float %14)
%16 = load i32, i32* %2
store i32 %16, i32* %6
%17 = load i32, i32* %3
store i32 %17, i32* %2
%18 = load i32, i32* %6
store i32 %18, i32* %3
%19 = load float, float* %4
store float %19, float* %7
%20 = load float, float* %5
store float %20, float* %4
%21 = load float, float* %7
store float %21, float* %5
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to float
%24 = load i32, i32* %3
%25 = sitofp i32 %24 to float
%26 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %23, float %25)
%27 = load float, float* %4
%28 = load float, float* %5
%29 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %27, float %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [7 x i8] c"%f %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 1.000000e+00, float 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float 3.000000e+00, float 4.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 2.000000e+00, float 1.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float 4.000000e+00, float 3.000000e+00)
ret i32 0
}