#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 *);
void showSuccess(int id) {
  switch (id) {
  case 0: {
    printf("\n\nNice! Successfully added node.");
    break;
  }
  case 1: {
    printf("\n\nGreat! Node has been removed.\n\n");
    break;
  }
  case 2: {
    printf("\n\nGood news! Stack released with success.\n\n");
    break;
  }
  }
}


x86 assembly (clang, -O0):
<showSuccess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1150 <showSuccess+0x40>
jmp    112e <showSuccess+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1161 <showSuccess+0x51>
jmp    113f <showSuccess+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1172 <showSuccess+0x62>
jmp    117e <showSuccess+0x6e>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <showSuccess+0x6e>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <showSuccess+0x6e>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showSuccess>:
cmp    $0x2,%edi
je     113a <showSuccess+0x1a>
cmp    $0x1,%edi
je     1146 <showSuccess+0x26>
test   %edi,%edi
jne    1152 <showSuccess+0x32>
lea    0xecb(%rip),%rdi
jmp    1040 <printf@plt>
lea    0xee0(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xeff(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A\0ANice! Successfully added node.\00"
@.str.1 = [34 x i8] c"\0A\0AGreat! Node has been removed.\0A\0A\00"
@.str.2 = [44 x i8] c"\0A\0AGood news! Stack released with success.\0A\0A\00"
define void @showSuccess(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %1, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A\0ANice! Successfully added node.\00"
@str = [43 x i8] c"\0A\0AGood news! Stack released with success.\0A\00"
@str.3 = [33 x i8] c"\0A\0AGreat! Node has been removed.\0A\00"
define void @showSuccess(i32 %0) {
switch i32 %0, label %8 [
i32 0, label %2
i32 1, label %4
i32 2, label %6
]
2: ; preds = %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %8
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %1, %6, %4, %2
ret void
}