#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 rnd(int);
int /*<<< orphan*/ showtext();
int /*<<< orphan*/ tnou(char *);
int /*<<< orphan*/ tnoua(char *);
int /*<<< orphan*/ tonl(int);
void news() {
  int r;
  r = rnd(4);
  if (r % 4 == 0) {
    tonl(1);
    tnou("==================================================");
    tonl(1);
    tnou("**** CHIMAERA NEWS FLASH ****");
    tonl(1);
    tnou("Having trouble with space and time? If so use");
    tnoua("WHERE and TIME to get a fix!");
    tonl(1);
    tnoua("The dwarves seem more aggressive these days,");
    tnou("you had better find out how to get rid of them!");
    tnoua("Flickering lamps cannot be relit indefinitely,");
    tnou("you must find a more permanent solution!");
    tonl(1);
    tnoua("Help is precious, away from your camp you can only");
    tnoua("use it twice. Save it for real emergencies only or you may ");
    tnoua("get completely stuck underground. There is also a magic");
    tnou("word to assist you, but few people have discovered it!!");
    tonl(1);
    showtext();
  }
}


x86 assembly (clang, -O0):
<news>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <rnd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    124c <news+0xfc>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xe76(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xe93(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xe9b(%rip),%rdi
call   1050 <tnou@plt>
lea    0xebd(%rip),%rdi
call   1070 <tnoua@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xec4(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xee5(%rip),%rdi
call   1050 <tnou@plt>
lea    0xf09(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xf2c(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xf3f(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xf66(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xf96(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xfc2(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
mov    $0x0,%al
call   1060 <showtext@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<news>:
push   %rax
mov    $0x4,%edi
call   1040 <rnd@plt>
test   $0x3,%al
je     1161 <news+0x11>
pop    %rax
ret
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xe8e(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xeab(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xeb3(%rip),%rdi
call   1050 <tnou@plt>
lea    0xed5(%rip),%rdi
call   1070 <tnoua@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xedc(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xefd(%rip),%rdi
call   1050 <tnou@plt>
lea    0xf21(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xf44(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
lea    0xf57(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xf7e(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xfae(%rip),%rdi
call   1070 <tnoua@plt>
lea    0xfda(%rip),%rdi
call   1050 <tnou@plt>
mov    $0x1,%edi
call   1030 <tonl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <showtext@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"==================================================\00"
@.str.1 = [30 x i8] c"**** CHIMAERA NEWS FLASH ****\00"
@.str.2 = [46 x i8] c"Having trouble with space and time? If so use\00"
@.str.3 = [29 x i8] c"WHERE and TIME to get a fix!\00"
@.str.4 = [45 x i8] c"The dwarves seem more aggressive these days,\00"
@.str.5 = [48 x i8] c"you had better find out how to get rid of them!\00"
@.str.6 = [47 x i8] c"Flickering lamps cannot be relit indefinitely,\00"
@.str.7 = [41 x i8] c"you must find a more permanent solution!\00"
@.str.8 = [51 x i8] c"Help is precious, away from your camp you can only\00"
@.str.9 = [60 x i8] c"use it twice. Save it for real emergencies only or you may \00"
@.str.10 = [56 x i8] c"get completely stuck underground. There is also a magic\00"
@.str.11 = [56 x i8] c"word to assist you, but few people have discovered it!!\00"
define void @news() {
%1 = alloca i32
%2 = call i32 @rnd(i32 4)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %26
6: ; preds = %0
%7 = call i32 @tonl(i32 1)
%8 = call i32 @tnou(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @tonl(i32 1)
%10 = call i32 @tnou(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @tonl(i32 1)
%12 = call i32 @tnou(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @tnoua(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @tonl(i32 1)
%15 = call i32 @tnoua(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @tnou(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @tnoua(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @tnou(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @tonl(i32 1)
%20 = call i32 @tnoua(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 @tnoua(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0))
%22 = call i32 @tnoua(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0))
%23 = call i32 @tnou(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0))
%24 = call i32 @tonl(i32 1)
%25 = call i32 (...) @showtext()
br label %26
26: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"==================================================\00"
@.str.1 = [30 x i8] c"**** CHIMAERA NEWS FLASH ****\00"
@.str.2 = [46 x i8] c"Having trouble with space and time? If so use\00"
@.str.3 = [29 x i8] c"WHERE and TIME to get a fix!\00"
@.str.4 = [45 x i8] c"The dwarves seem more aggressive these days,\00"
@.str.5 = [48 x i8] c"you had better find out how to get rid of them!\00"
@.str.6 = [47 x i8] c"Flickering lamps cannot be relit indefinitely,\00"
@.str.7 = [41 x i8] c"you must find a more permanent solution!\00"
@.str.8 = [51 x i8] c"Help is precious, away from your camp you can only\00"
@.str.9 = [60 x i8] c"use it twice. Save it for real emergencies only or you may \00"
@.str.10 = [56 x i8] c"get completely stuck underground. There is also a magic\00"
@.str.11 = [56 x i8] c"word to assist you, but few people have discovered it!!\00"
define void @news() {
%1 = tail call i32 @rnd(i32 4)
%2 = and i32 %1, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %24
4: ; preds = %0
%5 = tail call i32 @tonl(i32 1)
%6 = tail call i32 @tnou(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @tonl(i32 1)
%8 = tail call i32 @tnou(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @tonl(i32 1)
%10 = tail call i32 @tnou(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @tnoua(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @tonl(i32 1)
%13 = tail call i32 @tnoua(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 @tnou(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%15 = tail call i32 @tnoua(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%16 = tail call i32 @tnou(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%17 = tail call i32 @tonl(i32 1)
%18 = tail call i32 @tnoua(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%19 = tail call i32 @tnoua(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0))
%20 = tail call i32 @tnoua(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0))
%21 = tail call i32 @tnou(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0))
%22 = tail call i32 @tonl(i32 1)
%23 = tail call i32 (...) @showtext()
br label %24
24: ; preds = %4, %0
ret void
}