#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 canCompleteCircuit(int *, int, int *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int gas[] = {1, 2, 3};
  int cost[] = {3, 3, 1};
  if (!(canCompleteCircuit(gas, 3, cost, 3) == -1)) {
    printf("assert fail: %s\n", "-1");
    exit(-1);
  };
  printf("everything is fine!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rdx
mov    $0x3,%ecx
mov    %ecx,%esi
call   1050 <canCompleteCircuit@plt>
cmp    $0xffffffff,%eax
je     11aa <main+0x7a>
lea    0xe86(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xebe(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xeab(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xeb4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xea1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rdx
mov    $0x3,%esi
mov    $0x3,%ecx
call   1060 <canCompleteCircuit@plt>
cmp    $0xffffffff,%eax
jne    11a1 <main+0x61>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret
lea    0xe70(%rip),%rdi
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const.main.gas = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.cost = [3 x i32] [i32 3, i32 3, i32 1]
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [3 x i8] c"-1\00"
@.str.2 = [21 x i8] c"everything is fine!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
%7 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [3 x i32]* %6 to i8*
%9 = bitcast [3 x i32]* %7 to i8*
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%12 = call i32 @canCompleteCircuit(i32* %10, i32 3, i32* %11, i32 3)
%13 = icmp eq i32 %12, -1
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.gas = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.cost = [3 x i32] [i32 3, i32 3, i32 1]
@.str = [17 x i8] c"assert fail: %s\0A\00"
@.str.1 = [3 x i8] c"-1\00"
@str = [20 x i8] c"everything is fine!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%9 = call i32 @canCompleteCircuit(i32* %7, i32 3, i32* %8, i32 3)
%10 = icmp eq i32 %9, -1
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}