#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 check(char *, int, int);
int isDivisible(char *n, int digits, int k) {
  if ((digits & 1) && (!(k & 1)))
    return 1;
  else if ((digits & 1) && (k & 1)) {
    return check(n, digits, 1);
  } else if ((!(digits & 1)) && (k & 1)) {
    return check(n, digits, 0);
  } else if (!((digits & 1) && (k & 1))) {
    return check(n, digits, 0);
  }
}


x86 assembly (clang, -O0):
<isDivisible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114c <isDivisible+0x3c>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114c <isDivisible+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    11fa <isDivisible+0xea>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1183 <isDivisible+0x73>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1183 <isDivisible+0x73>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
call   1030 <check@plt>
mov    %eax,-0x4(%rbp)
jmp    11fa <isDivisible+0xea>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    11b7 <isDivisible+0xa7>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11b7 <isDivisible+0xa7>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1030 <check@plt>
mov    %eax,-0x4(%rbp)
jmp    11fa <isDivisible+0xea>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11d5 <isDivisible+0xc5>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    11eb <isDivisible+0xdb>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1030 <check@plt>
mov    %eax,-0x4(%rbp)
jmp    11fa <isDivisible+0xea>
jmp    11f0 <isDivisible+0xe0>
jmp    11f5 <isDivisible+0xe5>
jmp    11fa <isDivisible+0xea>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDivisible>:
mov    %esi,%eax
and    $0x1,%eax
je     1124 <isDivisible+0x14>
mov    %edx,%ecx
and    $0x1,%ecx
jne    1124 <isDivisible+0x14>
mov    $0x1,%eax
ret
and    %edx,%eax
mov    %eax,%edx
jmp    1030 <check@plt>

LLVM IR (-O0):
define i32 @isDivisible(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %7
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i32 1, i32* %4
br label %55
16: ; preds = %11, %3
%17 = load i32, i32* %6
%18 = and i32 %17, 1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i32, i32* %7
%22 = and i32 %21, 1
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8*, i8** %5
%26 = load i32, i32* %6
%27 = call i32 @check(i8* %25, i32 %26, i32 1)
store i32 %27, i32* %4
br label %55
28: ; preds = %20, %16
%29 = load i32, i32* %6
%30 = and i32 %29, 1
%31 = icmp ne i32 %30, 0
br i1 %31, label %40, label %32
32: ; preds = %28
%33 = load i32, i32* %7
%34 = and i32 %33, 1
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %32
%37 = load i8*, i8** %5
%38 = load i32, i32* %6
%39 = call i32 @check(i8* %37, i32 %38, i32 0)
store i32 %39, i32* %4
br label %55
40: ; preds = %32, %28
%41 = load i32, i32* %6
%42 = and i32 %41, 1
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %40
%45 = load i32, i32* %7
%46 = and i32 %45, 1
%47 = icmp ne i32 %46, 0
br i1 %47, label %52, label %48
48: ; preds = %44, %40
%49 = load i8*, i8** %5
%50 = load i32, i32* %6
%51 = call i32 @check(i8* %49, i32 %50, i32 0)
store i32 %51, i32* %4
br label %55
52: ; preds = %44
br label %53
53: ; preds = %52
br label %54
54: ; preds = %53
br label %55
55: ; preds = %15, %24, %36, %48, %54
%56 = load i32, i32* %4
ret i32 %56
}

LLVM IR (-O2):
define i32 @isDivisible(i8* %0, i32 %1, i32 %2) {
%4 = and i32 %1, 1
%5 = icmp ne i32 %4, 0
%6 = and i32 %2, 1
%7 = icmp eq i32 %6, 0
%8 = and i1 %5, %7
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = and i32 %4, %2
%11 = tail call i32 @check(i8* %0, i32 %1, i32 %10)
br label %12
12: ; preds = %9, %3
%13 = phi i32 [ 1, %3 ], [ %11, %9 ]
ret i32 %13
}