#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 *, char, char);
main() {
  int a, b;
  a = 3;
  b = 6;
  printf("%d, %d\n", a, b);
  {
    int temp = a;
    a = b;
    b = temp;
  };
  printf("%d, %d\n", a, b);
  char c, d;
  c = 'c';
  d = 'd';
  printf("%c, %c\n", c, d);
  {
    char temp = c;
    c = d;
    d = temp;
  };
  printf("%c, %c\n", c, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%eax
lea    0xecb(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%eax
lea    0xe9f(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
movb   $0x63,-0xd(%rbp)
movb   $0x64,-0xe(%rbp)
mov    -0xd(%rbp),%al
lea    0xe8a(%rip),%rdi
movsbl %al,%esi
movsbl -0xe(%rbp),%edx
call   1030 <printf@plt>
mov    -0xd(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0xd(%rbp),%al
lea    0xe62(%rip),%rdi
movsbl %al,%esi
movsbl -0xe(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
lea    0xec5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x63,%esi
mov    $0x64,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x63,%edx
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"%c, %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32 3, i32* %1
store i32 6, i32* %2
%7 = load i32, i32* %1
%8 = trunc i32 %7 to i8
%9 = load i32, i32* %2
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %10)
%12 = load i32, i32* %1
store i32 %12, i32* %3
%13 = load i32, i32* %2
store i32 %13, i32* %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
%15 = load i32, i32* %1
%16 = trunc i32 %15 to i8
%17 = load i32, i32* %2
%18 = trunc i32 %17 to i8
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %16, i8 signext %18)
store i8 99, i8* %4
store i8 100, i8* %5
%20 = load i8, i8* %4
%21 = load i8, i8* %5
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext %20, i8 signext %21)
%23 = load i8, i8* %4
store i8 %23, i8* %6
%24 = load i8, i8* %5
store i8 %24, i8* %4
%25 = load i8, i8* %6
store i8 %25, i8* %5
%26 = load i8, i8* %4
%27 = load i8, i8* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext %26, i8 signext %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
@.str.1 = [8 x i8] c"%c, %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 3, i8 signext 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 6, i8 signext 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext 99, i8 signext 100)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext 100, i8 signext 99)
ret i32 0
}