#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);
int main(void) {
  int a = 100;
  int b = 2;
  int c = 25;
  int d = 4;
  int result;
  result = a - b;
  printf("a - b = %i\n", result);
  result = b * c;
  printf("b * c = %i\n", result);
  result = a / c;
  printf("a / c = %i\n", result);
  result = a + b * c;
  printf("a + b * c  = %i\n", result);
  printf("a * b + c * d  = %i\n", a * b + c * d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x64,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x19,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
imul   -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
add    %eax,%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x62,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x32,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x96,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x12c,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"a - b = %i\0A\00"
@.str.1 = [12 x i8] c"b * c = %i\0A\00"
@.str.2 = [12 x i8] c"a / c = %i\0A\00"
@.str.3 = [17 x i8] c"a + b * c = %i\0A\00"
@.str.4 = [21 x i8] c"a * b + c * d = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 100, i32* %1
store i32 2, i32* %2
store i32 25, i32* %3
store i32 4, i32* %4
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %1
%17 = load i32, i32* %3
%18 = sdiv i32 %16, %17
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = mul nsw i32 %22, %23
%25 = add nsw i32 %21, %24
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = mul nsw i32 %28, %29
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = mul nsw i32 %31, %32
%34 = add nsw i32 %30, %33
%35 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a - b = %i\0A\00"
@.str.1 = [12 x i8] c"b * c = %i\0A\00"
@.str.2 = [12 x i8] c"a / c = %i\0A\00"
@.str.3 = [17 x i8] c"a + b * c = %i\0A\00"
@.str.4 = [21 x i8] c"a * b + c * d = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 98)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 50)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 150)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 300)
ret i32 0
}