#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n;
  printf("> n = ");
  scanf("%i", &n);
  for (i = 0; i < n; i++) {
    printf("action 1, i=%i\n", i);
    if (i > 0)
      continue;
    printf("action 2, i=%i\n", i);
  }
  printf("\n");
  for (i = 0; i < n; i++) {
    printf("action 1, i=%i\n", i);
    if (i > 0)
      goto loopEnd;
    printf("action 2, i=%i\n", i);
  loopEnd:;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119f <main+0x7f>
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1180 <main+0x60>
jmp    1191 <main+0x71>
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x34>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1204 <main+0xe4>
mov    -0x8(%rbp),%esi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    11e0 <main+0xc0>
jmp    11f1 <main+0xd1>
mov    -0x8(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b4 <main+0x94>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11a5 <main+0x75>
lea    0xea9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x2,0x4(%rsp)
jl     11a5 <main+0x75>
mov    $0x1,%ebx
lea    0xe7d(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jl     1190 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    1205 <main+0xd5>
lea    0xe4d(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe4d(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x2,0x4(%rsp)
jl     1205 <main+0xd5>
mov    $0x1,%ebx
lea    0xe21(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jl     11f0 <main+0xc0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"> n = \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [16 x i8] c"action 1, i=%i\0A\00"
@.str.3 = [16 x i8] c"action 2, i=%i\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 0, i32* %2
br label %6
6: ; preds = %19, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
br label %19
16: ; preds = %10
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %6
22: ; preds = %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %24
24: ; preds = %38, %22
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %41
28: ; preds = %24
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %2
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %28
br label %37
34: ; preds = %28
%35 = load i32, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %34, %33
br label %38
38: ; preds = %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %24
41: ; preds = %24
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [7 x i8] c"> n = \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [16 x i8] c"action 1, i=%i\0A\00"
@.str.3 = [16 x i8] c"action 2, i=%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %7, %12
%13 = phi i32 [ %16, %12 ], [ 1, %7 ]
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = add nuw nsw i32 %13, 1
%17 = icmp slt i32 %16, %15
br i1 %17, label %12, label %18
18: ; preds = %12, %7, %0
%19 = call i32 @putchar(i32 10)
%20 = load i32, i32* %1
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %33
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 0)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0)
%25 = load i32, i32* %1
%26 = icmp sgt i32 %25, 1
br i1 %26, label %27, label %33
27: ; preds = %22, %27
%28 = phi i32 [ %31, %27 ], [ 1, %22 ]
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %1
%31 = add nuw nsw i32 %28, 1
%32 = icmp slt i32 %31, %30
br i1 %32, label %27, label %33
33: ; preds = %27, %22, %18
ret i32 0
}