#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*/ f(int);
int /*<<< orphan*/ free(char *);
float g(double, double);
char *h(int, double, char);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int a = 20;
  int b = 10;
  int c = 15;
  int d = 5;
  int e;
  e = (a + b) * c / d;
  printf("(a + b) * c / d = %d\n", e);
  e = ((a + b) * c) / d;
  printf("((a + b) * c) / d = %d\n", e);
  e = (a + b) * (c / d);
  printf("(a + b) * (c / d) = %d\n", e);
  e = a + (b * c) / d;
  printf("a + (b * c) / d = %d\n", e);
  printf("\n\n");
  f(27);
  printf("\n\n");
  float x = g(1.9, 6.6);
  printf("%f\n", x);
  printf("\n\n");
  char *y = h(4, 2.5, '$');
  printf("%s\n", y);
  free(y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
movl   $0x5,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1b,%edi
call   1050 <f@plt>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsd  0xdbc(%rip),%xmm0
movsd  0xdbc(%rip),%xmm1
call   1070 <g@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe09(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x4,%edi
movsd  0xd70(%rip),%xmm0
mov    $0x24,%esi
call   1040 <h@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb0(%rip),%rdi
mov    $0x5a,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x5a,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x5a,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x32,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xea8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1b,%edi
call   1060 <f@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
movsd  0xe2a(%rip),%xmm0
movsd  0xe2a(%rip),%xmm1
call   1080 <g@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
movsd  0xe0b(%rip),%xmm0
mov    $0x4,%edi
mov    $0x24,%esi
call   1050 <h@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"(a + b) * c / d = %d\0A\00"
@.str.1 = [24 x i8] c"((a + b) * c) / d = %d\0A\00"
@.str.2 = [24 x i8] c"(a + b) * (c / d) = %d\0A\00"
@.str.3 = [22 x i8] c"a + (b * c) / d = %d\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %6
store i32 10, i32* %7
store i32 15, i32* %8
store i32 5, i32* %9
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %8
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %9
%19 = sdiv i32 %17, %18
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %8
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %9
%28 = sdiv i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %10
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %9
%36 = sdiv i32 %34, %35
%37 = mul nsw i32 %33, %36
store i32 %37, i32* %10
%38 = load i32, i32* %10
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = load i32, i32* %8
%43 = mul nsw i32 %41, %42
%44 = load i32, i32* %9
%45 = sdiv i32 %43, %44
%46 = add nsw i32 %40, %45
store i32 %46, i32* %10
%47 = load i32, i32* %10
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 @f(i32 27)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%52 = call float @g(double 1.900000e+00, double 6.600000e+00)
store float %52, float* %11
%53 = load float, float* %11
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%57 = call i8* @h(i32 4, double 2.500000e+00, i8 signext 36)
store i8* %57, i8** %12
%58 = load i8*, i8** %12
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %58)
%60 = load i8*, i8** %12
%61 = call i32 @free(i8* %60)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"(a + b) * c / d = %d\0A\00"
@.str.1 = [24 x i8] c"((a + b) * c) / d = %d\0A\00"
@.str.2 = [24 x i8] c"(a + b) * (c / d) = %d\0A\00"
@.str.3 = [22 x i8] c"a + (b * c) / d = %d\0A\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@str.8 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 90)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 90)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 90)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 50)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 @f(i32 27)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%10 = tail call float @g(double 1.900000e+00, double 6.600000e+00)
%11 = fpext float %10 to double
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %11)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%14 = tail call i8* @h(i32 4, double 2.500000e+00, i8 signext 36)
%15 = tail call i32 @puts(i8* dereferenceable(1) %14)
%16 = tail call i32 @free(i8* %14)
ret i32 0
}