#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*/ assert(int);
char getch();
int getint(int *);
int main(int argc, char *argv[]) {
  int i;
  assert(getint(&i));
  assert(i == 0);
  assert(getint(&i));
  assert(i == 0);
  assert(getint(&i));
  assert(i == 123);
  assert(getint(&i));
  assert(i == -123);
  assert(!getint(&i));
  assert(getch() == '+');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x14(%rbp),%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x14(%rbp),%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
cmpl   $0x7b,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x14(%rbp),%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
cmpl   $0xffffff85,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x14(%rbp),%rdi
call   1030 <getint@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x7b,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <getint@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0xffffff85,0xc(%rsp)
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <getint@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %edi,%edi
cmp    $0x2b,%al
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @getint(i32* %5)
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @getint(i32* %5)
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @getint(i32* %5)
%19 = call i32 @assert(i32 %18)
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 123
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = call i32 @getint(i32* %5)
%25 = call i32 @assert(i32 %24)
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, -123
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = call i32 @getint(i32* %5)
%31 = icmp ne i32 %30, 0
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call signext i8 (...) @getch()
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 43
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @getint(i32* %3)
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @getint(i32* %3)
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @getint(i32* %3)
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 123
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @getint(i32* %3)
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, -123
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call i32 @getint(i32* %3)
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call signext i8 (...) @getch()
%34 = icmp eq i8 %33, 43
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
ret i32 0
}