#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n = 0;
  int a, b, z, i;
  if (n)
    printf("the n is not zero.\n");
  else
    printf("the n is zero.\n");
  a = 10;
  b = 20;
  z = 30;
  if (n > 0)
    if (a > b)
      z = a;
    else
      z = b;
  printf("z=%d\n", z);
  a = 10;
  b = 20;
  z = 30;
  if (n > 0) {
    if (a > b)
      z = a;
  } else
    z = b;
  printf("z=%d\n", z);
  if (n > 0)
    for (i = 0; i < z; i++)
      if (a > 0)
        printf("a=%d\n", a);
      else
        printf("error1: n is negative\n");
  if (n > 0) {
    for (i = 0; i < z; i++)
      if (a > 0)
        printf("a=%d\n", a);
  } else
    printf("error2: n is negative\n");
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1153 <main+0x33>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1161 <main+0x41>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0xc(%rbp)
movl   $0x14,-0x10(%rbp)
movl   $0x1e,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11a2 <main+0x82>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1197 <main+0x77>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    119d <main+0x7d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11a2 <main+0x82>
mov    -0x14(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0xc(%rbp)
movl   $0x14,-0x10(%rbp)
movl   $0x1e,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    11e9 <main+0xc9>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11e4 <main+0xc4>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11ef <main+0xcf>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1263 <main+0x143>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    125e <main+0x13e>
cmpl   $0x0,-0xc(%rbp)
jle    123d <main+0x11d>
mov    -0xc(%rbp),%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124b <main+0x12b>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1250 <main+0x130>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1211 <main+0xf1>
jmp    1263 <main+0x143>
cmpl   $0x0,-0x8(%rbp)
jle    12b3 <main+0x193>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12ae <main+0x18e>
cmpl   $0x0,-0xc(%rbp)
jle    129b <main+0x17b>
mov    -0xc(%rbp),%esi
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a0 <main+0x180>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1274 <main+0x154>
jmp    12c1 <main+0x1a1>
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"the n is not zero.\0A\00"
@.str.1 = [16 x i8] c"the n is zero.\0A\00"
@.str.2 = [6 x i8] c"z=%d\0A\00"
@.str.3 = [6 x i8] c"a=%d\0A\00"
@.str.4 = [23 x i8] c"error1: n is negative\0A\00"
@.str.5 = [23 x i8] c"error2: n is negative\0A\00"
@.str.6 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
store i32 10, i32* %3
store i32 20, i32* %4
store i32 30, i32* %5
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %3
store i32 %21, i32* %5
br label %24
22: ; preds = %16
%23 = load i32, i32* %4
store i32 %23, i32* %5
br label %24
24: ; preds = %22, %20
br label %25
25: ; preds = %24, %13
%26 = load i32, i32* %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %26)
store i32 10, i32* %3
store i32 20, i32* %4
store i32 30, i32* %5
%28 = load i32, i32* %2
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %37
30: ; preds = %25
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = load i32, i32* %3
store i32 %35, i32* %5
br label %36
36: ; preds = %34, %30
br label %39
37: ; preds = %25
%38 = load i32, i32* %4
store i32 %38, i32* %5
br label %39
39: ; preds = %37, %36
%40 = load i32, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %2
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %62
44: ; preds = %39
store i32 0, i32* %6
br label %45
45: ; preds = %58, %44
%46 = load i32, i32* %6
%47 = load i32, i32* %5
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %61
49: ; preds = %45
%50 = load i32, i32* %3
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i32, i32* %3
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %53)
br label %57
55: ; preds = %49
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %57
57: ; preds = %55, %52
br label %58
58: ; preds = %57
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
br label %45
61: ; preds = %45
br label %62
62: ; preds = %61, %39
%63 = load i32, i32* %2
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %81
65: ; preds = %62
store i32 0, i32* %6
br label %66
66: ; preds = %77, %65
%67 = load i32, i32* %6
%68 = load i32, i32* %5
%69 = icmp slt i32 %67, %68
br i1 %69, label %70, label %80
70: ; preds = %66
%71 = load i32, i32* %3
%72 = icmp sgt i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %70
%74 = load i32, i32* %3
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %73, %70
br label %77
77: ; preds = %76
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
store i32 %79, i32* %6
br label %66
80: ; preds = %66
br label %83
81: ; preds = %62
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %83
83: ; preds = %81, %80
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%85 = call i32 (...) @getchar()
%86 = load i32, i32* %1
ret i32 %86
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"z=%d\0A\00"
@.str.6 = [25 x i8] c"\0APress any key to end...\00"
@str = [15 x i8] c"the n is zero.\00"
@str.7 = [22 x i8] c"error2: n is negative\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 30)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 20)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%6 = tail call i32 (...) @getchar()
ret i32 0
}