#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getopt(int, char **, char *);
int /*<<< orphan*/ isprint(int);
scalar_t__ opterr;
size_t optind;
int optopt;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int main(int argc, char *argv[]) {
  int c, suppress_newline = 0;
  char buf[100] = "";
  opterr = 0;
  while ((c = getopt(argc, argv, "bnu")) != -1)
    switch (c) {
    case 'b':
      strcat(buf, "\033[1m");
      break;
    case 'n':
      suppress_newline = 1;
      break;
    case 'u':
      strcat(buf, "\033[4m");
      break;
    case '?':
      if (isprint(optopt))
        fprintf(stderr, "Unknown option `-%c'.\n", optopt);
      else
        fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
      return 1;
    default:
      abort();
    }
  int index;
  for (index = optind; index < argc; index++)
    strcat(buf, argv[optind]);
  strcat(buf, " ");
  strcat(buf, "\033[0m");
  if (!suppress_newline)
    strcat(buf, "\n");
  printf("%s", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
mov    0x2e21(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe44(%rip),%rdx
call   1080 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     12c6 <main+0x156>
mov    -0x14(%rbp),%eax
mov    %eax,-0x88(%rbp)
sub    $0x3f,%eax
je     1256 <main+0xe6>
jmp    11e4 <main+0x74>
mov    -0x88(%rbp),%eax
sub    $0x62,%eax
je     1220 <main+0xb0>
jmp    11f8 <main+0x88>
mov    -0x88(%rbp),%eax
sub    $0x6e,%eax
je     1235 <main+0xc5>
jmp    120c <main+0x9c>
mov    -0x88(%rbp),%eax
sub    $0x75,%eax
je     1241 <main+0xd1>
jmp    12ba <main+0x14a>
lea    -0x80(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1090 <strcat@plt>
jmp    12c1 <main+0x151>
movl   $0x1,-0x18(%rbp)
jmp    12c1 <main+0x151>
lea    -0x80(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1090 <strcat@plt>
jmp    12c1 <main+0x151>
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
call   1070 <isprint@plt>
cmp    $0x0,%eax
je     1290 <main+0x120>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
mov    0x2d6b(%rip),%rax
mov    (%rax),%edx
lea    0xd88(%rip),%rsi
call   1060 <fprintf@plt>
jmp    12ae <main+0x13e>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
mov    0x2d48(%rip),%rax
mov    (%rax),%edx
lea    0xd7c(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1365 <main+0x1f5>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11ae <main+0x3e>
mov    0x2d13(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1314 <main+0x1a4>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x2cec(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rsi
call   1090 <strcat@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    12d6 <main+0x166>
lea    -0x80(%rbp),%rdi
lea    0xd28(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x80(%rbp),%rdi
lea    0xd1a(%rip),%rsi
call   1090 <strcat@plt>
cmpl   $0x0,-0x18(%rbp)
jne    134e <main+0x1de>
lea    -0x80(%rbp),%rdi
lea    0xcda(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x80(%rbp),%rsi
lea    0xcf5(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
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
mov    %rsi,%r12
mov    %edi,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
mov    0x2e25(%rip),%rax
movq   $0x0,(%rax)
mov    $0x1,%al
mov    %eax,0xc(%rsp)
lea    0xe49(%rip),%r14
lea    0xe46(%rip),%r13
lea    0x10(%rsp),%r15
lea    0xe3f(%rip),%rbx
jmp    11e0 <main+0x80>
nopl   0x0(%rax)
mov    %r13,%rsi
cmp    $0x62,%eax
jne    120f <main+0xaf>
mov    %r15,%rdi
call   1080 <strcat@plt>
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1070 <getopt@plt>
cmp    $0x6d,%eax
jle    11d0 <main+0x70>
cmp    $0x75,%eax
jne    11fc <main+0x9c>
mov    %rbx,%rsi
jmp    11d8 <main+0x78>
cmp    $0x6e,%eax
jne    1306 <main+0x1a6>
movl   $0x0,0xc(%rsp)
jmp    11e0 <main+0x80>
cmp    $0xffffffff,%eax
je     124a <main+0xea>
cmp    $0x3f,%eax
jne    1306 <main+0x1a6>
mov    0x2dc4(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1060 <isprint@plt>
mov    0x2d9c(%rip),%rcx
mov    (%rcx),%edi
test   %eax,%eax
je     12e4 <main+0x184>
lea    0xdc9(%rip),%rsi
jmp    12eb <main+0x18b>
mov    0x2d8f(%rip),%r14
mov    (%r14),%rbx
cmp    %ebp,%ebx
jge    1294 <main+0x134>
mov    (%r12,%rbx,8),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcat@plt>
lea    0x1(%rbx),%eax
cmp    %ebp,%eax
je     1294 <main+0x134>
not    %ebx
add    %ebp,%ebx
lea    0x10(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%r12,%rax,8),%rsi
mov    %rbp,%rdi
call   1080 <strcat@plt>
add    $0xffffffff,%ebx
jne    1280 <main+0x120>
lea    0xdac(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <strcat@plt>
lea    0xd9a(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
testb  $0x1,0xc(%rsp)
je     12cf <main+0x16f>
lea    0xd5e(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcat@plt>
lea    0xd78(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
jmp    12f7 <main+0x197>
lea    0xd3a(%rip),%rsi
mov    %ebx,%edx
call   1050 <fprintf@plt>
mov    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@opterr = global i64 0
@.str = [4 x i8] c"bnu\00"
@.str.1 = [5 x i8] c"\1B[1m\00"
@.str.2 = [5 x i8] c"\1B[4m\00"
@optopt = global i32 0
@stderr = global i32 0
@.str.3 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.4 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i64 0
@.str.5 = [2 x i8] c" \00"
@.str.6 = [5 x i8] c"\1B[0m\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [100 x i8]
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%10 = bitcast [100 x i8]* %8 to i8*
store i64 0, i64* @opterr
br label %11
11: ; preds = %40, %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @getopt(i32 %12, i8** %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %6
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %41
16: ; preds = %11
%17 = load i32, i32* %6
switch i32 %17, label %38 [
i32 98, label %18
i32 110, label %21
i32 117, label %22
i32 63, label %25
]
18: ; preds = %16
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %40
21: ; preds = %16
store i32 1, i32* %7
br label %40
22: ; preds = %16
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %40
25: ; preds = %16
%26 = load i32, i32* @optopt
%27 = call i32 @isprint(i32 %26)
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i32, i32* @stderr
%31 = load i32, i32* @optopt
%32 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %31)
br label %37
33: ; preds = %25
%34 = load i32, i32* @stderr
%35 = load i32, i32* @optopt
%36 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %33, %29
store i32 1, i32* %3
br label %71
38: ; preds = %16
%39 = call i32 (...) @abort()
unreachable
40: ; preds = %22, %21, %18
br label %11
41: ; preds = %11
%42 = load i64, i64* @optind
%43 = trunc i64 %42 to i32
store i32 %43, i32* %9
br label %44
44: ; preds = %55, %41
%45 = load i32, i32* %9
%46 = load i32, i32* %4
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %58
48: ; preds = %44
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%50 = load i8**, i8*** %5
%51 = load i64, i64* @optind
%52 = getelementptr inbounds i8*, i8** %50, i64 %51
%53 = load i8*, i8** %52
%54 = call i32 @strcat(i8* %49, i8* %53)
br label %55
55: ; preds = %48
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 1
store i32 %57, i32* %9
br label %44
58: ; preds = %44
%59 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%60 = call i32 @strcat(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%62 = call i32 @strcat(i8* %61, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%63 = load i32, i32* %7
%64 = icmp ne i32 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %58
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%67 = call i32 @strcat(i8* %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %68
68: ; preds = %65, %58
%69 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%70 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %69)
store i32 0, i32* %3
br label %71
71: ; preds = %68, %37
%72 = load i32, i32* %3
ret i32 %72
}

LLVM IR (-O2):
@opterr = global i64 0
@.str = [4 x i8] c"bnu\00"
@.str.1 = [5 x i8] c"\1B[1m\00"
@.str.2 = [5 x i8] c"\1B[4m\00"
@optopt = global i32 0
@stderr = global i32 0
@.str.3 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.4 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i64 0
@.str.5 = [2 x i8] c" \00"
@.str.6 = [5 x i8] c"\1B[0m\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i64 0, i64* @opterr
br label %5
5: ; preds = %7, %2
%6 = phi i1 [ true, %2 ], [ false, %7 ]
br label %7
7: ; preds = %5, %21
%8 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
switch i32 %8, label %19 [
i32 -1, label %24
i32 98, label %21
i32 110, label %5
i32 117, label %9
i32 63, label %10
]
9: ; preds = %7
br label %21
10: ; preds = %7
%11 = load i32, i32* @optopt
%12 = call i32 @isprint(i32 %11)
%13 = icmp eq i32 %12, 0
%14 = load i32, i32* @stderr
br i1 %13, label %17, label %15
15: ; preds = %10
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %11)
br label %49
17: ; preds = %10
%18 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i32 %11)
br label %49
19: ; preds = %7
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %7, %9
%22 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %7 ]
%23 = call i32 @strcat(i8* %4, i8* %22)
br label %7
24: ; preds = %7
%25 = load i64, i64* @optind
%26 = trunc i64 %25 to i32
%27 = icmp slt i32 %26, %0
br i1 %27, label %28, label %42
28: ; preds = %24
%29 = getelementptr inbounds i8*, i8** %1, i64 %25
%30 = load i8*, i8** %29
%31 = call i32 @strcat(i8* %4, i8* %30)
%32 = add i32 %26, 1
%33 = icmp eq i32 %32, %0
br i1 %33, label %42, label %34
34: ; preds = %28, %34
%35 = phi i32 [ %40, %34 ], [ %32, %28 ]
%36 = load i64, i64* @optind
%37 = getelementptr inbounds i8*, i8** %1, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 @strcat(i8* %4, i8* %38)
%40 = add i32 %35, 1
%41 = icmp eq i32 %40, %0
br i1 %41, label %42, label %34
42: ; preds = %34, %28, %24
%43 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%44 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br i1 %6, label %45, label %47
45: ; preds = %42
%46 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %4)
br label %49
49: ; preds = %15, %17, %47
%50 = phi i32 [ 0, %47 ], [ 1, %17 ], [ 1, %15 ]
ret i32 %50
}