#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*/ bzero(char *, int);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
char *opt_analiser(char *in) {
  char real[256], temp[256], *rt;
  short int a, value = 0;
  bzero(temp, strlen(in));
  sprintf(temp, "%s", in);
  bzero(real, strlen(real));
  for (a = 0; a < strlen(temp) - 1; a++) {
    switch (temp[a]) {
    case '\t':
      real[a] = '\0';
      break;
    case '#':
      value++;
      real[a] = '\0';
      break;
    default:
      if (!value)
        real[a] = temp[a];
    }
  }
  real[a] = '\0';
  rt = malloc(strlen(real));
  rt = (char *)real;
  return rt;
  free(rt);
}


x86 assembly (clang, -O0):
<opt_analiser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0x21c(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x230(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x230(%rbp),%rdi
mov    %eax,%esi
call   1050 <bzero@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe71(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x228(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x228(%rbp),%rdi
mov    %eax,%esi
call   1050 <bzero@plt>
movw   $0x0,-0x21a(%rbp)
movswl -0x21a(%rbp),%eax
mov    %eax,-0x234(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x234(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12b2 <opt_analiser+0x172>
movswq -0x21a(%rbp),%rax
ff
movsbl -0x210(%rbp,%rax,1),%eax
mov    %eax,-0x238(%rbp)
sub    $0x9,%eax
je     1229 <opt_analiser+0xe9>
jmp    1215 <opt_analiser+0xd5>
mov    -0x238(%rbp),%eax
sub    $0x23,%eax
je     123e <opt_analiser+0xfe>
jmp    1265 <opt_analiser+0x125>
movswq -0x21a(%rbp),%rax
ff
movb   $0x0,-0x110(%rbp,%rax,1)
jmp    1296 <opt_analiser+0x156>
mov    -0x21c(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x21c(%rbp)
movswq -0x21a(%rbp),%rax
ff
movb   $0x0,-0x110(%rbp,%rax,1)
jmp    1296 <opt_analiser+0x156>
cmpw   $0x0,-0x21c(%rbp)
jne    1291 <opt_analiser+0x151>
movswq -0x21a(%rbp),%rax
ff
mov    -0x210(%rbp,%rax,1),%cl
movswq -0x21a(%rbp),%rax
ff
mov    %cl,-0x110(%rbp,%rax,1)
jmp    1296 <opt_analiser+0x156>
jmp    129b <opt_analiser+0x15b>
mov    -0x21a(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x21a(%rbp)
jmp    11c5 <opt_analiser+0x85>
movswq -0x21a(%rbp),%rax
ff
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x218(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x218(%rbp),%rax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_analiser>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x100(%rsp),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <bzero@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <bzero@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jl     11e2 <opt_analiser+0xb2>
xor    %r15d,%r15d
lea    0x100(%rsp),%r14
xor    %ebx,%ebx
jmp    11be <opt_analiser+0x8e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r15d
xor    %eax,%eax
mov    %al,(%rsp,%rbx,1)
add    $0x1,%ebx
movswl %bx,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cmp    %ebp,%eax
jle    11e6 <opt_analiser+0xb6>
movswq %bx,%rbx
movzbl 0x100(%rsp,%rbx,1),%eax
movsbl %al,%ecx
cmp    $0x9,%ecx
je     11a4 <opt_analiser+0x74>
cmp    $0x23,%ecx
je     11a0 <opt_analiser+0x70>
test   %r15w,%r15w
jne    11a9 <opt_analiser+0x79>
xor    %r15d,%r15d
jmp    11a6 <opt_analiser+0x76>
xor    %eax,%eax
jmp    11ea <opt_analiser+0xba>
movswq %bx,%rax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rax
add    $0x208,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @opt_analiser(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = tail call i32 @strlen(i8* %0)
%7 = call i32 @bzero(i8* %5, i32 %6)
%8 = call i8* @strcpy(i8* %5, i8* dereferenceable(1) %0)
%9 = call i32 @strlen(i8* %4)
%10 = call i32 @bzero(i8* %4, i32 %9)
%11 = call i32 @strlen(i8* %5)
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %37
13: ; preds = %1, %28
%14 = phi i16 [ %29, %28 ], [ 0, %1 ]
%15 = phi i16 [ %30, %28 ], [ 0, %1 ]
%16 = sext i16 %15 to i64
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
switch i32 %19, label %22 [
i32 9, label %24
i32 35, label %20
]
20: ; preds = %13
%21 = add i16 %14, 1
br label %24
22: ; preds = %13
%23 = icmp eq i16 %14, 0
br i1 %23, label %24, label %28
24: ; preds = %22, %13, %20
%25 = phi i8 [ 0, %20 ], [ 0, %13 ], [ %18, %22 ]
%26 = phi i16 [ %21, %20 ], [ %14, %13 ], [ 0, %22 ]
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %16
store i8 %25, i8* %27
br label %28
28: ; preds = %24, %22
%29 = phi i16 [ %14, %22 ], [ %26, %24 ]
%30 = add i16 %15, 1
%31 = sext i16 %30 to i32
%32 = call i32 @strlen(i8* %5)
%33 = add nsw i32 %32, -1
%34 = icmp sgt i32 %33, %31
br i1 %34, label %13, label %35
35: ; preds = %28
%36 = sext i16 %30 to i64
br label %37
37: ; preds = %35, %1
%38 = phi i64 [ 0, %1 ], [ %36, %35 ]
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %38
store i8 0, i8* %39
%40 = call i32 @strlen(i8* %4)
ret i8* %4
}