#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 *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int x = 0, y = 0;
  double i = 0.0, j = 0.0;
  printf("请输入两个整数: ");
  scanf("%d%d", &x, &y);
  {
    int _t;
    _t = x;
    x = y;
    y = _t;
  };
  printf("交换之后是: %d, %d\n", x, y);
  printf("请输入两个实数: ");
  scanf("%lf%lf", &i, &j);
  {
    double _t;
    _t = i;
    i = j;
    j = _t;
  };
  printf("交换之后是: %lf, %lf\n", i, j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@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)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@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    0xe6b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%esi
mov    %esi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0xe8b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\A4\E4\B8\AA\E6\95\B4\E6\95\B0: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [25 x i8] c"\E4\BA\A4\E6\8D\A2\E4\B9\8B\E5\90\8E\E6\98\AF: %d, %d\0A\00"
@.str.3 = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\A4\E4\B8\AA\E5\AE\9E\E6\95\B0: \00"
@.str.4 = [7 x i8] c"%lf%lf\00"
@.str.5 = [27 x i8] c"\E4\BA\A4\E6\8D\A2\E4\B9\8B\E5\90\8E\E6\98\AF: %lf, %lf\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 0, i32* %2
store i32 0, i32* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%10 = load i32, i32* %2
store i32 %10, i32* %6
%11 = load i32, i32* %3
store i32 %11, i32* %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double* %4, double* %5)
%18 = load double, double* %4
store double %18, double* %7
%19 = load double, double* %5
store double %19, double* %4
%20 = load double, double* %7
store double %20, double* %5
%21 = load double, double* %4
%22 = load double, double* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %21, double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\A4\E4\B8\AA\E6\95\B4\E6\95\B0: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [25 x i8] c"\E4\BA\A4\E6\8D\A2\E4\B9\8B\E5\90\8E\E6\98\AF: %d, %d\0A\00"
@.str.3 = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\A4\E4\B8\AA\E5\AE\9E\E6\95\B0: \00"
@.str.4 = [7 x i8] c"%lf%lf\00"
@.str.5 = [27 x i8] c"\E4\BA\A4\E6\8D\A2\E4\B9\8B\E5\90\8E\E6\98\AF: %lf, %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%8 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
store i32 %12, i32* %1
store i32 %11, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %11)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double* %3, double* %4)
%16 = load double, double* %3
%17 = load double, double* %4
store double %17, double* %3
store double %16, double* %4
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %17, double %16)
ret i32 0
}