#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 CList {
  int dummy;
};

/* Variables and functions */
struct CList *bitSort(struct CList *);
int /*<<< orphan*/ check(struct CList *);
int /*<<< orphan*/ clear(struct CList *);
struct CList *init(int);
int /*<<< orphan*/ print(struct CList *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct CList *head;
  head = init(100);
  printf("Масивът преди сортирането:\n");
  print(head);
  head = bitSort(head);
  printf("Масивът след сортирането:\n");
  print(head);
  check(head);
  clear(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <init@plt>
mov    %rax,-0x10(%rbp)
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print@plt>
mov    -0x10(%rbp),%rdi
call   1060 <bitSort@plt>
mov    %rax,-0x10(%rbp)
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print@plt>
mov    -0x10(%rbp),%rdi
call   1070 <check@plt>
mov    -0x10(%rbp),%rdi
call   1080 <clear@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <init@plt>
mov    %rax,%rbx
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1060 <bitSort@plt>
mov    %rax,%rbx
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1070 <check@plt>
mov    %rbx,%rdi
call   1080 <clear@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.CList = type { i32 }
@.str = [51 x i8] c"\D0\9C\D0\B0\D1\81\D0\B8\D0\B2\D1\8A\D1\82 \D0\BF\D1\80\D0\B5\D0\B4\D0\B8 \D1\81\D0\BE\D1\80\D1\82\D0\B8\D1\80\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\0A\00"
@.str.1 = [49 x i8] c"\D0\9C\D0\B0\D1\81\D0\B8\D0\B2\D1\8A\D1\82 \D1\81\D0\BB\D0\B5\D0\B4 \D1\81\D0\BE\D1\80\D1\82\D0\B8\D1\80\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.CList*
store i32 0, i32* %1
%3 = call %struct.CList* @init(i32 100)
store %struct.CList* %3, %struct.CList** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.CList*, %struct.CList** %2
%6 = call i32 @print(%struct.CList* %5)
%7 = load %struct.CList*, %struct.CList** %2
%8 = call %struct.CList* @bitSort(%struct.CList* %7)
store %struct.CList* %8, %struct.CList** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%10 = load %struct.CList*, %struct.CList** %2
%11 = call i32 @print(%struct.CList* %10)
%12 = load %struct.CList*, %struct.CList** %2
%13 = call i32 @check(%struct.CList* %12)
%14 = load %struct.CList*, %struct.CList** %2
%15 = call i32 @clear(%struct.CList* %14)
ret i32 0
}

LLVM IR (-O2):
%struct.CList = type { i32 }
@str = [50 x i8] c"\D0\9C\D0\B0\D1\81\D0\B8\D0\B2\D1\8A\D1\82 \D0\BF\D1\80\D0\B5\D0\B4\D0\B8 \D1\81\D0\BE\D1\80\D1\82\D0\B8\D1\80\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\00"
@str.2 = [48 x i8] c"\D0\9C\D0\B0\D1\81\D0\B8\D0\B2\D1\8A\D1\82 \D1\81\D0\BB\D0\B5\D0\B4 \D1\81\D0\BE\D1\80\D1\82\D0\B8\D1\80\D0\B0\D0\BD\D0\B5\D1\82\D0\BE:\00"
define i32 @main() {
%1 = tail call %struct.CList* @init(i32 100)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @print(%struct.CList* %1)
%4 = tail call %struct.CList* @bitSort(%struct.CList* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @print(%struct.CList* %4)
%7 = tail call i32 @check(%struct.CList* %4)
%8 = tail call i32 @clear(%struct.CList* %4)
ret i32 0
}