#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 *, ...);
main() {
  int ar, cc;
  float pu;
  printf("Código artículo....... ");
  scanf("%d", &ar);
  printf("Cantidad comprada..... ");
  scanf("%d", &cc);
  printf("Precio unitario....... ");
  scanf("%f", &pu);
  printf("\n\n%10s %10s %10s %10s %10s\n\n", "Artículo", "Cantidad", "P. U.",
         "Dto.", "Total");
  printf("%10d %10d %10.2f", ar, cc, pu);
  if (cc > 100)
    printf(" %9d%% %10.2f\n", 40, cc * pu * 0.6);
  else if (cc >= 25)
    printf(" %9d%% %10.2f\n", 20, cc * pu * 0.8);
  else if (cc >= 10)
    printf(" %9d%% %10.2f\n", 10, cc * pu * 0.9);
  else
    printf(" %10s %10.2f\n", "--", cc * pu);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xeeb(%rip),%rdx
lea    0xeed(%rip),%rcx
lea    0xeec(%rip),%r8
lea    0xeea(%rip),%r9
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0x64,-0xc(%rbp)
jle    1219 <main+0xf9>
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe13(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12be <main+0x19e>
cmpl   $0x19,-0xc(%rbp)
jl     1255 <main+0x135>
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcf(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe76(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12b9 <main+0x199>
cmpl   $0xa,-0xc(%rbp)
jl     1291 <main+0x171>
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8b(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe3a(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12b4 <main+0x194>
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe23(%rip),%rdi
lea    0xe2a(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12b9 <main+0x199>
jmp    12be <main+0x19e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
lea    0xef0(%rip),%rsi
lea    0xef3(%rip),%rdx
lea    0xef5(%rip),%rcx
lea    0xef4(%rip),%r8
lea    0xef2(%rip),%r9
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x8(%rsp),%eax
cmp    $0x65,%eax
jl     1208 <main+0xe8>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe16(%rip),%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x28,%esi
jmp    125e <main+0x13e>
cmp    $0x19,%eax
jl     1234 <main+0x114>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xde2(%rip),%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x14,%esi
jmp    125e <main+0x13e>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
cmp    $0xa,%eax
jl     126d <main+0x14d>
mulsd  0xdae(%rip),%xmm0
lea    0xe61(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe55(%rip),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1265 <main+0x145>

LLVM IR (-O0):
@.str = [26 x i8] c"C\C3\B3digo art\C3\ADculo....... \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Cantidad comprada..... \00"
@.str.3 = [24 x i8] c"Precio unitario....... \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [29 x i8] c"\0A\0A%10s %10s %10s %10s %10s\0A\0A\00"
@.str.6 = [10 x i8] c"Art\C3\ADculo\00"
@.str.7 = [9 x i8] c"Cantidad\00"
@.str.8 = [6 x i8] c"P. U.\00"
@.str.9 = [5 x i8] c"Dto.\00"
@.str.10 = [6 x i8] c"Total\00"
@.str.11 = [17 x i8] c"%10d %10d %10.2f\00"
@.str.12 = [15 x i8] c" %9d%% %10.2f\0A\00"
@.str.13 = [14 x i8] c" %10s %10.2f\0A\00"
@.str.14 = [3 x i8] c"--\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, 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* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load float, float* %4
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %12, i32 %13, double %15)
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 100
br i1 %18, label %19, label %27
19: ; preds = %0
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to float
%22 = load float, float* %4
%23 = fmul float %21, %22
%24 = fpext float %23 to double
%25 = fmul double %24, 6.000000e-01
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 40, double %25)
br label %58
27: ; preds = %0
%28 = load i32, i32* %3
%29 = icmp sge i32 %28, 25
br i1 %29, label %30, label %38
30: ; preds = %27
%31 = load i32, i32* %3
%32 = sitofp i32 %31 to float
%33 = load float, float* %4
%34 = fmul float %32, %33
%35 = fpext float %34 to double
%36 = fmul double %35, 8.000000e-01
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 20, double %36)
br label %57
38: ; preds = %27
%39 = load i32, i32* %3
%40 = icmp sge i32 %39, 10
br i1 %40, label %41, label %49
41: ; preds = %38
%42 = load i32, i32* %3
%43 = sitofp i32 %42 to float
%44 = load float, float* %4
%45 = fmul float %43, %44
%46 = fpext float %45 to double
%47 = fmul double %46, 9.000000e-01
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 10, double %47)
br label %56
49: ; preds = %38
%50 = load i32, i32* %3
%51 = sitofp i32 %50 to float
%52 = load float, float* %4
%53 = fmul float %51, %52
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), double %54)
br label %56
56: ; preds = %49, %41
br label %57
57: ; preds = %56, %30
br label %58
58: ; preds = %57, %19
%59 = load i32, i32* %1
ret i32 %59
}

LLVM IR (-O2):
@.str = [26 x i8] c"C\C3\B3digo art\C3\ADculo....... \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Cantidad comprada..... \00"
@.str.3 = [24 x i8] c"Precio unitario....... \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [29 x i8] c"\0A\0A%10s %10s %10s %10s %10s\0A\0A\00"
@.str.6 = [10 x i8] c"Art\C3\ADculo\00"
@.str.7 = [9 x i8] c"Cantidad\00"
@.str.8 = [6 x i8] c"P. U.\00"
@.str.9 = [5 x i8] c"Dto.\00"
@.str.10 = [6 x i8] c"Total\00"
@.str.11 = [17 x i8] c"%10d %10d %10.2f\00"
@.str.12 = [15 x i8] c" %9d%% %10.2f\0A\00"
@.str.13 = [14 x i8] c" %10s %10.2f\0A\00"
@.str.14 = [3 x i8] c"--\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), i32 %14, i32 %15, double %17)
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 100
br i1 %20, label %21, label %28
21: ; preds = %0
%22 = sitofp i32 %19 to float
%23 = load float, float* %3
%24 = fmul float %23, %22
%25 = fpext float %24 to double
%26 = fmul double %25, 6.000000e-01
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 40, double %26)
br label %48
28: ; preds = %0
%29 = icmp sgt i32 %19, 24
br i1 %29, label %30, label %37
30: ; preds = %28
%31 = sitofp i32 %19 to float
%32 = load float, float* %3
%33 = fmul float %32, %31
%34 = fpext float %33 to double
%35 = fmul double %34, 8.000000e-01
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 20, double %35)
br label %48
37: ; preds = %28
%38 = icmp sgt i32 %19, 9
%39 = sitofp i32 %19 to float
%40 = load float, float* %3
%41 = fmul float %40, %39
%42 = fpext float %41 to double
br i1 %38, label %43, label %46
43: ; preds = %37
%44 = fmul double %42, 9.000000e-01
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 10, double %44)
br label %48
46: ; preds = %37
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), double %42)
br label %48
48: ; preds = %30, %46, %43, %21
ret i32 0
}