#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 */
typedef int int64_t;

/* Variables and functions */
scalar_t__ foo(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strtoll(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  int64_t x = strtoll(argv[1], NULL, 10);
  char buf[64];
  if (x <= 2 || (x & 1) != 0)
    return 1;
  int64_t i;
  for (i = x; i > 0; i--)
    if (foo(i) && foo(x - i))
      return 1;
  strcpy(buf, argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jle    1178 <main+0x48>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1184 <main+0x54>
movl   $0x1,-0x4(%rbp)
jmp    11eb <main+0xbb>
mov    -0x14(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jle    11da <main+0xaa>
mov    -0x64(%rbp),%edi
call   1050 <foo@plt>
cmp    $0x0,%rax
je     11c7 <main+0x97>
mov    -0x14(%rbp),%edi
sub    -0x64(%rbp),%edi
call   1050 <foo@plt>
cmp    $0x0,%rax
je     11c7 <main+0x97>
movl   $0x1,-0x4(%rbp)
jmp    11eb <main+0xbb>
jmp    11cc <main+0x9c>
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    118a <main+0x5a>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    $0x1,%r15d
cmp    $0x3,%eax
jl     11a6 <main+0x76>
mov    %eax,%ebx
and    $0x1,%eax
jne    11a6 <main+0x76>
xor    %ebp,%ebp
jmp    117d <main+0x4d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rbx),%eax
add    $0x1,%ebp
cmp    $0x1,%ebx
mov    %eax,%ebx
jle    1197 <main+0x67>
mov    %ebx,%edi
call   1050 <foo@plt>
test   %rax,%rax
je     1170 <main+0x40>
mov    %ebp,%edi
call   1050 <foo@plt>
test   %rax,%rax
je     1170 <main+0x40>
jmp    11a6 <main+0x76>
mov    0x10(%r14),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %r15d,%r15d
mov    %r15d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [64 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strtoll(i8* %11, i32* null, i32 10)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp sle i32 %13, 2
br i1 %14, label %19, label %15
15: ; preds = %2
%16 = load i32, i32* %6
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15, %2
store i32 1, i32* %3
br label %46
20: ; preds = %15
%21 = load i32, i32* %6
store i32 %21, i32* %8
br label %22
22: ; preds = %37, %20
%23 = load i32, i32* %8
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %40
25: ; preds = %22
%26 = load i32, i32* %8
%27 = call i64 @foo(i32 %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %36
29: ; preds = %25
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = sub nsw i32 %30, %31
%33 = call i64 @foo(i32 %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %29
store i32 1, i32* %3
br label %46
36: ; preds = %29, %25
br label %37
37: ; preds = %36
%38 = load i32, i32* %8
%39 = add nsw i32 %38, -1
store i32 %39, i32* %8
br label %22
40: ; preds = %22
%41 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32 @strcpy(i8* %41, i8* %44)
br label %46
46: ; preds = %40, %35, %19
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @strtoll(i8* nocapture %5, i32* null, i32 10)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = icmp sgt i32 %6, 2
%9 = and i32 %6, 1
%10 = icmp eq i32 %9, 0
%11 = and i1 %8, %10
br i1 %11, label %12, label %27
12: ; preds = %2, %20
%13 = phi i32 [ %21, %20 ], [ %6, %2 ]
%14 = tail call i64 @foo(i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = sub nuw nsw i32 %6, %13
%18 = tail call i64 @foo(i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %12, %16
%21 = add nsw i32 %13, -1
%22 = icmp sgt i32 %13, 1
br i1 %22, label %12, label %23
23: ; preds = %20
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @strcpy(i8* %7, i8* %25)
br label %27
27: ; preds = %16, %23, %2
%28 = phi i32 [ 1, %2 ], [ 0, %23 ], [ 1, %16 ]
ret i32 %28
}