#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 */
char EOF;
int /*<<< orphan*/ printf(char *, ...);
main() {
  int i, lim;
  char c;
  i = 10;
  lim = 100;
  c = '\n';
  if (i < lim - 1 && c != '\n' && c != EOF)
    printf("AND:true\n");
  else
    printf("AND:false\n");
  if (i < lim - 1 || c != '\n' || c != EOF)
    printf("OR:true\n");
  else
    printf("OR:false\n");
  lim = !i;
  printf("lim = %d\n", lim);
  if (lim)
    printf("lim is true\n");
  if (lim == 0)
    printf("lim is false\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
movb   $0xa,-0xd(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1178 <main+0x68>
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
je     1178 <main+0x68>
movsbl -0xd(%rbp),%eax
mov    0x2e8e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1178 <main+0x68>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1186 <main+0x76>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     11ba <main+0xaa>
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
jne    11ba <main+0xaa>
movsbl -0xd(%rbp),%eax
mov    0x2e39(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11cd <main+0xbd>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xcb>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1215 <main+0x105>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    122d <main+0x11d>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [10 x i8] c"AND:true\0A\00"
@.str.1 = [11 x i8] c"AND:false\0A\00"
@.str.2 = [9 x i8] c"OR:true\0A\00"
@.str.3 = [10 x i8] c"OR:false\0A\00"
@.str.4 = [10 x i8] c"lim = %d\0A\00"
@.str.5 = [13 x i8] c"lim is true\0A\00"
@.str.6 = [14 x i8] c"lim is false\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
store i32 10, i32* %2
store i32 100, i32* %3
store i8 10, i8* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %21
9: ; preds = %0
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = load i8, i8* @EOF
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %23
21: ; preds = %13, %9, %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, 1
%27 = icmp slt i32 %24, %26
br i1 %27, label %38, label %28
28: ; preds = %23
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 10
br i1 %31, label %38, label %32
32: ; preds = %28
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
%35 = load i8, i8* @EOF
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %34, %36
br i1 %37, label %38, label %40
38: ; preds = %32, %28, %23
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %42
40: ; preds = %32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40, %38
%43 = load i32, i32* %2
%44 = icmp ne i32 %43, 0
%45 = xor i1 %44, true
%46 = zext i1 %45 to i32
store i32 %46, i32* %3
%47 = load i32, i32* %3
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %3
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %42
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %53
53: ; preds = %51, %42
%54 = load i32, i32* %3
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %58
58: ; preds = %56, %53
%59 = load i32, i32* %1
ret i32 %59
}

LLVM IR (-O2):
@EOF = global i8 0
@.str.4 = [10 x i8] c"lim = %d\0A\00"
@str = [10 x i8] c"AND:false\00"
@str.7 = [8 x i8] c"OR:true\00"
@str.8 = [13 x i8] c"lim is false\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.7, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}