#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 */
struct Cell {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ clear_list(struct Cell *);
struct Cell *create_cell();
struct Cell *insert_to_list(struct Cell *, struct Cell *);
int /*<<< orphan*/ print_list(struct Cell *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "RUS");
  struct Cell *cell_list = NULL, *new_cell;
  puts("Введите строки для упорядочивания (пустая строка означает прекращение "
       "ввода)");
  while (1) {
    new_cell = create_cell();
    if (new_cell == NULL) {
      break;
    }
    cell_list = insert_to_list(cell_list, new_cell);
  }
  puts("Печатаем список:");
  print_list(cell_list);
  clear_list(cell_list);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
call   1060 <setlocale@plt>
movq   $0x0,-0x10(%rbp)
lea    0xe71(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1080 <create_cell@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11b3 <main+0x53>
jmp    11c9 <main+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <insert_to_list@plt>
mov    %rax,-0x10(%rbp)
jmp    1198 <main+0x38>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_list@plt>
mov    -0x10(%rbp),%rdi
call   1070 <clear_list@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <create_cell@plt>
test   %rax,%rax
je     11ba <main+0x5a>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <insert_to_list@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1080 <create_cell@plt>
test   %rax,%rax
jne    11a0 <main+0x40>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <print_list@plt>
mov    %rbx,%rdi
call   1070 <clear_list@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Cell = type { i32 }
@LC_ALL = global i32 0
@.str = [4 x i8] c"RUS\00"
@.str.1 = [143 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\81\D1\82\D1\80\D0\BE\D0\BA\D0\B8 \D0\B4\D0\BB\D1\8F \D1\83\D0\BF\D0\BE\D1\80\D1\8F\D0\B4\D0\BE\D1\87\D0\B8\D0\B2\D0\B0\D0\BD\D0\B8\D1\8F (\D0\BF\D1\83\D1\81\D1\82\D0\B0\D1\8F \D1\81\D1\82\D1\80\D0\BE\D0\BA\D0\B0 \D0\BE\D0\B7\D0\BD\D0\B0\D1\87\D0\B0\D0\B5\D1\82 \D0\BF\D1\80\D0\B5\D0\BA\D1\80\D0\B0\D1\89\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B2\D0\B2\D0\BE\D0\B4\D0\B0)\00"
@.str.2 = [31 x i8] c"\D0\9F\D0\B5\D1\87\D0\B0\D1\82\D0\B0\D0\B5\D0\BC \D1\81\D0\BF\D0\B8\D1\81\D0\BE\D0\BA:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Cell*
%3 = alloca %struct.Cell*
store i32 0, i32* %1
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store %struct.Cell* null, %struct.Cell** %2
%6 = call i32 @puts(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %12
%8 = call %struct.Cell* (...) @create_cell()
store %struct.Cell* %8, %struct.Cell** %3
%9 = load %struct.Cell*, %struct.Cell** %3
%10 = icmp eq %struct.Cell* %9, null
br i1 %10, label %11, label %12
11: ; preds = %7
br label %16
12: ; preds = %7
%13 = load %struct.Cell*, %struct.Cell** %2
%14 = load %struct.Cell*, %struct.Cell** %3
%15 = call %struct.Cell* @insert_to_list(%struct.Cell* %13, %struct.Cell* %14)
store %struct.Cell* %15, %struct.Cell** %2
br label %7
16: ; preds = %11
%17 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%18 = load %struct.Cell*, %struct.Cell** %2
%19 = call i32 @print_list(%struct.Cell* %18)
%20 = load %struct.Cell*, %struct.Cell** %2
%21 = call i32 @clear_list(%struct.Cell* %20)
ret i32 0
}

LLVM IR (-O2):
%struct.Cell = type { i32 }
@LC_ALL = global i32 0
@.str = [4 x i8] c"RUS\00"
@.str.1 = [143 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\81\D1\82\D1\80\D0\BE\D0\BA\D0\B8 \D0\B4\D0\BB\D1\8F \D1\83\D0\BF\D0\BE\D1\80\D1\8F\D0\B4\D0\BE\D1\87\D0\B8\D0\B2\D0\B0\D0\BD\D0\B8\D1\8F (\D0\BF\D1\83\D1\81\D1\82\D0\B0\D1\8F \D1\81\D1\82\D1\80\D0\BE\D0\BA\D0\B0 \D0\BE\D0\B7\D0\BD\D0\B0\D1\87\D0\B0\D0\B5\D1\82 \D0\BF\D1\80\D0\B5\D0\BA\D1\80\D0\B0\D1\89\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B2\D0\B2\D0\BE\D0\B4\D0\B0)\00"
@.str.2 = [31 x i8] c"\D0\9F\D0\B5\D1\87\D0\B0\D1\82\D0\B0\D0\B5\D0\BC \D1\81\D0\BF\D0\B8\D1\81\D0\BE\D0\BA:\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call %struct.Cell* (...) @create_cell()
%5 = icmp eq %struct.Cell* %4, null
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi %struct.Cell* [ %10, %6 ], [ %4, %0 ]
%8 = phi %struct.Cell* [ %9, %6 ], [ null, %0 ]
%9 = tail call %struct.Cell* @insert_to_list(%struct.Cell* %8, %struct.Cell* %7)
%10 = tail call %struct.Cell* (...) @create_cell()
%11 = icmp eq %struct.Cell* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %0
%13 = phi %struct.Cell* [ null, %0 ], [ %9, %6 ]
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @print_list(%struct.Cell* %13)
%16 = tail call i32 @clear_list(%struct.Cell* %13)
ret i32 0
}