#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 *, double, double);
int main() {
  int x, y;
  x = 1;
  y = 2;
  {
    int temp = x;
    x = y;
    y = temp;
  };
  printf("%d, %d\n", x, y);
  double a, b;
  a = 1.2;
  b = -3.9;
  {
    double temp = a;
    a = b;
    b = temp;
  };
  printf("%g, %g\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
@.str.1 = [8 x i8] c"%g, %g\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 2.000000e+00, double 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double -3.900000e+00, double 1.200000e+00)
ret i32 0
}