main() {
  int codeState;
  int codeLoad;
  int pricePerWeight;
  int percentPerCode;
  float weight;
  float priceAmountLoad;
  float priceTax;
  printf("Please, insert the code of state origin \n");
  scanf("%d", &codeState);
  if (codeState == 1) {
    percentPerCode = 35;
  } else if (codeState == 2) {
    percentPerCode = 25;
  } else if (codeState == 3) {
    percentPerCode = 15;
  } else if (codeState == 4) {
    percentPerCode = 5;
  } else if (codeState == 5) {
    percentPerCode = 0;
  } else {
    printf("Error: The code of state is 1 to 5. \n");
    exit(-2);
  }
  printf("Please, insert the weight \n");
  scanf("%f", &weight);
  weight = (weight) * (1000);
  printf("Please, insert the code of the load (T) \n");
  scanf("%d", &codeLoad);
  if (codeLoad >= 10 && codeLoad <= 20) {
    pricePerWeight = 100;
  } else if (codeLoad >= 21 && codeLoad <= 30) {
    pricePerWeight = 250;
  } else if (codeLoad >= 31 && codeLoad <= 40) {
    pricePerWeight = 340;
  } else {
    printf("Error: The code of load is 10 to 40");
    exit(-2);
  }
  printf("The weight of the load: %f \n", weight);
  priceAmountLoad = (weight)*pricePerWeight;
  printf("The price per kilo is equal: R$ %f. \n", priceAmountLoad);
  if (percentPerCode != 0) {
    priceTax = ((priceAmountLoad) / (percentPerCode)*100);
    printf("The price of tax to load is equal %f per cent. \n", priceTax);
  } else {
    printf("Your to isent of the price tax. \n");
  }
  priceAmountLoad = priceAmountLoad + priceTax;
  printf("The price of the tax plus with the price of load: %f. \n",
         priceAmountLoad);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1175 <main+0x45>
movl   $0x23,-0x14(%rbp)
jmp    11f9 <main+0xc9>
cmpl   $0x2,-0x8(%rbp)
jne    118b <main+0x5b>
movl   $0x19,-0x14(%rbp)
jmp    11f4 <main+0xc4>
cmpl   $0x3,-0x8(%rbp)
jne    11a1 <main+0x71>
movl   $0xf,-0x14(%rbp)
jmp    11ef <main+0xbf>
cmpl   $0x4,-0x8(%rbp)
jne    11b7 <main+0x87>
movl   $0x5,-0x14(%rbp)
jmp    11ea <main+0xba>
cmpl   $0x5,-0x8(%rbp)
jne    11cd <main+0x9d>
movl   $0x0,-0x14(%rbp)
jmp    11e5 <main+0xb5>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
jmp    11ea <main+0xba>
jmp    11ef <main+0xbf>
jmp    11f4 <main+0xc4>
jmp    11f9 <main+0xc9>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  0xddf(%rip),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0xa,-0xc(%rbp)
jl     126b <main+0x13b>
cmpl   $0x14,-0xc(%rbp)
jg     126b <main+0x13b>
movl   $0x64,-0x10(%rbp)
jmp    12cd <main+0x19d>
cmpl   $0x15,-0xc(%rbp)
jl     128b <main+0x15b>
cmpl   $0x1e,-0xc(%rbp)
jg     128b <main+0x15b>
movl   $0xfa,-0x10(%rbp)
jmp    12c8 <main+0x198>
cmpl   $0x1f,-0xc(%rbp)
jl     12ab <main+0x17b>
cmpl   $0x28,-0xc(%rbp)
jg     12ab <main+0x17b>
movl   $0x154,-0x10(%rbp)
jmp    12c3 <main+0x193>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
jmp    12c8 <main+0x198>
jmp    12cd <main+0x19d>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdeb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdde(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1353 <main+0x223>
movss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xcd6(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1361 <main+0x231>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdde(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xfbe(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
xor    %ebx,%ebx
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x1c(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1309 <main+0x1c9>
movss  0xe82(%rip),%xmm0
lea    0xe9b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  0xe76(%rip),%xmm0
jmp    11aa <main+0x6a>
movss  0xe68(%rip),%xmm0
jmp    11aa <main+0x6a>
movss  0xe5a(%rip),%xmm0
xor    %ebx,%ebx
jmp    11b3 <main+0x73>
xorps  %xmm0,%xmm0
mov    $0x1,%bl
movss  %xmm0,0x14(%rsp)
lea    0xf98(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6b(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
mulss  0xe2a(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
lea    0xf80(%rip),%rdi
call   1030 <puts@plt>
lea    0xe35(%rip),%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x18(%rsp),%eax
lea    -0xa(%rax),%ecx
cmp    $0xb,%ecx
jae    1221 <main+0xe1>
movss  0xdf5(%rip),%xmm0
jmp    1247 <main+0x107>
lea    -0x15(%rax),%ecx
cmp    $0xa,%ecx
jae    1233 <main+0xf3>
movss  0xde7(%rip),%xmm0
jmp    1247 <main+0x107>
add    $0xffffffe1,%eax
cmp    $0xa,%eax
jae    12f1 <main+0x1b1>
movss  0xdd5(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe00(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xdf9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
test   %bl,%bl
je     129b <main+0x15b>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
jmp    12cd <main+0x18d>
movss  0xc(%rsp),%xmm0
divss  0x14(%rsp),%xmm0
mulss  0xd65(%rip),%xmm0
movss  %xmm0,0x14(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xde1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret
lea    0xd42(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>
lea    0xe23(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Please, insert the code of state origin \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Error: The code of state is 1 to 5. \0A\00"
@.str.3 = [28 x i8] c"Please, insert the weight \0A\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [42 x i8] c"Please, insert the code of the load (T) \0A\00"
@.str.6 = [36 x i8] c"Error: The code of load is 10 to 40\00"
@.str.7 = [29 x i8] c"The weight of the load: %f \0A\00"
@.str.8 = [38 x i8] c"The price per kilo is equal: R$ %f. \0A\00"
@.str.9 = [49 x i8] c"The price of tax to load is equal %f per cent. \0A\00"
@.str.10 = [34 x i8] c"Your to isent of the price tax. \0A\00"
@.str.11 = [56 x i8] c"The price of the tax plus with the price of load: %f. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 35, i32* %5
br label %36
14: ; preds = %0
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 25, i32* %5
br label %35
18: ; preds = %14
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 15, i32* %5
br label %34
22: ; preds = %18
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 4
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 5, i32* %5
br label %33
26: ; preds = %22
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 5
br i1 %28, label %29, label %30
29: ; preds = %26
store i32 0, i32* %5
br label %32
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
unreachable
32: ; preds = %29
br label %33
33: ; preds = %32, %25
br label %34
34: ; preds = %33, %21
br label %35
35: ; preds = %34, %17
br label %36
36: ; preds = %35, %13
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %6)
%39 = load float, float* %6
%40 = fmul float %39, 1.000000e+03
store float %40, float* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%43 = load i32, i32* %3
%44 = icmp sge i32 %43, 10
br i1 %44, label %45, label %49
45: ; preds = %36
%46 = load i32, i32* %3
%47 = icmp sle i32 %46, 20
br i1 %47, label %48, label %49
48: ; preds = %45
store i32 100, i32* %4
br label %67
49: ; preds = %45, %36
%50 = load i32, i32* %3
%51 = icmp sge i32 %50, 21
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = load i32, i32* %3
%54 = icmp sle i32 %53, 30
br i1 %54, label %55, label %56
55: ; preds = %52
store i32 250, i32* %4
br label %66
56: ; preds = %52, %49
%57 = load i32, i32* %3
%58 = icmp sge i32 %57, 31
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = load i32, i32* %3
%61 = icmp sle i32 %60, 40
br i1 %61, label %62, label %63
62: ; preds = %59
store i32 340, i32* %4
br label %65
63: ; preds = %59, %56
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
unreachable
65: ; preds = %62
br label %66
66: ; preds = %65, %55
br label %67
67: ; preds = %66, %48
%68 = load float, float* %6
%69 = fpext float %68 to double
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), double %69)
%71 = load float, float* %6
%72 = load i32, i32* %4
%73 = sitofp i32 %72 to float
%74 = fmul float %71, %73
store float %74, float* %7
%75 = load float, float* %7
%76 = fpext float %75 to double
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), double %76)
%78 = load i32, i32* %5
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %89
80: ; preds = %67
%81 = load float, float* %7
%82 = load i32, i32* %5
%83 = sitofp i32 %82 to float
%84 = fdiv float %81, %83
%85 = fmul float %84, 1.000000e+02
store float %85, float* %8
%86 = load float, float* %8
%87 = fpext float %86 to double
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), double %87)
br label %91
89: ; preds = %67
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0))
br label %91
91: ; preds = %89, %80
%92 = load float, float* %7
%93 = load float, float* %8
%94 = fadd float %92, %93
store float %94, float* %7
%95 = load float, float* %7
%96 = fpext float %95 to double
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), double %96)
%98 = load i32, i32* %1
ret i32 %98
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.6 = [36 x i8] c"Error: The code of load is 10 to 40\00"
@.str.7 = [29 x i8] c"The weight of the load: %f \0A\00"
@.str.8 = [38 x i8] c"The price per kilo is equal: R$ %f. \0A\00"
@.str.9 = [49 x i8] c"The price of tax to load is equal %f per cent. \0A\00"
@.str.11 = [56 x i8] c"The price of the tax plus with the price of load: %f. \0A\00"
@str = [41 x i8] c"Please, insert the code of state origin \00"
@str.12 = [37 x i8] c"Error: The code of state is 1 to 5. \00"
@str.13 = [27 x i8] c"Please, insert the weight \00"
@str.14 = [41 x i8] c"Please, insert the code of the load (T) \00"
@str.15 = [33 x i8] c"Your to isent of the price tax. \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
switch i32 %9, label %14 [
i32 1, label %16
i32 2, label %10
i32 3, label %11
i32 4, label %12
i32 5, label %13
]
10: ; preds = %0
br label %16
11: ; preds = %0
br label %16
12: ; preds = %0
br label %16
13: ; preds = %0
br label %16
14: ; preds = %0
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
unreachable
16: ; preds = %0, %10, %12, %13, %11
%17 = phi i1 [ false, %10 ], [ false, %12 ], [ true, %13 ], [ false, %11 ], [ false, %0 ]
%18 = phi float [ 2.500000e+01, %10 ], [ 5.000000e+00, %12 ], [ 0.000000e+00, %13 ], [ 1.500000e+01, %11 ], [ 3.500000e+01, %0 ]
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.13, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%21 = load float, float* %3
%22 = fmul float %21, 1.000000e+03
store float %22, float* %3
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.14, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%25 = load i32, i32* %2
%26 = add i32 %25, -10
%27 = icmp ult i32 %26, 11
br i1 %27, label %36, label %28
28: ; preds = %16
%29 = add i32 %25, -21
%30 = icmp ult i32 %29, 10
br i1 %30, label %36, label %31
31: ; preds = %28
%32 = add i32 %25, -31
%33 = icmp ult i32 %32, 10
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
unreachable
36: ; preds = %31, %28, %16
%37 = phi float [ 1.000000e+02, %16 ], [ 2.500000e+02, %28 ], [ 3.400000e+02, %31 ]
%38 = load float, float* %3
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), double %39)
%41 = load float, float* %3
%42 = fmul float %37, %41
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.8, i64 0, i64 0), double %43)
br i1 %17, label %50, label %45
45: ; preds = %36
%46 = fdiv float %42, %18
%47 = fmul float %46, 1.000000e+02
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), double %48)
br label %52
50: ; preds = %36
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.15, i64 0, i64 0))
br label %52
52: ; preds = %50, %45
%53 = phi float [ %47, %45 ], [ undef, %50 ]
%54 = fadd float %42, %53
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), double %55)
ret i32 0
}