#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 */
scalar_t__ number(char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  int i, k;
  char teste[14], teste1;
  scanf("%s", teste);
  for (i = 1; i < strlen(teste); i++) {
    for (k = 0; k < strlen(teste) - i; k++) {
      if (number(teste[k]) > number(teste[k + 1])) {
        teste1 = teste[k];
        teste[k] = teste[k + 1];
        teste[k + 1] = teste1;
      }
    }
  }
  printf("\n%s", teste);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1060 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x1a(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jge    1230 <main+0xf0>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x1a(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    121d <main+0xdd>
movslq -0xc(%rbp),%rax
movsbl -0x1a(%rbp,%rax,1),%edi
call   1050 <number@plt>
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x1a(%rbp,%rax,1),%edi
call   1050 <number@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
jle    120a <main+0xca>
movslq -0xc(%rbp),%rax
mov    -0x1a(%rbp,%rax,1),%al
mov    %al,-0x1b(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x1a(%rbp,%rax,1),%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x1a(%rbp,%rax,1)
mov    -0x1b(%rbp),%cl
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    %cl,-0x1a(%rbp,%rax,1)
jmp    120f <main+0xcf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1189 <main+0x49>
jmp    1222 <main+0xe2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x26>
lea    -0x1a(%rbp),%rsi
lea    0xdc5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeae(%rip),%rdi
lea    0x2(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     11ed <main+0xad>
mov    $0x1,%r15d
lea    0x2(%rsp),%r14
jmp    1191 <main+0x51>
xchg   %ax,%ax
add    $0x1,%r15d
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %eax,%r15d
jge    11ed <main+0xad>
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %r15d,%eax
jle    1180 <main+0x40>
xor    %ebp,%ebp
jmp    11c5 <main+0x85>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %r15d,%eax
cltq
mov    %rbx,%rbp
cmp    %rax,%rbx
jge    1180 <main+0x40>
movsbl 0x2(%rsp,%rbp,1),%edi
call   1050 <number@plt>
mov    %rax,%r12
lea    0x1(%rbp),%rbx
movsbl 0x3(%rsp,%rbp,1),%edi
call   1050 <number@plt>
cmp    %rax,%r12
jle    11b0 <main+0x70>
rolw   $0x8,0x2(%rsp,%rbp,1)
jmp    11b0 <main+0x70>
lea    0xe0c(%rip),%rdi
lea    0x2(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [14 x i8]
%5 = alloca i8
store i32 0, i32* %1
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 1, i32* %2
br label %8
8: ; preds = %57, %0
%9 = load i32, i32* %2
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %60
13: ; preds = %8
store i32 0, i32* %3
br label %14
14: ; preds = %53, %13
%15 = load i32, i32* %3
%16 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %2
%19 = sub nsw i32 %17, %18
%20 = icmp slt i32 %15, %19
br i1 %20, label %21, label %56
21: ; preds = %14
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = call i64 @number(i8 signext %25)
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = call i64 @number(i8 signext %31)
%33 = icmp sgt i64 %26, %32
br i1 %33, label %34, label %52
34: ; preds = %21
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 %36
%38 = load i8, i8* %37
store i8 %38, i8* %5
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 %45
store i8 %43, i8* %46
%47 = load i8, i8* %5
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 %50
store i8 %47, i8* %51
br label %52
52: ; preds = %34, %21
br label %53
53: ; preds = %52
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %14
56: ; preds = %14
br label %57
57: ; preds = %56
%58 = load i32, i32* %2
%59 = add nsw i32 %58, 1
store i32 %59, i32* %2
br label %8
60: ; preds = %8
%61 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%62 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %61)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %32
6: ; preds = %0, %28
%7 = phi i32 [ %29, %28 ], [ 1, %0 ]
%8 = call i32 @strlen(i8* %2)
%9 = icmp sgt i32 %8, %7
br i1 %9, label %10, label %28
10: ; preds = %6, %23
%11 = phi i64 [ %15, %23 ], [ 0, %6 ]
%12 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = call i64 @number(i8 signext %13)
%15 = add nuw nsw i64 %11, 1
%16 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = call i64 @number(i8 signext %17)
%19 = icmp sgt i64 %14, %18
br i1 %19, label %20, label %23
20: ; preds = %10
%21 = load i8, i8* %12
%22 = load i8, i8* %16
store i8 %22, i8* %12
store i8 %21, i8* %16
br label %23
23: ; preds = %10, %20
%24 = call i32 @strlen(i8* %2)
%25 = sub nsw i32 %24, %7
%26 = sext i32 %25 to i64
%27 = icmp slt i64 %15, %26
br i1 %27, label %10, label %28
28: ; preds = %23, %6
%29 = add nuw nsw i32 %7, 1
%30 = call i32 @strlen(i8* %2)
%31 = icmp slt i32 %29, %30
br i1 %31, label %6, label %32
32: ; preds = %28, %0
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}