#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);
int /*<<< orphan*/ putchar(char);
int main(void) {
  int i;
  char *ch = "This is a testing program for gdb.";
  i = 0;
  while (ch[i] != '\0') {
    putchar(ch[i]);
    i++;
  }
  ch[i] = '!';
  putchar('\n');
  for (i = 1; i <= 11; i++)
    printf("%X", i);
  putchar('\n');
  for (i = 1; i <= 11; i++) {
    if (i % 3 == 0)
      putchar('$');
    else
      putchar('*');
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1175 <main+0x55>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <main+0x21>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x21,(%rax,%rcx,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jg     11b9 <main+0x99>
mov    -0x8(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1192 <main+0x72>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jg     1214 <main+0xf4>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11f7 <main+0xd7>
mov    $0x24,%edi
call   1030 <putchar@plt>
jmp    1201 <main+0xe1>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1206 <main+0xe6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ca <main+0xaa>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x54,%edi
call   1030 <putchar@plt>
mov    $0x68,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1030 <putchar@plt>
mov    $0x67,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x70,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x67,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x6d,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x66,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x67,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd7a(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x24,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x24,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x24,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"This is a testing program for gdb.\00"
@.str.1 = [3 x i8] c"%X\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8** %3
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @putchar(i8 signext %17)
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
%22 = load i8*, i8** %3
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 33, i8* %25
%26 = call i32 @putchar(i8 signext 10)
store i32 1, i32* %2
br label %27
27: ; preds = %33, %21
%28 = load i32, i32* %2
%29 = icmp sle i32 %28, 11
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i32, i32* %2
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %30
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %27
36: ; preds = %27
%37 = call i32 @putchar(i8 signext 10)
store i32 1, i32* %2
br label %38
38: ; preds = %50, %36
%39 = load i32, i32* %2
%40 = icmp sle i32 %39, 11
br i1 %40, label %41, label %53
41: ; preds = %38
%42 = load i32, i32* %2
%43 = srem i32 %42, 3
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 @putchar(i8 signext 36)
br label %49
47: ; preds = %41
%48 = call i32 @putchar(i8 signext 42)
br label %49
49: ; preds = %47, %45
br label %50
50: ; preds = %49
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %38
53: ; preds = %38
%54 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%X\00"
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 84)
%2 = tail call i32 @putchar(i8 signext 104)
%3 = tail call i32 @putchar(i8 signext 105)
%4 = tail call i32 @putchar(i8 signext 115)
%5 = tail call i32 @putchar(i8 signext 32)
%6 = tail call i32 @putchar(i8 signext 105)
%7 = tail call i32 @putchar(i8 signext 115)
%8 = tail call i32 @putchar(i8 signext 32)
%9 = tail call i32 @putchar(i8 signext 97)
%10 = tail call i32 @putchar(i8 signext 32)
%11 = tail call i32 @putchar(i8 signext 116)
%12 = tail call i32 @putchar(i8 signext 101)
%13 = tail call i32 @putchar(i8 signext 115)
%14 = tail call i32 @putchar(i8 signext 116)
%15 = tail call i32 @putchar(i8 signext 105)
%16 = tail call i32 @putchar(i8 signext 110)
%17 = tail call i32 @putchar(i8 signext 103)
%18 = tail call i32 @putchar(i8 signext 32)
%19 = tail call i32 @putchar(i8 signext 112)
%20 = tail call i32 @putchar(i8 signext 114)
%21 = tail call i32 @putchar(i8 signext 111)
%22 = tail call i32 @putchar(i8 signext 103)
%23 = tail call i32 @putchar(i8 signext 114)
%24 = tail call i32 @putchar(i8 signext 97)
%25 = tail call i32 @putchar(i8 signext 109)
%26 = tail call i32 @putchar(i8 signext 32)
%27 = tail call i32 @putchar(i8 signext 102)
%28 = tail call i32 @putchar(i8 signext 111)
%29 = tail call i32 @putchar(i8 signext 114)
%30 = tail call i32 @putchar(i8 signext 32)
%31 = tail call i32 @putchar(i8 signext 103)
%32 = tail call i32 @putchar(i8 signext 100)
%33 = tail call i32 @putchar(i8 signext 98)
%34 = tail call i32 @putchar(i8 signext 46)
%35 = tail call i32 @putchar(i8 signext 10)
%36 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%37 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%38 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 3)
%39 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 4)
%40 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 5)
%41 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 6)
%42 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 7)
%43 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 8)
%44 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 9)
%45 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 10)
%46 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 11)
%47 = tail call i32 @putchar(i8 signext 10)
%48 = tail call i32 @putchar(i8 signext 42)
%49 = tail call i32 @putchar(i8 signext 42)
%50 = tail call i32 @putchar(i8 signext 36)
%51 = tail call i32 @putchar(i8 signext 42)
%52 = tail call i32 @putchar(i8 signext 42)
%53 = tail call i32 @putchar(i8 signext 36)
%54 = tail call i32 @putchar(i8 signext 42)
%55 = tail call i32 @putchar(i8 signext 42)
%56 = tail call i32 @putchar(i8 signext 36)
%57 = tail call i32 @putchar(i8 signext 42)
%58 = tail call i32 @putchar(i8 signext 42)
%59 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}