#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  printf("\tUso de Operadores Lógicos\n\n");
  printf("Introduce el primer valor: ");
  scanf("%d", &a);
  printf("Introduce el segundo valor: ");
  scanf("%d", &b);
  printf("a && b = %d\n", a && b);
  printf("!(a && b) = %d\n", !(a && b));
  printf("a || b = %d\n", a || b);
  printf("!(a || b) = %d\n", !(a || b));
  printf("\nFin del Programa\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1192 <main+0x72>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
je     11c1 <main+0xa1>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xf(%rbp)
jne    11f2 <main+0xd2>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x10(%rbp)
jne    1221 <main+0x101>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x10(%rbp)
mov    -0x10(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec6(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
setne  %al
cmpl   $0x0,0x8(%rsp)
setne  %cl
and    %al,%cl
movzbl %cl,%esi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0xc(%rsp)
sete   %al
cmpl   $0x0,0x8(%rsp)
sete   %cl
or     %al,%cl
movzbl %cl,%esi
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
xor    %esi,%esi
or     0x8(%rsp),%eax
setne  %sil
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
xor    %esi,%esi
or     0x8(%rsp),%eax
sete   %sil
lea    0xe71(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\09Uso de Operadores L\C3\B3gicos\0A\0A\00"
@.str.1 = [28 x i8] c"Introduce el primer valor: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [29 x i8] c"Introduce el segundo valor: \00"
@.str.4 = [13 x i8] c"a && b = %d\0A\00"
@.str.5 = [16 x i8] c"!(a && b) = %d\0A\00"
@.str.6 = [13 x i8] c"a || b = %d\0A\00"
@.str.7 = [16 x i8] c"!(a || b) = %d\0A\00"
@.str.8 = [19 x i8] c"\0AFin del Programa\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %11, %0
%15 = phi i1 [ false, %0 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %20, %14
%24 = phi i1 [ false, %14 ], [ %22, %20 ]
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %2
%29 = icmp ne i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %23
%31 = load i32, i32* %3
%32 = icmp ne i32 %31, 0
br label %33
33: ; preds = %30, %23
%34 = phi i1 [ true, %23 ], [ %32, %30 ]
%35 = zext i1 %34 to i32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %2
%38 = icmp ne i32 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %33
%40 = load i32, i32* %3
%41 = icmp ne i32 %40, 0
br label %42
42: ; preds = %39, %33
%43 = phi i1 [ true, %33 ], [ %41, %39 ]
%44 = xor i1 %43, true
%45 = zext i1 %44 to i32
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Introduce el primer valor: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [29 x i8] c"Introduce el segundo valor: \00"
@.str.4 = [13 x i8] c"a && b = %d\0A\00"
@.str.5 = [16 x i8] c"!(a && b) = %d\0A\00"
@.str.6 = [13 x i8] c"a || b = %d\0A\00"
@.str.7 = [16 x i8] c"!(a || b) = %d\0A\00"
@str = [29 x i8] c"\09Uso de Operadores L\C3\B3gicos\0A\00"
@str.9 = [18 x i8] c"\0AFin del Programa\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 0
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
%14 = select i1 %11, i1 %13, i1 false
%15 = zext i1 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %1
%18 = icmp eq i32 %17, 0
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 0
%21 = select i1 %18, i1 true, i1 %20
%22 = zext i1 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %1
%25 = icmp ne i32 %24, 0
%26 = load i32, i32* %2
%27 = icmp ne i32 %26, 0
%28 = select i1 %25, i1 true, i1 %27
%29 = zext i1 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %1
%32 = icmp eq i32 %31, 0
%33 = load i32, i32* %2
%34 = icmp eq i32 %33, 0
%35 = select i1 %32, i1 %34, i1 false
%36 = zext i1 %35 to i32
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 %36)
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
ret i32 0
}