#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 *, int *);
main() {
  int x, y;
  printf("Вычислите значение выражения y(x)=|5*x-4|\n");
  printf("x=");
  scanf("%d", &x);
  y = 5 * x - 4;
  if (y >= 0)
    printf("y=%d\n", y);
  else
    y = 0 - (y);
  printf("y=%d\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x5,-0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1185 <main+0x65>
mov    -0xc(%rbp),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118d <main+0x6d>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ecx
lea    (%rcx,%rcx,4),%eax
cmp    $0x4,%eax
jl     1184 <main+0x54>
lea    (%rcx,%rcx,4),%ebx
add    $0xfffffffc,%ebx
lea    0xe8d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118b <main+0x5b>
mov    $0x4,%ebx
sub    %eax,%ebx
lea    0xe74(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"\D0\92\D1\8B\D1\87\D0\B8\D1\81\D0\BB\D0\B8\D1\82\D0\B5 \D0\B7\D0\BD\D0\B0\D1\87\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B2\D1\8B\D1\80\D0\B0\D0\B6\D0\B5\D0\BD\D0\B8\D1\8F y(x)=|5*x-4|\0A\00"
@.str.1 = [3 x i8] c"x=\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [6 x i8] c"y=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = mul nsw i32 5, %7
%9 = sub nsw i32 %8, 4
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %13)
br label %18
15: ; preds = %0
%16 = load i32, i32* %3
%17 = sub nsw i32 0, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"x=\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [6 x i8] c"y=%d\0A\00"
@str = [68 x i8] c"\D0\92\D1\8B\D1\87\D0\B8\D1\81\D0\BB\D0\B8\D1\82\D0\B5 \D0\B7\D0\BD\D0\B0\D1\87\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B2\D1\8B\D1\80\D0\B0\D0\B6\D0\B5\D0\BD\D0\B8\D1\8F y(x)=|5*x-4|\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, 5
%8 = add nsw i32 %7, -4
%9 = icmp sgt i32 %7, 3
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %8)
br label %14
12: ; preds = %0
%13 = sub i32 4, %7
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %8, %10 ], [ %13, %12 ]
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %15)
ret i32 0
}