#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*/ printf(char *, ...);
int strlen(char *);
int main() {
  char s[] = "Hello!§A¦n¡Ibig5.";
  int i;
  for (i = 0; i < strlen(s); i++) {
    printf("%d:%c ", i, s[i]);
  }
  printf("\n");
  for (i = 0; i < strlen(s);) {
    unsigned char b = (unsigned char)s[i];
    if (b >= 0xA1 && b <= 0xF9) {
      printf("%d:%c%c ", i, s[i], s[i + 1]);
      i += 2;
    } else {
      printf("%d:%c ", i, s[i]);
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0xc(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    11a2 <main+0x82>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%edx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115e <main+0x3e>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cmp    %ecx,%eax
jge    1259 <main+0x139>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,1),%al
mov    %al,-0x25(%rbp)
movzbl -0x25(%rbp),%eax
cmp    $0xa1,%eax
jl     1231 <main+0x111>
movzbl -0x25(%rbp),%eax
cmp    $0xf9,%eax
jg     1231 <main+0x111>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%edx
mov    -0x24(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x20(%rbp,%rax,1),%ecx
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    1254 <main+0x134>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%edx
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b7 <main+0x97>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2e3567696249a1,%rax
mov    %rax,0xd(%rsp)
mov    %rsp,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1193 <main+0x63>
lea    0xeae(%rip),%r14
mov    %rsp,%rbp
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%rsp,%rbx,1),%edx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
mov    %rbp,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1205 <main+0xd5>
lea    0xe69(%rip),%r14
lea    0xe5b(%rip),%r15
xor    %ebp,%ebp
jmp    11df <main+0xaf>
xchg   %ax,%ax
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%eax
add    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    %eax,%ebp
jge    1205 <main+0xd5>
mov    %ebp,%eax
movsbl (%rsp,%rax,1),%edx
lea    0x5f(%rdx),%ecx
cmp    $0x58,%cl
ja     11c0 <main+0x90>
movsbl 0x1(%rax,%rbx,1),%ecx
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%eax
jmp    11d1 <main+0xa1>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@__const.main.s = [21 x i8] c"Hello!\C2\A7A\C2\A6n\C2\A1Ibig5.\00"
@.str = [7 x i8] c"%d:%c \00"
@.str.2 = [9 x i8] c"%d:%c%c \00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %0, %5
%6 = phi i64 [ %12, %5 ], [ 0, %0 ]
%7 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = trunc i64 %6 to i32
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %6, 1
%13 = call i32 @strlen(i8* %2)
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %5, label %16
16: ; preds = %5, %0
%17 = call i32 @putchar(i32 10)
%18 = call i32 @strlen(i8* %2)
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %42
20: ; preds = %16, %37
%21 = phi i32 [ %39, %37 ], [ 0, %16 ]
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = add i8 %24, 95
%26 = icmp ult i8 %25, 89
%27 = sext i8 %24 to i32
br i1 %26, label %28, label %35
28: ; preds = %20
%29 = add nuw nsw i32 %21, 1
%30 = zext i32 %29 to i64
%31 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %21, i32 %27, i32 %33)
br label %37
35: ; preds = %20
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %27)
br label %37
37: ; preds = %35, %28
%38 = phi i32 [ 1, %35 ], [ 2, %28 ]
%39 = add nuw nsw i32 %21, %38
%40 = call i32 @strlen(i8* %2)
%41 = icmp slt i32 %39, %40
br i1 %41, label %20, label %42
42: ; preds = %37, %16
ret i32 0
}