#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 *);
void lang_out(char text[1000], int len) {
  int i = 0;
  int c = 0;
  for (i = 0; i <= len; ++i) {
    printf("Вы имеете %d элемент%s.\n ", text[i],
           (text[i] % 10 == 1 && text[i] % 100 != 11) ? " "
           : ((text[i] % 100 < 10 || text[i] % 100 > 20) && text[i] % 10 >= 2 &&
              text[i] % 10 <= 4)
               ? "а"
               : "ов");
  };
}


x86 assembly (clang, -O0):
<lang_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1256 <lang_out+0x146>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1198 <lang_out+0x88>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0xb,%edx
je     1198 <lang_out+0x88>
lea    0xe98(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1232 <lang_out+0x122>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0xa,%edx
jl     11d7 <lang_out+0xc7>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x14,%edx
mov    %al,-0x21(%rbp)
jle    1216 <lang_out+0x106>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x2,%edx
mov    %al,-0x21(%rbp)
jl     1216 <lang_out+0x106>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x4,%edx
setle  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%dl
lea    0xe0c(%rip),%rax
lea    0xe02(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x15(%rbp),%al
mov    -0x20(%rbp),%rdx
lea    0xdc0(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <lang_out+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lang_out>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
js     11c7 <lang_out+0xb7>
mov    %esi,%r12d
mov    %rdi,%r14
add    $0x1,%r12d
xor    %ebp,%ebp
lea    0xef1(%rip),%r13
lea    0xec3(%rip),%r15
jmp    1154 <lang_out+0x44>
nop
movsbl %al,%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
je     11c7 <lang_out+0xb7>
movsbl (%r14,%rbp,1),%eax
imul   $0x67,%eax,%ecx
movzwl %cx,%edx
shr    $0xa,%ecx
shr    $0xf,%edx
add    %cl,%dl
movzbl %dl,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%edx
mov    %eax,%ecx
sub    %dl,%cl
lea    (%rax,%rax,4),%edx
lea    (%rax,%rdx,8),%edx
movzwl %dx,%esi
shr    $0xc,%edx
shr    $0xf,%esi
add    %dl,%sil
movzbl %sil,%edx
imul   $0x64,%edx,%edx
mov    %eax,%ebx
sub    %dl,%bl
cmp    $0x1,%cl
jne    119d <lang_out+0x8d>
mov    %r13,%rdx
cmp    $0xb,%bl
jne    1140 <lang_out+0x30>
add    $0xeb,%bl
lea    0xe85(%rip),%rdx
cmp    $0xf4,%bl
ja     1140 <lang_out+0x30>
add    $0xfe,%cl
lea    0xe73(%rip),%rdx
cmp    $0x3,%cl
jb     1140 <lang_out+0x30>
lea    0xe6a(%rip),%rdx
jmp    1140 <lang_out+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\D0\92\D1\8B \D0\B8\D0\BC\D0\B5\D0\B5\D1\82\D0\B5 %d \D1\8D\D0\BB\D0\B5\D0\BC\D0\B5\D0\BD\D1\82%s.\0A \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [3 x i8] c"\D0\B0\00"
@.str.3 = [5 x i8] c"\D0\BE\D0\B2\00"
define void @lang_out(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %78, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %81
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = srem i32 %22, 10
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %35
25: ; preds = %11
%26 = load i8*, i8** %3
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = srem i32 %31, 100
%33 = icmp ne i32 %32, 11
br i1 %33, label %34, label %35
34: ; preds = %25
br label %75
35: ; preds = %25, %11
%36 = load i8*, i8** %3
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = srem i32 %41, 100
%43 = icmp slt i32 %42, 10
br i1 %43, label %53, label %44
44: ; preds = %35
%45 = load i8*, i8** %3
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = srem i32 %50, 100
%52 = icmp sgt i32 %51, 20
br i1 %52, label %53, label %71
53: ; preds = %44, %35
%54 = load i8*, i8** %3
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = srem i32 %59, 10
%61 = icmp sge i32 %60, 2
br i1 %61, label %62, label %71
62: ; preds = %53
%63 = load i8*, i8** %3
%64 = load i32, i32* %5
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %63, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = srem i32 %68, 10
%70 = icmp sle i32 %69, 4
br label %71
71: ; preds = %62, %53, %44
%72 = phi i1 [ false, %53 ], [ false, %44 ], [ %70, %62 ]
%73 = zext i1 %72 to i64
%74 = select i1 %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
br label %75
75: ; preds = %71, %34
%76 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %34 ], [ %74, %71 ]
%77 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 signext %16, i8* %76)
br label %78
78: ; preds = %75
%79 = load i32, i32* %5
%80 = add nsw i32 %79, 1
store i32 %80, i32* %5
br label %7
81: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\D0\92\D1\8B \D0\B8\D0\BC\D0\B5\D0\B5\D1\82\D0\B5 %d \D1\8D\D0\BB\D0\B5\D0\BC\D0\B5\D0\BD\D1\82%s.\0A \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [3 x i8] c"\D0\B0\00"
@.str.3 = [5 x i8] c"\D0\BE\D0\B2\00"
define void @lang_out(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %28, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %23
%8 = phi i64 [ 0, %4 ], [ %26, %23 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = srem i8 %10, 10
%12 = icmp ne i8 %11, 1
%13 = srem i8 %10, 100
%14 = icmp eq i8 %13, 11
%15 = or i1 %12, %14
br i1 %15, label %16, label %23
16: ; preds = %7
%17 = add nsw i8 %13, -21
%18 = icmp ult i8 %17, -11
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = add nsw i8 %11, -2
%21 = icmp ult i8 %20, 3
%22 = select i1 %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
br label %23
23: ; preds = %19, %16, %7
%24 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %16 ], [ %22, %19 ]
%25 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8* %24)
%26 = add nuw nsw i64 %8, 1
%27 = icmp eq i64 %26, %6
br i1 %27, label %28, label %7
28: ; preds = %23, %2
ret void
}