int main(int argc, char *argv[]) {
  printf("%d", strchr("a\nb", 10));
  if (argc > 0) {
    int i;
    char line[500];
    line[0] = 0;
    for (i = 0; i < argc; i++) {
      if ((strlen(line) + strlen(argv[i]) * 2) > 500)
        break;
      printf("%d %s\n", i, argv[i]);
      if (strstr(argv[i], " ")) {
        strcat(line, "\"");
      }
      strcat(line, argv[i]);
      if (strstr(argv[i], " ")) {
        strcat(line, "\"");
      }
      strcat(line, " ");
    }
    printf("#%s#", line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,%rsi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    12ca <main+0x17a>
movb   $0x0,-0x210(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12b5 <main+0x165>
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x218(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x218(%rbp),%rax
shl    $0x1,%rcx
add    %rcx,%rax
cmp    $0x1f4,%rax
jbe    11f5 <main+0xa5>
jmp    12b5 <main+0x165>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde9(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1247 <main+0xf7>
lea    -0x210(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1060 <strcat@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9c(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1294 <main+0x144>
lea    -0x210(%rbp),%rdi
lea    0xd81(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xd6c(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a3 <main+0x53>
lea    -0x210(%rbp),%rsi
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1f8,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xea3(%rip),%rdi
lea    0xea0(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
jle    1251 <main+0x111>
movb   $0x0,(%rsp)
mov    %ebx,%r15d
mov    %rsp,%r12
xor    %ebp,%ebp
jmp    11ab <main+0x6b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <strlen@plt>
movw   $0x20,(%rsp,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r15
je     1240 <main+0x100>
mov    %r12,%rdi
call   1030 <strlen@plt>
mov    %rax,%r13
mov    (%r14,%rbp,8),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x0(,%rax,2),%rax
add    %r13,%rax
cmp    $0x1f4,%rax
ja     1240 <main+0x100>
lea    0xe2b(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r14,%rbp,8),%r13
mov    %r13,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     120c <main+0xcc>
mov    %r12,%rdi
call   1030 <strlen@plt>
movw   $0x22,(%rsp,%rax,1)
mov    %r12,%rdi
mov    %r13,%rsi
call   1060 <strcat@plt>
mov    %r13,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1190 <main+0x50>
mov    %r12,%rdi
call   1030 <strlen@plt>
movw   $0x22,(%rsp,%rax,1)
jmp    1190 <main+0x50>
lea    0xdc7(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x1f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"a\0Ab\00"
@.str.2 = [7 x i8] c"%d %s\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [2 x i8] c"\22\00"
@.str.5 = [5 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 [500 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 10)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %76
12: ; preds = %2
%13 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
store i8 0, i8* %13
store i32 0, i32* %6
br label %14
14: ; preds = %70, %12
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %73
18: ; preds = %14
%19 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%20 = call i64 @strlen(i8* %19)
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i64 @strlen(i8* %25)
%27 = mul i64 %26, 2
%28 = add i64 %20, %27
%29 = icmp ugt i64 %28, 500
br i1 %29, label %30, label %31
30: ; preds = %18
br label %73
31: ; preds = %18
%32 = load i32, i32* %6
%33 = load i8**, i8*** %5
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %32, i8* %37)
%39 = load i8**, i8*** %5
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = call i8* @strstr(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp ne i8* %44, null
br i1 %45, label %46, label %49
46: ; preds = %31
%47 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%48 = call i8* @strcat(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %49
49: ; preds = %46, %31
%50 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%51 = load i8**, i8*** %5
%52 = load i32, i32* %6
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %51, i64 %53
%55 = load i8*, i8** %54
%56 = call i8* @strcat(i8* %50, i8* %55)
%57 = load i8**, i8*** %5
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8*, i8** %57, i64 %59
%61 = load i8*, i8** %60
%62 = call i8* @strstr(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%63 = icmp ne i8* %62, null
br i1 %63, label %64, label %67
64: ; preds = %49
%65 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%66 = call i8* @strcat(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %67
67: ; preds = %64, %49
%68 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%69 = call i8* @strcat(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %70
70: ; preds = %67
%71 = load i32, i32* %6
%72 = add nsw i32 %71, 1
store i32 %72, i32* %6
br label %14
73: ; preds = %30, %14
%74 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %74)
br label %76
76: ; preds = %73, %2
%77 = load i32, i32* %3
ret i32 %77
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"a\0Ab\00"
@.str.2 = [7 x i8] c"%d %s\0A\00"
@.str.5 = [5 x i8] c"#%s#\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [500 x i8]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 1))
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %44
6: ; preds = %2
%7 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
store i8 0, i8* %7
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %6, %36
%10 = phi i64 [ 0, %6 ], [ %40, %36 ]
%11 = call i64 @strlen(i8* %7)
%12 = getelementptr inbounds i8*, i8** %1, i64 %10
%13 = load i8*, i8** %12
%14 = call i64 @strlen(i8* dereferenceable(1) %13)
%15 = shl i64 %14, 1
%16 = add i64 %15, %11
%17 = icmp ugt i64 %16, 500
br i1 %17, label %42, label %18
18: ; preds = %9
%19 = trunc i64 %10 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %19, i8* %13)
%21 = load i8*, i8** %12
%22 = call i8* @strchr(i8* dereferenceable(1) %21, i32 32)
%23 = icmp eq i8* %22, null
br i1 %23, label %28, label %24
24: ; preds = %18
%25 = call i64 @strlen(i8* %7)
%26 = getelementptr [500 x i8], [500 x i8]* %3, i64 0, i64 %25
%27 = bitcast i8* %26 to i16*
store i16 34, i16* %27
br label %28
28: ; preds = %24, %18
%29 = call i8* @strcat(i8* %7, i8* dereferenceable(1) %21)
%30 = call i8* @strchr(i8* dereferenceable(1) %21, i32 32)
%31 = icmp eq i8* %30, null
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = call i64 @strlen(i8* %7)
%34 = getelementptr [500 x i8], [500 x i8]* %3, i64 0, i64 %33
%35 = bitcast i8* %34 to i16*
store i16 34, i16* %35
br label %36
36: ; preds = %32, %28
%37 = call i64 @strlen(i8* %7)
%38 = getelementptr [500 x i8], [500 x i8]* %3, i64 0, i64 %37
%39 = bitcast i8* %38 to i16*
store i16 32, i16* %39
%40 = add nuw nsw i64 %10, 1
%41 = icmp eq i64 %40, %8
br i1 %41, label %42, label %9
42: ; preds = %36, %9
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %7)
br label %44
44: ; preds = %42, %2
ret i32 0
}