#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 main(int argc, char *argv[]) {
  int a = 10;
  if (a == 10)
    a = 11;
  else if (a == 11)
    a = 12;
  printf(
      "does the if{} statement always exit after first successful attempt?\n");
  printf("i.e. is it pretty opposite to switch{} in this sense (which always "
         "needs break();)?\n");
  printf("a is %i\n", a);
  printf("The answer is yes.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jne    1143 <main+0x33>
movl   $0xb,-0x14(%rbp)
jmp    1159 <main+0x49>
cmpl   $0xb,-0x14(%rbp)
jne    1154 <main+0x44>
movl   $0xc,-0x14(%rbp)
jmp    1159 <main+0x49>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xf1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf4e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"does the if{} statement always exit after first successful attempt?\0A\00"
@.str.1 = [85 x i8] c"i.e. is it pretty opposite to switch{} in this sense (which always needs break();)?\0A\00"
@.str.2 = [9 x i8] c"a is %i\0A\00"
@.str.3 = [20 x i8] c"The answer is yes.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 11, i32* %6
br label %15
10: ; preds = %2
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 11
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 12, i32* %6
br label %14
14: ; preds = %13, %10
br label %15
15: ; preds = %14, %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [9 x i8] c"a is %i\0A\00"
@str = [68 x i8] c"does the if{} statement always exit after first successful attempt?\00"
@str.4 = [84 x i8] c"i.e. is it pretty opposite to switch{} in this sense (which always needs break();)?\00"
@str.5 = [19 x i8] c"The answer is yes.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 11)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}