#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 get_skill(int);
int /*<<< orphan*/ get_skill_scale(int, int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strnfmt(char *, int, char *, int);
void symbiotic_info(char *p, int power) {
  int plev = get_skill(8);
  strcpy(p, "");
  switch (power) {
  case 2: {
    strnfmt(p, 80, " power %d", plev * 3);
    break;
  }
  case 5: {
    strnfmt(p, 80, " heal %d%%", 15 + get_skill_scale(8, 35));
    break;
  }
  }
}


x86 assembly (clang, -O0):
<symbiotic_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x8,%edi
call   1060 <get_skill@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2,%eax
je     1191 <symbiotic_info+0x51>
jmp    1180 <symbiotic_info+0x40>
mov    -0x14(%rbp),%eax
sub    $0x5,%eax
je     11af <symbiotic_info+0x6f>
jmp    11e0 <symbiotic_info+0xa0>
mov    -0x8(%rbp),%rdi
imul   $0x3,-0x10(%rbp),%ecx
mov    $0x50,%esi
lea    0xe5b(%rip),%rdx
call   1040 <strnfmt@plt>
jmp    11e0 <symbiotic_info+0xa0>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x8,%edi
mov    $0x23,%esi
call   1050 <get_skill_scale@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%ecx
add    $0xf,%ecx
mov    $0x50,%esi
lea    0xe2f(%rip),%rdx
call   1040 <strnfmt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbiotic_info>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x8,%edi
call   1060 <get_skill@plt>
mov    %eax,%r14d
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
cmp    $0x5,%ebp
je     117c <symbiotic_info+0x3c>
cmp    $0x2,%ebp
jne    11a6 <symbiotic_info+0x66>
lea    (%r14,%r14,2),%ecx
lea    0xe86(%rip),%rdx
jmp    1195 <symbiotic_info+0x55>
mov    $0x8,%edi
mov    $0x23,%esi
call   1050 <get_skill_scale@plt>
lea    0xf(%rax),%ecx
lea    0xe75(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strnfmt@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c" power %d\00"
@.str.2 = [11 x i8] c" heal %d%%\00"
define void @symbiotic_info(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @get_skill(i32 8)
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
switch i32 %9, label %20 [
i32 2, label %10
i32 5, label %15
]
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 3
%14 = call i32 @strnfmt(i8* %11, i32 80, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %20
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @get_skill_scale(i32 8, i32 35)
%18 = add nsw i32 15, %17
%19 = call i32 @strnfmt(i8* %16, i32 80, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %2, %15, %10
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c" power %d\00"
@.str.2 = [11 x i8] c" heal %d%%\00"
define void @symbiotic_info(i8* %0, i32 %1) {
%3 = tail call i32 @get_skill(i32 8)
%4 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
switch i32 %1, label %12 [
i32 2, label %5
i32 5, label %8
]
5: ; preds = %2
%6 = mul nsw i32 %3, 3
%7 = tail call i32 @strnfmt(i8* %0, i32 80, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %12
8: ; preds = %2
%9 = tail call i32 @get_skill_scale(i32 8, i32 35)
%10 = add nsw i32 %9, 15
%11 = tail call i32 @strnfmt(i8* %0, i32 80, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %2, %8, %5
ret void
}