#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*/ fgets(char *, int, int /*<<< orphan*/);
char find_max_Sym(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char const *argv[]) {
  char string[256];
  printf("Input test string: ");
  fgets(string, 256, stdin);
  char sym = find_max_Sym(string);
  for (int i = 0; i < 256; i++) {
    if (string[i] == sym) {
      string[i] = '*';
    }
  }
  printf("Result: %s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1050 <fgets@plt>
lea    -0x110(%rbp),%rdi
call   1030 <find_max_Sym@plt>
mov    %al,-0x111(%rbp)
movl   $0x0,-0x118(%rbp)
cmpl   $0x100,-0x118(%rbp)
jge    11e3 <main+0xb3>
movslq -0x118(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
movsbl -0x111(%rbp),%ecx
cmp    %ecx,%eax
jne    11ca <main+0x9a>
movslq -0x118(%rbp),%rax
movb   $0x2a,-0x110(%rbp,%rax,1)
2a
jmp    11cf <main+0x9f>
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    118d <main+0x5d>
lea    -0x110(%rbp),%rsi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
lea    0xebf(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1050 <fgets@plt>
mov    %r14,%rdi
call   1030 <find_max_Sym@plt>
movzbl %al,%eax
movd   %eax,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
jmp    1191 <main+0x61>
nopl   (%rax)
add    $0x10,%rbx
cmp    $0x100,%rbx
je     12ce <main+0x19e>
movq   (%rsp,%rbx,1),%xmm1
pcmpeqb %xmm0,%xmm1
movd   %xmm1,%eax
test   $0x1,%al
je     11a6 <main+0x76>
movb   $0x2a,(%rsp,%rbx,1)
movdqa %xmm1,%xmm2
pslld  $0x8,%xmm2
movd   %xmm2,%eax
shr    $0x10,%eax
test   $0x1,%al
je     11bf <main+0x8f>
movb   $0x2a,0x1(%rsp,%rbx,1)
pextrw $0x1,%xmm1,%eax
test   $0x1,%al
je     11cd <main+0x9d>
movb   $0x2a,0x2(%rsp,%rbx,1)
movdqa %xmm1,%xmm2
psllq  $0x18,%xmm2
pextrw $0x3,%xmm2,%eax
test   $0x1,%al
je     11e4 <main+0xb4>
movb   $0x2a,0x3(%rsp,%rbx,1)
pextrw $0x2,%xmm1,%eax
test   $0x1,%al
je     11f2 <main+0xc2>
movb   $0x2a,0x4(%rsp,%rbx,1)
movdqa %xmm1,%xmm2
pslldq $0x5,%xmm2
pextrw $0x5,%xmm2,%eax
test   $0x1,%al
je     1209 <main+0xd9>
movb   $0x2a,0x5(%rsp,%rbx,1)
pextrw $0x3,%xmm1,%eax
test   $0x1,%al
je     1217 <main+0xe7>
movb   $0x2a,0x6(%rsp,%rbx,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%eax
test   $0x1,%al
je     122a <main+0xfa>
movb   $0x2a,0x7(%rsp,%rbx,1)
movq   0x8(%rsp,%rbx,1),%xmm1
pcmpeqb %xmm0,%xmm1
movd   %xmm1,%eax
test   $0x1,%al
je     1241 <main+0x111>
movb   $0x2a,0x8(%rsp,%rbx,1)
movdqa %xmm1,%xmm2
pslld  $0x8,%xmm2
movd   %xmm2,%eax
shr    $0x10,%eax
test   $0x1,%al
je     125a <main+0x12a>
movb   $0x2a,0x9(%rsp,%rbx,1)
pextrw $0x1,%xmm1,%eax
test   $0x1,%al
je     1268 <main+0x138>
movb   $0x2a,0xa(%rsp,%rbx,1)
movdqa %xmm1,%xmm2
psllq  $0x18,%xmm2
pextrw $0x3,%xmm2,%eax
test   $0x1,%al
je     127f <main+0x14f>
movb   $0x2a,0xb(%rsp,%rbx,1)
pextrw $0x2,%xmm1,%eax
test   $0x1,%al
je     128d <main+0x15d>
movb   $0x2a,0xc(%rsp,%rbx,1)
movdqa %xmm1,%xmm2
pslldq $0x5,%xmm2
pextrw $0x5,%xmm2,%eax
test   $0x1,%al
je     12a4 <main+0x174>
movb   $0x2a,0xd(%rsp,%rbx,1)
pextrw $0x3,%xmm1,%eax
test   $0x1,%al
je     12b2 <main+0x182>
movb   $0x2a,0xe(%rsp,%rbx,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%eax
test   $0x1,%al
je     1180 <main+0x50>
movb   $0x2a,0xf(%rsp,%rbx,1)
jmp    1180 <main+0x50>
lea    0xd3f(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Input test string: \00"
@stdin = global i32 0
@.str.1 = [12 x i8] c"Result: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca i8
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 256, i32 %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%14 = call signext i8 @find_max_Sym(i8* %13)
store i8 %14, i8* %7
store i32 0, i32* %8
br label %15
15: ; preds = %32, %2
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 256
br i1 %17, label %18, label %35
18: ; preds = %15
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i8, i8* %7
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %23, %25
br i1 %26, label %27, label %31
27: ; preds = %18
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %29
store i8 42, i8* %30
br label %31
31: ; preds = %27, %18
br label %32
32: ; preds = %31
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %15
35: ; preds = %15
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Input test string: \00"
@stdin = global i32 0
@.str.1 = [12 x i8] c"Result: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 256, i32 %6)
%8 = call signext i8 @find_max_Sym(i8* %4)
%9 = insertelement <8 x i8> poison, i8 %8, i64 0
%10 = shufflevector <8 x i8> %9, <8 x i8> poison, <8 x i32> zeroinitializer
%11 = insertelement <8 x i8> poison, i8 %8, i64 0
%12 = shufflevector <8 x i8> %11, <8 x i8> poison, <8 x i32> zeroinitializer
br label %13
13: ; preds = %101, %2
%14 = phi i64 [ 0, %2 ], [ %102, %101 ]
%15 = or i64 %14, 8
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %14
%17 = bitcast i8* %16 to <8 x i8>*
%18 = load <8 x i8>, <8 x i8>* %17
%19 = getelementptr inbounds i8, i8* %16, i64 8
%20 = bitcast i8* %19 to <8 x i8>*
%21 = load <8 x i8>, <8 x i8>* %20
%22 = icmp eq <8 x i8> %18, %10
%23 = icmp eq <8 x i8> %21, %12
%24 = extractelement <8 x i1> %22, i64 0
br i1 %24, label %25, label %27
25: ; preds = %13
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %14
store i8 42, i8* %26
br label %27
27: ; preds = %25, %13
%28 = extractelement <8 x i1> %22, i64 1
br i1 %28, label %29, label %32
29: ; preds = %27
%30 = or i64 %14, 1
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %30
store i8 42, i8* %31
br label %32
32: ; preds = %29, %27
%33 = extractelement <8 x i1> %22, i64 2
br i1 %33, label %34, label %37
34: ; preds = %32
%35 = or i64 %14, 2
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %35
store i8 42, i8* %36
br label %37
37: ; preds = %34, %32
%38 = extractelement <8 x i1> %22, i64 3
br i1 %38, label %39, label %42
39: ; preds = %37
%40 = or i64 %14, 3
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %40
store i8 42, i8* %41
br label %42
42: ; preds = %39, %37
%43 = extractelement <8 x i1> %22, i64 4
br i1 %43, label %44, label %47
44: ; preds = %42
%45 = or i64 %14, 4
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %45
store i8 42, i8* %46
br label %47
47: ; preds = %44, %42
%48 = extractelement <8 x i1> %22, i64 5
br i1 %48, label %49, label %52
49: ; preds = %47
%50 = or i64 %14, 5
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %50
store i8 42, i8* %51
br label %52
52: ; preds = %49, %47
%53 = extractelement <8 x i1> %22, i64 6
br i1 %53, label %54, label %57
54: ; preds = %52
%55 = or i64 %14, 6
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %55
store i8 42, i8* %56
br label %57
57: ; preds = %54, %52
%58 = extractelement <8 x i1> %22, i64 7
br i1 %58, label %59, label %62
59: ; preds = %57
%60 = or i64 %14, 7
%61 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %60
store i8 42, i8* %61
br label %62
62: ; preds = %59, %57
%63 = extractelement <8 x i1> %23, i64 0
br i1 %63, label %64, label %66
64: ; preds = %62
%65 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %15
store i8 42, i8* %65
br label %66
66: ; preds = %64, %62
%67 = extractelement <8 x i1> %23, i64 1
br i1 %67, label %68, label %71
68: ; preds = %66
%69 = or i64 %14, 9
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %69
store i8 42, i8* %70
br label %71
71: ; preds = %68, %66
%72 = extractelement <8 x i1> %23, i64 2
br i1 %72, label %73, label %76
73: ; preds = %71
%74 = or i64 %14, 10
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %74
store i8 42, i8* %75
br label %76
76: ; preds = %73, %71
%77 = extractelement <8 x i1> %23, i64 3
br i1 %77, label %78, label %81
78: ; preds = %76
%79 = or i64 %14, 11
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %79
store i8 42, i8* %80
br label %81
81: ; preds = %78, %76
%82 = extractelement <8 x i1> %23, i64 4
br i1 %82, label %83, label %86
83: ; preds = %81
%84 = or i64 %14, 12
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %84
store i8 42, i8* %85
br label %86
86: ; preds = %83, %81
%87 = extractelement <8 x i1> %23, i64 5
br i1 %87, label %88, label %91
88: ; preds = %86
%89 = or i64 %14, 13
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %89
store i8 42, i8* %90
br label %91
91: ; preds = %88, %86
%92 = extractelement <8 x i1> %23, i64 6
br i1 %92, label %93, label %96
93: ; preds = %91
%94 = or i64 %14, 14
%95 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %94
store i8 42, i8* %95
br label %96
96: ; preds = %93, %91
%97 = extractelement <8 x i1> %23, i64 7
br i1 %97, label %98, label %101
98: ; preds = %96
%99 = or i64 %14, 15
%100 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %99
store i8 42, i8* %100
br label %101
101: ; preds = %98, %96
%102 = add nuw i64 %14, 16
%103 = icmp eq i64 %102, 256
br i1 %103, label %104, label %13
104: ; preds = %101
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}