#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__ getIntValueOfCart(char);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char **);
int strlen(char *);
int main() {
  int c, d, len;
  char swap;
  char carts[100];
  scanf("%s", &carts);
  len = strlen(carts);
  for (c = 0; c < (len - 1); c++) {
    for (d = 0; d < len - c - 1; d++) {
      if (getIntValueOfCart(carts[d]) > getIntValueOfCart(carts[d + 1])) {
        swap = carts[d];
        carts[d] = carts[d + 1];
        carts[d + 1] = swap;
      }
    }
  }
  printf("%s", carts);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    122f <main+0xef>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    121c <main+0xdc>
movslq -0xc(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%edi
call   1060 <getIntValueOfCart@plt>
mov    %rax,-0x88(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x80(%rbp,%rax,1),%edi
call   1060 <getIntValueOfCart@plt>
mov    %rax,%rcx
mov    -0x88(%rbp),%rax
cmp    %rcx,%rax
jle    1209 <main+0xc9>
movslq -0xc(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%al
mov    %al,-0x11(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x80(%rbp,%rax,1),%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x11(%rbp),%cl
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    %cl,-0x80(%rbp,%rax,1)
jmp    120e <main+0xce>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118d <main+0x4d>
jmp    1221 <main+0xe1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1175 <main+0x35>
lea    -0x80(%rbp),%rsi
lea    0xdc6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xeab(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     11f0 <main+0xb0>
mov    %eax,%r14d
lea    -0x1(%r14),%eax
xor    %r12d,%r12d
mov    %eax,0xc(%rsp)
mov    %eax,%r13d
jmp    119f <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r12d
add    $0xffffffff,%r13d
cmp    0xc(%rsp),%r12d
je     11f0 <main+0xb0>
mov    %r13d,%r13d
mov    %r12d,%eax
not    %eax
add    %r14d,%eax
test   %eax,%eax
jle    1190 <main+0x50>
xor    %ebp,%ebp
jmp    11c8 <main+0x88>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rbp
cmp    %r15,%r13
je     1190 <main+0x50>
movsbl 0x10(%rsp,%rbp,1),%edi
call   1060 <getIntValueOfCart@plt>
mov    %rax,%rbx
lea    0x1(%rbp),%r15
movsbl 0x11(%rsp,%rbp,1),%edi
call   1060 <getIntValueOfCart@plt>
cmp    %rax,%rbx
jle    11c0 <main+0x80>
rolw   $0x8,0x10(%rsp,%rbp,1)
jmp    11c0 <main+0x80>
lea    0xe09(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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