#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 rand();
int main() {
  printf("Testing what macro does in this case: %i\n",
         (15 == 15 ? rand() : rand()));
  printf("%s=%s\n", "rand_r(0.24)", "(0.24 == 0.24 ? rand () : rand ())");
  printf("Testing what macro does in this case:");
  (15.2 == 15.2 ? printf("true\n") : printf("false\n"));
  printf("%s=%s\n", "weird(4)",
         "(4 == 4 ? printf(\"true\\n\") : printf(\"false\\n\"))");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    0xf0c(%rip),%rsi
lea    0xf0e(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rbx
lea    0xedb(%rip),%rsi
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf44(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rsi
lea    0xf01(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Testing what macro does in this case: %i\0A\00"
@.str.1 = [7 x i8] c"%s=%s\0A\00"
@.str.2 = [13 x i8] c"rand_r(0.24)\00"
@.str.3 = [35 x i8] c"(0.24 == 0.24 ? rand () : rand ())\00"
@.str.4 = [38 x i8] c"Testing what macro does in this case:\00"
@.str.5 = [6 x i8] c"true\0A\00"
@.str.6 = [9 x i8] c"weird(4)\00"
@.str.7 = [48 x i8] c"(4 == 4 ? printf(\22true\\n\22) : printf(\22false\\n\22))\00"
define i32 @main() {
%1 = call i32 (...) @rand()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Testing what macro does in this case: %i\0A\00"
@.str.1 = [7 x i8] c"%s=%s\0A\00"
@.str.2 = [13 x i8] c"rand_r(0.24)\00"
@.str.3 = [35 x i8] c"(0.24 == 0.24 ? rand () : rand ())\00"
@.str.4 = [38 x i8] c"Testing what macro does in this case:\00"
@.str.6 = [9 x i8] c"weird(4)\00"
@.str.7 = [48 x i8] c"(4 == 4 ? printf(\22true\\n\22) : printf(\22false\\n\22))\00"
@str = [5 x i8] c"true\00"
define i32 @main() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}