#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 */
struct battle_char {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
int /*<<< orphan*/ remove_status(struct battle_char *, int);
void esuna(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 190)) {
    remove_status(target, 9);
    remove_status(target, 2);
    remove_status(target, 8);
    remove_status(target, 12);
    remove_status(target, 28);
    remove_status(target, 5);
    remove_status(target, 10);
    remove_status(target, 4);
    remove_status(target, 0);
    remove_status(target, 1);
  }
}


x86 assembly (clang, -O0):
<esuna>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xbe,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    11fb <esuna+0xcb>
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0xc,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1c,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <remove_status@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <remove_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esuna>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xbe,%edx
call   1040 <mod6@plt>
cmp    %rax,%r15
jge    11e7 <esuna+0xb7>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0x1c,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <remove_status@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <remove_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @esuna(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 190)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %31
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @remove_status(%struct.battle_char* %11, i32 9)
%13 = load %struct.battle_char*, %struct.battle_char** %4
%14 = call i32 @remove_status(%struct.battle_char* %13, i32 2)
%15 = load %struct.battle_char*, %struct.battle_char** %4
%16 = call i32 @remove_status(%struct.battle_char* %15, i32 8)
%17 = load %struct.battle_char*, %struct.battle_char** %4
%18 = call i32 @remove_status(%struct.battle_char* %17, i32 12)
%19 = load %struct.battle_char*, %struct.battle_char** %4
%20 = call i32 @remove_status(%struct.battle_char* %19, i32 28)
%21 = load %struct.battle_char*, %struct.battle_char** %4
%22 = call i32 @remove_status(%struct.battle_char* %21, i32 5)
%23 = load %struct.battle_char*, %struct.battle_char** %4
%24 = call i32 @remove_status(%struct.battle_char* %23, i32 10)
%25 = load %struct.battle_char*, %struct.battle_char** %4
%26 = call i32 @remove_status(%struct.battle_char* %25, i32 4)
%27 = load %struct.battle_char*, %struct.battle_char** %4
%28 = call i32 @remove_status(%struct.battle_char* %27, i32 0)
%29 = load %struct.battle_char*, %struct.battle_char** %4
%30 = call i32 @remove_status(%struct.battle_char* %29, i32 1)
br label %31
31: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @esuna(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 190)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = tail call i32 @remove_status(%struct.battle_char* %1, i32 9)
%8 = tail call i32 @remove_status(%struct.battle_char* %1, i32 2)
%9 = tail call i32 @remove_status(%struct.battle_char* %1, i32 8)
%10 = tail call i32 @remove_status(%struct.battle_char* %1, i32 12)
%11 = tail call i32 @remove_status(%struct.battle_char* %1, i32 28)
%12 = tail call i32 @remove_status(%struct.battle_char* %1, i32 5)
%13 = tail call i32 @remove_status(%struct.battle_char* %1, i32 10)
%14 = tail call i32 @remove_status(%struct.battle_char* %1, i32 4)
%15 = tail call i32 @remove_status(%struct.battle_char* %1, i32 0)
%16 = tail call i32 @remove_status(%struct.battle_char* %1, i32 1)
br label %17
17: ; preds = %6, %2
ret void
}