#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < 10; i++) {
    char stdout_string[] = "Normal message no:  .";
    char stderr_string[] = "Error message no:  .";
    stdout_string[19] = '0' + i;
    stderr_string[18] = '0' + i;
    sleep(1);
    fprintf(stdout, "%s\n", stdout_string);
    sleep(1);
    fprintf(stderr, "%s\n", stderr_string);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11ff <main+0xdf>
mov    0xeb2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xea7(%rip),%ax
mov    %ax,-0x1c(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xea3(%rip),%eax
mov    %eax,-0x40(%rbp)
mov    0xe9e(%rip),%al
mov    %al,-0x3c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1d(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x3e(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rdx
lea    0xe6c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rdx
lea    0xe49(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0xfffffff6,%ebx
movabs $0x2e20203a6f6e20,%r13
lea    0xef1(%rip),%r12
lea    0x20(%rsp),%r14
mov    0x2e90(%rip),%rbp
mov    %rsp,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %r13,0x2e(%rsp)
mov    %r13,0xd(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x3a(%rbx),%eax
mov    %al,0x33(%rsp)
mov    %al,0x12(%rsp)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    0x0(%rbp),%edi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <fprintf@plt>
inc    %ebx
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.stdout_string = [22 x i8] c"Normal message no: .\00"
@__const.main.stderr_string = [21 x i8] c"Error message no: .\00"
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [22 x i8]
%8 = alloca [21 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %9
9: ; preds = %31, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %34
12: ; preds = %9
%13 = bitcast [22 x i8]* %7 to i8*
%14 = bitcast [21 x i8]* %8 to i8*
%15 = load i32, i32* %6
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
%18 = getelementptr inbounds [22 x i8], [22 x i8]* %7, i64 0, i64 19
store i8 %17, i8* %18
%19 = load i32, i32* %6
%20 = add nsw i32 48, %19
%21 = trunc i32 %20 to i8
%22 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 18
store i8 %21, i8* %22
%23 = call i32 @sleep(i32 1)
%24 = load i32, i32* @stdout
%25 = getelementptr inbounds [22 x i8], [22 x i8]* %7, i64 0, i64 0
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = call i32 @sleep(i32 1)
%28 = load i32, i32* @stderr
%29 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%30 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %12
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %9
34: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@__const.main.stdout_string = [22 x i8] c"Normal message no: .\00"
@__const.main.stderr_string = [21 x i8] c"Error message no: .\00"
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [22 x i8]
%4 = alloca [21 x i8]
%5 = getelementptr inbounds [22 x i8], [22 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [22 x i8], [22 x i8]* %3, i64 0, i64 19
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 18
br label %9
9: ; preds = %2, %9
%10 = phi i32 [ 0, %2 ], [ %19, %9 ]
%11 = trunc i32 %10 to i8
%12 = add nuw nsw i8 %11, 48
store i8 %12, i8* %7
store i8 %12, i8* %8
%13 = call i32 @sleep(i32 1)
%14 = load i32, i32* @stdout
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%16 = call i32 @sleep(i32 1)
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%19 = add nuw nsw i32 %10, 1
%20 = icmp eq i32 %19, 10
br i1 %20, label %21, label %9
21: ; preds = %9
ret i32 0
}