#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 */
typedef int x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char string_int[] = "int";
  char string_dbl[] = "double";
  char rez[10];
  int x = 8;
  int y = 1;
  int z = 2;
  float f = 3.0;
  float g = 1.0;
  float h = 2.0;
  ((x) = (x) + 3);
  printf("after op1 x = %d;\n", x);
  ((x) = (((x) = (x) + 3)) - 10);
  printf("after op2 x = %d;\n", x);
  float B = 5;
  printf("external_value+internal_value=%f;\n", y + B);
  ;
  printf("before swap in float f = %f; g = %f;\n", f, g);
  {
    float Z;
    Z = f;
    f = g;
    g = Z;
  }
  printf("after swap in float f = %f; g = %f;\n", f, g);
  printf("before swap in intf = %d; g = %d;\n", y, z);
  {
    int Z;
    Z = y;
    y = z;
    z = Z;
  }
  printf("after swap in int f = %d; g = %d;\n", y, z);
  char *formatting = "\n%s%s\n\n";
  char *string1 = "string one ";
  char *string2 = "string two ";
  printf(formatting, string1, string2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xef2(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xeed(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xee7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xedf(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x8,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x24(%rbp)
movss  0xeb1(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  0xe8f(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
sub    $0xa,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe44(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
cvtsi2ssl -0x20(%rbp),%xmm0
addss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe6e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe56(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe79(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe77(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
movsd  0xeba(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
movsd  0xeac(%rip),%xmm0
movsd  0xeac(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
movsd  0xe96(%rip),%xmm0
movsd  0xe86(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf32(%rip),%rdi
lea    0xf33(%rip),%rsi
lea    0xf38(%rip),%rdx
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.string_int = [4 x i8] c"int\00"
@__const.main.string_dbl = [7 x i8] c"double\00"
@.str = [19 x i8] c"after op1 x = %d;\0A\00"
@.str.1 = [19 x i8] c"after op2 x = %d;\0A\00"
@.str.2 = [35 x i8] c"external_value+internal_value=%f;\0A\00"
@.str.3 = [38 x i8] c"before swap in float f = %f; g = %f;\0A\00"
@.str.4 = [37 x i8] c"after swap in float f = %f; g = %f;\0A\00"
@.str.5 = [35 x i8] c"before swap in intf = %d; g = %d;\0A\00"
@.str.6 = [35 x i8] c"after swap in int f = %d; g = %d;\0A\00"
@.str.7 = [8 x i8] c"\0A%s%s\0A\0A\00"
@.str.8 = [12 x i8] c"string one \00"
@.str.9 = [12 x i8] c"string two \00"
define void @main() {
%1 = alloca [4 x i8]
%2 = alloca [7 x i8]
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = bitcast [4 x i8]* %1 to i8*
%17 = bitcast [7 x i8]* %2 to i8*
store i32 8, i32* %4
store i32 1, i32* %5
store i32 2, i32* %6
store float 3.000000e+00, float* %7
store float 1.000000e+00, float* %8
store float 2.000000e+00, float* %9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 3
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 3
store i32 %23, i32* %4
%24 = sub nsw i32 %23, 10
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %25)
store float 5.000000e+00, float* %10
%27 = load i32, i32* %5
%28 = sitofp i32 %27 to float
%29 = load float, float* %10
%30 = fadd float %28, %29
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double %31)
%33 = load float, float* %7
%34 = fpext float %33 to double
%35 = load float, float* %8
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %34, double %36)
%38 = load float, float* %7
store float %38, float* %11
%39 = load float, float* %8
store float %39, float* %7
%40 = load float, float* %11
store float %40, float* %8
%41 = load float, float* %7
%42 = fpext float %41 to double
%43 = load float, float* %8
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double %42, double %44)
%46 = load i32, i32* %5
%47 = load i32, i32* %6
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 %46, i32 %47)
%49 = load i32, i32* %5
store i32 %49, i32* %12
%50 = load i32, i32* %6
store i32 %50, i32* %5
%51 = load i32, i32* %12
store i32 %51, i32* %6
%52 = load i32, i32* %5
%53 = load i32, i32* %6
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %52, i32 %53)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %13
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8** %15
%55 = load i8*, i8** %13
%56 = load i8*, i8** %14
%57 = load i8*, i8** %15
%58 = call i32 (i8*, ...) @printf(i8* %55, i8* %56, i8* %57)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"after op1 x = %d;\0A\00"
@.str.1 = [19 x i8] c"after op2 x = %d;\0A\00"
@.str.2 = [35 x i8] c"external_value+internal_value=%f;\0A\00"
@.str.3 = [38 x i8] c"before swap in float f = %f; g = %f;\0A\00"
@.str.4 = [37 x i8] c"after swap in float f = %f; g = %f;\0A\00"
@.str.5 = [35 x i8] c"before swap in intf = %d; g = %d;\0A\00"
@.str.6 = [35 x i8] c"after swap in int f = %d; g = %d;\0A\00"
@.str.7 = [8 x i8] c"\0A%s%s\0A\0A\00"
@.str.8 = [12 x i8] c"string one \00"
@.str.9 = [12 x i8] c"string two \00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double 6.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double 3.000000e+00, double 1.000000e+00)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double 1.000000e+00, double 3.000000e+00)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 2)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 2, i32 1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
ret void
}