#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 main() {
  char *s = "hello";
  char *t = "world";
  printf("%s %s\n", s, t);
  {
    char *z = s;
    s = t;
    t = z;
  };
  printf("%s %s\n", s, t);
  int n = 10;
  int m = 20;
  printf("%d %d\n", n, m);
  {
    int z = n;
    n = m;
    m = z;
  };
  printf("%d %d\n", n, m);
  float f = 3.14;
  float g = 2.71;
  printf("%.2f %.2f\n", f, g);
  {
    float z = f;
    f = g;
    g = z;
  };
  printf("%.2f %.2f\n", f, g);
  char a = 'a';
  char b = 'b';
  printf("%c %c\n", a, b);
  {
    char z = a;
    a = b;
    b = z;
  };
  printf("%c %c\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x24(%rbp)
movl   $0x14,-0x28(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe3b(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  0xe2a(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x34(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe2e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x34(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdf0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movb   $0x61,-0x39(%rbp)
movb   $0x62,-0x3a(%rbp)
movsbl -0x39(%rbp),%esi
movsbl -0x3a(%rbp),%edx
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x39(%rbp),%al
mov    %al,-0x3b(%rbp)
mov    -0x3a(%rbp),%al
mov    %al,-0x39(%rbp)
mov    -0x3b(%rbp),%al
mov    %al,-0x3a(%rbp)
movsbl -0x39(%rbp),%esi
movsbl -0x3a(%rbp),%edx
lea    0xdb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xf00(%rip),%r15
lea    0xeed(%rip),%r14
lea    0xeec(%rip),%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaa(%rip),%rbx
movsd  0xe78(%rip),%xmm0
movsd  0xe78(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
movsd  0xe63(%rip),%xmm0
movsd  0xe53(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0x62,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x61,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [7 x i8] c"%s %s\0A\00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
@.str.4 = [11 x i8] c"%.2f %.2f\0A\00"
@.str.5 = [7 x i8] c"%c %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %14, i8* %15)
%17 = load i8*, i8** %2
store i8* %17, i8** %4
%18 = load i8*, i8** %3
store i8* %18, i8** %2
%19 = load i8*, i8** %4
store i8* %19, i8** %3
%20 = load i8*, i8** %2
%21 = load i8*, i8** %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %20, i8* %21)
store i32 10, i32* %5
store i32 20, i32* %6
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %23, i32 %24)
%26 = load i32, i32* %5
store i32 %26, i32* %7
%27 = load i32, i32* %6
store i32 %27, i32* %5
%28 = load i32, i32* %7
store i32 %28, i32* %6
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %30)
store float 0x40091EB860000000, float* %8
store float 0x4005AE1480000000, float* %9
%32 = load float, float* %8
%33 = fpext float %32 to double
%34 = load float, float* %9
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %33, double %35)
%37 = load float, float* %8
store float %37, float* %10
%38 = load float, float* %9
store float %38, float* %8
%39 = load float, float* %10
store float %39, float* %9
%40 = load float, float* %8
%41 = fpext float %40 to double
%42 = load float, float* %9
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %41, double %43)
store i8 97, i8* %11
store i8 98, i8* %12
%45 = load i8, i8* %11
%46 = sext i8 %45 to i32
%47 = load i8, i8* %12
%48 = sext i8 %47 to i32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %46, i32 %48)
%50 = load i8, i8* %11
store i8 %50, i8* %13
%51 = load i8, i8* %12
store i8 %51, i8* %11
%52 = load i8, i8* %13
store i8 %52, i8* %12
%53 = load i8, i8* %11
%54 = sext i8 %53 to i32
%55 = load i8, i8* %12
%56 = sext i8 %55 to i32
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %54, i32 %56)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [7 x i8] c"%s %s\0A\00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
@.str.4 = [11 x i8] c"%.2f %.2f\0A\00"
@.str.5 = [7 x i8] c"%c %c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 10, i32 20)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 20, i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double 0x40091EB860000000, double 0x4005AE1480000000)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double 0x4005AE1480000000, double 0x40091EB860000000)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 97, i32 98)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 98, i32 97)
ret i32 0
}