#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*/ getchar();
scalar_t__ int_shifts_are_arithmetic();
scalar_t__ int_shifts_are_logical();
scalar_t__ printf(char *);
int main(void) {
  printf("Current C program running on the ");
  (int_shifts_are_logical()) && (printf("machine that use logical shifts.\n"));
  (int_shifts_are_arithmetic()) &&
      (printf("machine that use arithmetic shifts.\n"));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <int_shifts_are_logical@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     118a <main+0x4a>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    $0x0,%al
call   1030 <int_shifts_are_arithmetic@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x6(%rbp)
je     11bc <main+0x7c>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <int_shifts_are_logical@plt>
test   %rax,%rax
je     1175 <main+0x25>
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <int_shifts_are_arithmetic@plt>
test   %rax,%rax
je     118d <main+0x3d>
lea    0xe9a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Current C program running on the \00"
@.str.1 = [34 x i8] c"machine that use logical shifts.\0A\00"
@.str.2 = [37 x i8] c"machine that use arithmetic shifts.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @int_shifts_are_logical()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i64 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br label %8
8: ; preds = %5, %0
%9 = phi i1 [ false, %0 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i64 (...) @int_shifts_are_arithmetic()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = call i64 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %13, %8
%17 = phi i1 [ false, %8 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
%19 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Current C program running on the \00"
@str = [36 x i8] c"machine that use arithmetic shifts.\00"
@str.3 = [33 x i8] c"machine that use logical shifts.\00"
define i32 @main() {
%1 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @int_shifts_are_logical()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = tail call i64 (...) @int_shifts_are_arithmetic()
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = tail call i32 (...) @getchar()
ret i32 0
}