#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*/ barrier();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(void) {
  volatile int a = 0;
  volatile long long int b = 0;
  volatile unsigned int c = 1;
  barrier();
  fputs("1st\n", stderr);
  barrier();
  a / b;
  barrier();
  fputs("2nd\n", stderr);
  barrier();
  0 / 0;
  barrier();
  fputs("3rd\n", stderr);
  barrier();
  a / 0;
  barrier();
  fputs("4th\n", stderr);
  barrier();
  0 / b;
  barrier();
  fputs("5th\n", stderr);
  barrier();
  2 / --c;
  barrier();
  fputs("6th\n", stderr);
  barrier();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    $0x0,%al
call   1030 <barrier@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xea4(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rax
mov    $0x0,%al
call   1030 <barrier@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%esi
lea    0xe7f(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%esi
lea    0xe61(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
mov    -0x8(%rbp),%eax
mov    $0x0,%al
call   1030 <barrier@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%esi
lea    0xe40(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
mov    -0x10(%rbp),%rax
mov    $0x0,%al
call   1030 <barrier@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%esi
lea    0xe1e(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <barrier@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%esi
lea    0xdf7(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <barrier@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movl   $0x1,0x4(%rsp)
xor    %eax,%eax
call   1030 <barrier@plt>
mov    0x2e95(%rip),%rbx
mov    (%rbx),%esi
lea    0xeac(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <barrier@plt>
mov    (%rsp),%eax
mov    0x8(%rsp),%rax
xor    %eax,%eax
call   1030 <barrier@plt>
mov    (%rbx),%esi
lea    0xe8d(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <barrier@plt>
xor    %eax,%eax
call   1030 <barrier@plt>
mov    (%rbx),%esi
lea    0xe76(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <barrier@plt>
mov    (%rsp),%eax
xor    %eax,%eax
call   1030 <barrier@plt>
mov    (%rbx),%esi
lea    0xe5c(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <barrier@plt>
mov    0x8(%rsp),%rax
xor    %eax,%eax
call   1030 <barrier@plt>
mov    (%rbx),%esi
lea    0xe40(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <barrier@plt>
addl   $0xffffffff,0x4(%rsp)
xor    %eax,%eax
call   1030 <barrier@plt>
mov    (%rbx),%esi
lea    0xe24(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <barrier@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"1st\0A\00"
@stderr = global i32 0
@.str.1 = [5 x i8] c"2nd\0A\00"
@.str.2 = [5 x i8] c"3rd\0A\00"
@.str.3 = [5 x i8] c"4th\0A\00"
@.str.4 = [5 x i8] c"5th\0A\00"
@.str.5 = [5 x i8] c"6th\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
store volatile i64 0, i64* %3
store volatile i32 1, i32* %4
%5 = call i32 (...) @barrier()
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @barrier()
%9 = load volatile i32, i32* %2
%10 = sext i32 %9 to i64
%11 = load volatile i64, i64* %3
%12 = sdiv i64 %10, %11
%13 = call i32 (...) @barrier()
%14 = load i32, i32* @stderr
%15 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 (...) @barrier()
%17 = call i32 (...) @barrier()
%18 = load i32, i32* @stderr
%19 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = call i32 (...) @barrier()
%21 = load volatile i32, i32* %2
%22 = sdiv i32 %21, 0
%23 = call i32 (...) @barrier()
%24 = load i32, i32* @stderr
%25 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = call i32 (...) @barrier()
%27 = load volatile i64, i64* %3
%28 = sdiv i64 0, %27
%29 = call i32 (...) @barrier()
%30 = load i32, i32* @stderr
%31 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = call i32 (...) @barrier()
%33 = load volatile i32, i32* %4
%34 = add i32 %33, -1
store volatile i32 %34, i32* %4
%35 = udiv i32 2, %34
%36 = call i32 (...) @barrier()
%37 = load i32, i32* @stderr
%38 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %37)
%39 = call i32 (...) @barrier()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"1st\0A\00"
@stderr = global i32 0
@.str.1 = [5 x i8] c"2nd\0A\00"
@.str.2 = [5 x i8] c"3rd\0A\00"
@.str.3 = [5 x i8] c"4th\0A\00"
@.str.4 = [5 x i8] c"5th\0A\00"
@.str.5 = [5 x i8] c"6th\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%5 = bitcast i64* %2 to i8*
store volatile i64 0, i64* %2
%6 = bitcast i32* %3 to i8*
store volatile i32 1, i32* %3
%7 = tail call i32 (...) @barrier()
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @barrier()
%11 = load volatile i32, i32* %1
%12 = load volatile i64, i64* %2
%13 = tail call i32 (...) @barrier()
%14 = load i32, i32* @stderr
%15 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = tail call i32 (...) @barrier()
%17 = tail call i32 (...) @barrier()
%18 = load i32, i32* @stderr
%19 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = tail call i32 (...) @barrier()
%21 = load volatile i32, i32* %1
%22 = tail call i32 (...) @barrier()
%23 = load i32, i32* @stderr
%24 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = tail call i32 (...) @barrier()
%26 = load volatile i64, i64* %2
%27 = tail call i32 (...) @barrier()
%28 = load i32, i32* @stderr
%29 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %28)
%30 = tail call i32 (...) @barrier()
%31 = load volatile i32, i32* %3
%32 = add i32 %31, -1
store volatile i32 %32, i32* %3
%33 = tail call i32 (...) @barrier()
%34 = load i32, i32* @stderr
%35 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %34)
%36 = tail call i32 (...) @barrier()
ret i32 0
}