#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 *, int *, char *);
scalar_t__ vmon(int, int, int, char *, int, char *);
void power_on() {
  int id, cpu, mem;
  char mac[1024];
  int type;
  char br[32];
  scanf("%d %d %d %s", &id, &cpu, &mem, mac);
  if (vmon(id, cpu, mem, mac, type, br)) {
    printf("ok\n");
  } else {
    printf("error\n");
  }
}


x86 assembly (clang, -O0):
<power_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
lea    -0x410(%rbp),%r8
lea    0xeb7(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x410(%rbp),%rcx
mov    -0x414(%rbp),%r8d
lea    -0x440(%rbp),%r9
call   1040 <vmon@plt>
cmp    $0x0,%rax
je     1198 <power_on+0x68>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
jmp    11a4 <power_on+0x74>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_on>:
push   %rbx
sub    $0x430,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0x30(%rsp),%rbx
mov    %rbx,%r8
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    0x10(%rsp),%r9
mov    %rbx,%rcx
call   1040 <vmon@plt>
test   %rax,%rax
lea    0xe8e(%rip),%rax
lea    0xe8d(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0x430,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %s\00"
@.str.1 = [4 x i8] c"ok\0A\00"
@.str.2 = [7 x i8] c"error\0A\00"
define void @power_on() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = alloca i32
%6 = alloca [32 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i8* %7)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%13 = load i32, i32* %5
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%15 = call i64 @vmon(i32 %9, i32 %10, i32 %11, i8* %12, i32 %13, i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %21
19: ; preds = %0
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %s\00"
@str = [6 x i8] c"error\00"
@str.3 = [3 x i8] c"ok\00"
define void @power_on() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = alloca [32 x i8]
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i8* %9)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i64 @vmon(i32 %12, i32 %13, i32 %14, i8* %9, i32 undef, i8* %10)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0)
%18 = call i32 @puts(i8* dereferenceable(1) %17)
ret void
}