#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int nonzero(int m, int m1, int m2, int type) {
  switch (type) {
  case 2:
    return m == (m1 + m2);
  case 1:
    return (m == (m1 + m2)) || (m == (m1 - m2)) || (m == (-m1 + m2)) ||
           (m == (-m1 - m2));
  }
  fprintf(stderr, "***ERROR in %s (%d)\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/RafaelDexter/OpenMX/refs/heads/master/"
          "source/liberi-091216/source/eri_gtbl.c",
          34);
  fprintf(stderr, "   undefined type (%d)\n", type);
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<nonzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1174 <nonzero+0x54>
jmp    1148 <nonzero+0x28>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
jne    11db <nonzero+0xbb>
jmp    1159 <nonzero+0x39>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    121f <nonzero+0xff>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     11cb <nonzero+0xab>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     11cb <nonzero+0xab>
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
sub    -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     11cb <nonzero+0xab>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    121f <nonzero+0xff>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
lea    0xe23(%rip),%rdx
mov    $0x22,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2ddb(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonzero>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%ecx
je     1139 <nonzero+0x19>
mov    %ecx,%ebx
cmp    $0x2,%ecx
jne    1167 <nonzero+0x47>
add    %esi,%edx
cmp    %edi,%edx
sete   %al
jmp    115c <nonzero+0x3c>
lea    (%rdx,%rsi,1),%eax
cmp    %edi,%eax
sete   %cl
mov    %esi,%ebx
sub    %edx,%ebx
cmp    %edi,%ebx
sete   %bl
or     %cl,%bl
sub    %esi,%edx
cmp    %edi,%edx
sete   %cl
add    %edi,%eax
sete   %al
or     %cl,%al
or     %bl,%al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e72(%rip),%r14
mov    (%r14),%edi
lea    0xe88(%rip),%rsi
lea    0xe96(%rip),%rdx
mov    $0x22,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xf27(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"***ERROR in %s (%d)\0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RafaelDexter/OpenMX/refs/heads/master/source/liberi-091216/source/eri_gtbl.c\00"
@.str.2 = [24 x i8] c" undefined type (%d)\0A\00"
define i32 @nonzero(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
switch i32 %10, label %47 [
i32 2, label %11
i32 1, label %18
]
11: ; preds = %4
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
%16 = icmp eq i32 %12, %15
%17 = zext i1 %16 to i32
store i32 %17, i32* %5
br label %54
18: ; preds = %4
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = add nsw i32 %20, %21
%23 = icmp eq i32 %19, %22
br i1 %23, label %44, label %24
24: ; preds = %18
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = sub nsw i32 %26, %27
%29 = icmp eq i32 %25, %28
br i1 %29, label %44, label %30
30: ; preds = %24
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = sub nsw i32 0, %32
%34 = load i32, i32* %8
%35 = add nsw i32 %33, %34
%36 = icmp eq i32 %31, %35
br i1 %36, label %44, label %37
37: ; preds = %30
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = sub nsw i32 0, %39
%41 = load i32, i32* %8
%42 = sub nsw i32 %40, %41
%43 = icmp eq i32 %38, %42
br label %44
44: ; preds = %37, %30, %24, %18
%45 = phi i1 [ true, %30 ], [ true, %24 ], [ true, %18 ], [ %43, %37 ]
%46 = zext i1 %45 to i32
store i32 %46, i32* %5
br label %54
47: ; preds = %4
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0), i32 34)
%50 = load i32, i32* @stderr
%51 = load i32, i32* %9
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%53 = call i32 (...) @abort()
unreachable
54: ; preds = %44, %11
%55 = load i32, i32* %5
ret i32 %55
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"***ERROR in %s (%d)\0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RafaelDexter/OpenMX/refs/heads/master/source/liberi-091216/source/eri_gtbl.c\00"
@.str.2 = [24 x i8] c" undefined type (%d)\0A\00"
define i32 @nonzero(i32 %0, i32 %1, i32 %2, i32 %3) {
switch i32 %3, label %20 [
i32 2, label %5
i32 1, label %8
]
5: ; preds = %4
%6 = add nsw i32 %2, %1
%7 = icmp eq i32 %6, %0
br label %26
8: ; preds = %4
%9 = add i32 %2, %1
%10 = icmp eq i32 %9, %0
%11 = sub nsw i32 %1, %2
%12 = icmp eq i32 %11, %0
%13 = select i1 %10, i1 true, i1 %12
%14 = sub i32 %2, %1
%15 = icmp eq i32 %14, %0
%16 = or i1 %15, %13
%17 = sub i32 0, %9
%18 = icmp eq i32 %17, %0
%19 = or i1 %18, %16
br label %26
20: ; preds = %4
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0), i32 34)
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%25 = tail call i32 (...) @abort()
unreachable
26: ; preds = %8, %5
%27 = phi i1 [ %19, %8 ], [ %7, %5 ]
%28 = zext i1 %27 to i32
ret i32 %28
}