#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(void) {
  int x, y;
  double dx, dy;
  x = 30;
  y = 45;
  printf("%d, %d\n", x, y);
  do {
    int temp;
    temp = x;
    x = y;
    y = temp;
  } while (0);
  ;
  printf("%d, %d\n", x, y);
  dx = 44.4;
  dy = 33.3;
  printf("%g, %g\n", dx, dy);
  do {
    double temp;
    temp = dx;
    dx = dy;
    dy = temp;
  } while (0);
  ;
  printf("%g, %g\n", dx, dy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
movl   $0x2d,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe80(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf08(%rip),%rbx
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0xecd(%rip),%xmm0
movsd  0xebd(%rip),%xmm1
call   1030 <printf@plt>
lea    0xed9(%rip),%rbx
movsd  0xeb9(%rip),%xmm0
movsd  0xeb9(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0xea6(%rip),%xmm0
movsd  0xe96(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
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 double
%5 = alloca double
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %1
store i32 30, i32* %2
store i32 45, i32* %3
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %9, double %11)
br label %13
13: ; preds = %0
%14 = load i32, i32* %2
store i32 %14, i32* %6
%15 = load i32, i32* %3
store i32 %15, i32* %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %13
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to double
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to double
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %19, double %21)
store double 4.440000e+01, double* %4
store double 3.330000e+01, double* %5
%23 = load double, double* %4
%24 = load double, double* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %23, double %24)
br label %26
26: ; preds = %17
%27 = load double, double* %4
store double %27, double* %7
%28 = load double, double* %5
store double %28, double* %4
%29 = load double, double* %7
store double %29, double* %5
br label %30
30: ; preds = %26
%31 = load double, double* %4
%32 = load double, double* %5
%33 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %31, double %32)
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 3.000000e+01, double 4.500000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 4.500000e+01, double 3.000000e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 4.440000e+01, double 3.330000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 3.330000e+01, double 4.440000e+01)
ret i32 0
}