xunge/DecIR huggingface dataset:
void av_opt_set_pixel_fmt() {}


x86 assembly (clang, -O0):
<av_opt_set_pixel_fmt>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_opt_set_pixel_fmt>:
ret

LLVM IR (-O0):
define void @av_opt_set_pixel_fmt() {
ret void
}

LLVM IR (-O2):
define void @av_opt_set_pixel_fmt() {
ret void
}
/* Variables and functions */
int dal_reg_tbl_read(unsigned int, unsigned int, unsigned int *, unsigned int);
int emac2_reg_tbl_get(unsigned int dev_id, unsigned int reg_addr,
                      unsigned int *pvalue, unsigned int width) {
  return dal_reg_tbl_read(dev_id, reg_addr + 0x108000, pvalue, width);
}


x86 assembly (clang, -O0):
<emac2_reg_tbl_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x108000,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <dal_reg_tbl_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emac2_reg_tbl_get>:
add    $0x108000,%esi
jmp    1030 <dal_reg_tbl_read@plt>

LLVM IR (-O0):
define i32 @emac2_reg_tbl_get(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %10, 1081344
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = call i32 @dal_reg_tbl_read(i32 %9, i32 %11, i32* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @emac2_reg_tbl_get(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = add i32 %1, 1081344
%6 = tail call i32 @dal_reg_tbl_read(i32 %0, i32 %5, i32* %2, i32 %3)
ret i32 %6
}
int intSize() {
  int intArray[10];
  int *intPtr1;
  int *intPtr2;
  intPtr1 = intArray;
  intPtr2 = intArray + 1;
  return (long)intPtr2 + (~(long)intPtr1 + 1);
}


x86 assembly (clang, -O0):
<intSize>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
add    $0x1,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intSize>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @intSize() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = alloca i32*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %2
%10 = ptrtoint i32* %9 to i64
%11 = xor i64 %10, -1
%12 = add nsw i64 %11, 1
%13 = add nsw i64 %8, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @intSize() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ SETHLm(int);
void SET5HLm() { SETHLm(0x20); }


x86 assembly (clang, -O0):
<SET5HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <SETHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SET5HLm>:
mov    $0x20,%edi
jmp    1030 <SETHLm@plt>

LLVM IR (-O0):
define void @SET5HLm() {
%1 = call i32 @SETHLm(i32 32)
ret void
}

LLVM IR (-O2):
define void @SET5HLm() {
%1 = tail call i32 @SETHLm(i32 32)
ret void
}
src() {}


x86 assembly (clang, -O0):
<src>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<src>:
ret

LLVM IR (-O0):
define i32 @src() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @src() {
ret i32 undef
}
int main() {
  int a = 1;
  int b = -a - 10;
  return b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xfffffff5,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = sub nsw i32 %5, 10
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 -11
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int list_comparator_uint32_t(const void *a, const void *b) {
  return (*(uint32_t *)a < *(uint32_t *)b) - (*(uint32_t *)a > *(uint32_t *)b);
}


x86 assembly (clang, -O0):
<list_comparator_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_uint32_t>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_uint32_t(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp slt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp sgt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_uint32_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _scan_nan(int *, int, char const *);
float nanf(const char *s) {
  union {
    float f;
    uint32_t bits[1];
  } u;
  _scan_nan(u.bits, 1, s);
  u.bits[0] |= 0x7fc00000;
  return (u.f);
}


x86 assembly (clang, -O0):
<nanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1,%esi
call   1030 <_scan_nan@plt>
mov    -0x10(%rbp),%eax
or     $0x7fc00000,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanf>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <_scan_nan@plt>
mov    $0x7fc00000,%eax
or     (%rsp),%eax
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @nanf(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = bitcast %union.anon* %3 to [1 x i32]*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @_scan_nan(i32* %5, i32 1, i8* %6)
%8 = bitcast %union.anon* %3 to [1 x i32]*
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %8, i64 0, i64 0
%10 = load i32, i32* %9
%11 = or i32 %10, 2143289344
store i32 %11, i32* %9
%12 = bitcast %union.anon* %3 to float*
%13 = load float, float* %12
ret float %13
}

LLVM IR (-O2):
%union.anon = type { float }
define float @nanf(i8* %0) {
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i8*
%4 = bitcast %union.anon* %2 to i32*
%5 = call i32 @_scan_nan(i32* %4, i32 1, i8* %0)
%6 = load i32, i32* %4
%7 = or i32 %6, 2143289344
%8 = bitcast i32 %7 to float
ret float %8
}
void motorSpeed(int speed) {}


x86 assembly (clang, -O0):
<motorSpeed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<motorSpeed>:
ret

LLVM IR (-O0):
define void @motorSpeed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @motorSpeed(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand48(unsigned int);
extern __attribute__((gnu_)) void srand(unsigned int __s) { srand48(__s); }


x86 assembly (clang, -O0):
<srand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <srand48@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srand>:
jmp    1030 <srand48@plt>

LLVM IR (-O0):
define void @srand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @srand48(i32 %3)
ret void
}

LLVM IR (-O2):
define void @srand(i32 %0) {
%2 = tail call i32 @srand48(i32 %0)
ret void
}
void setNextContext(int *context, int *next) { *context = (int)next; }


x86 assembly (clang, -O0):
<setNextContext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNextContext>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @setNextContext(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = ptrtoint i32* %5 to i32
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @setNextContext(i32* nocapture writeonly %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
store i32 %4, i32* %0
ret void
}
int create_connect() {}


x86 assembly (clang, -O0):
<create_connect>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_connect>:
ret

LLVM IR (-O0):
define i32 @create_connect() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @create_connect() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ write_break();
int /*<<< orphan*/ write_line(char *);
int /*<<< orphan*/ write_nl();
void latex_itemize(void) {
  write_break();
  write_line("\\begin{itemize}");
  write_nl();
}


x86 assembly (clang, -O0):
<latex_itemize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <write_break@plt>
lea    0xebe(%rip),%rdi
call   1050 <write_line@plt>
mov    $0x0,%al
call   1030 <write_nl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<latex_itemize>:
push   %rax
xor    %eax,%eax
call   1040 <write_break@plt>
lea    0xec1(%rip),%rdi
call   1050 <write_line@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <write_nl@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\\begin{itemize}\00"
define void @latex_itemize() {
%1 = call i32 (...) @write_break()
%2 = call i32 @write_line(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @write_nl()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\\begin{itemize}\00"
define void @latex_itemize() {
%1 = tail call i32 (...) @write_break()
%2 = tail call i32 @write_line(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @write_nl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testParser(char *);
int /*<<< orphan*/ testParserMany();
int main(int argc, char *argv[]) {
  if (argc > 1)
    testParser(argv[1]);
  else
    testParserMany();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <testParser@plt>
jmp    1159 <main+0x39>
mov    $0x0,%al
call   1040 <testParserMany@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1030 <testParser@plt>
jmp    1138 <main+0x18>
xor    %eax,%eax
call   1040 <testParserMany@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @testParser(i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (...) @testParserMany()
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @testParser(i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @testParserMany()
br label %10
10: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
int RAND_bytes(unsigned char *, size_t);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void random_bytes(unsigned char *p, size_t len) {
  if (RAND_bytes(p, len) != 1) {
    fprintf(stderr, "RAND_bytes failed\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<random_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <RAND_bytes@plt>
cmp    $0x1,%eax
je     1172 <random_bytes+0x42>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bytes>:
push   %rax
call   1040 <RAND_bytes@plt>
cmp    $0x1,%eax
jne    113d <random_bytes+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"RAND_bytes failed\0A\00"
define void @random_bytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @RAND_bytes(i8* %5, i64 %6)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"RAND_bytes failed\0A\00"
define void @random_bytes(i8* %0, i64 %1) {
%3 = tail call i32 @RAND_bytes(i8* %0, i64 %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret void
}
int test_imm_EBuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xeb,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBuint64_lowword_reg>:
test   $0xeb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EBuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 235
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_EBuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 235
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void _ovly_debug_event(void) {}


x86 assembly (clang, -O0):
<_ovly_debug_event>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ovly_debug_event>:
ret

LLVM IR (-O0):
define void @_ovly_debug_event() {
ret void
}

LLVM IR (-O2):
define void @_ovly_debug_event() {
ret void
}
/* Type definitions */
struct grid_epbase {
  int dummy;
};

/* Variables and functions */
int grid_bipc_create(void *, struct grid_epbase **);
int grid_ipc_bind(void *hint, struct grid_epbase **epbase) {
  return grid_bipc_create(hint, epbase);
}


x86 assembly (clang, -O0):
<grid_ipc_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <grid_bipc_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_ipc_bind>:
jmp    1030 <grid_bipc_create@plt>

LLVM IR (-O0):
%struct.grid_epbase = type { i32 }
define i32 @grid_ipc_bind(i8* %0, %struct.grid_epbase** %1) {
%3 = alloca i8*
%4 = alloca %struct.grid_epbase**
store i8* %0, i8** %3
store %struct.grid_epbase** %1, %struct.grid_epbase*** %4
%5 = load i8*, i8** %3
%6 = load %struct.grid_epbase**, %struct.grid_epbase*** %4
%7 = call i32 @grid_bipc_create(i8* %5, %struct.grid_epbase** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.grid_epbase = type { i32 }
define i32 @grid_ipc_bind(i8* %0, %struct.grid_epbase** %1) {
%3 = tail call i32 @grid_bipc_create(i8* %0, %struct.grid_epbase** %1)
ret i32 %3
}
void *VISA_hndlr(void *arg) {}


x86 assembly (clang, -O0):
<VISA_hndlr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VISA_hndlr>:
ret

LLVM IR (-O0):
define i8* @VISA_hndlr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %2
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @VISA_hndlr(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
float expf(float);
float tanhf(float x) { return (expf(x) - expf(-x)) / (expf(x) + expf(-x)); }


x86 assembly (clang, -O0):
<tanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <expf@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <expf@plt>
movss  -0xc(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x8(%rbp),%xmm0
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanhf>:
sub    $0x38,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <expf@plt>
movss  %xmm0,0xc(%rsp)
movaps 0xed5(%rip),%xmm0
xorps  0x10(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
call   1030 <expf@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movaps 0x10(%rsp),%xmm0
call   1030 <expf@plt>
movss  %xmm0,0x10(%rsp)
movaps 0x20(%rsp),%xmm0
call   1030 <expf@plt>
addss  0x10(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define float @tanhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @expf(float %3)
%5 = load float, float* %2
%6 = fneg float %5
%7 = call float @expf(float %6)
%8 = fsub float %4, %7
%9 = load float, float* %2
%10 = call float @expf(float %9)
%11 = load float, float* %2
%12 = fneg float %11
%13 = call float @expf(float %12)
%14 = fadd float %10, %13
%15 = fdiv float %8, %14
ret float %15
}

LLVM IR (-O2):
define float @tanhf(float %0) {
%2 = tail call float @expf(float %0)
%3 = fneg float %0
%4 = tail call float @expf(float %3)
%5 = fsub float %2, %4
%6 = tail call float @expf(float %0)
%7 = tail call float @expf(float %3)
%8 = fadd float %6, %7
%9 = fdiv float %5, %8
ret float %9
}
void XInternalConnectionNumbers() {}


x86 assembly (clang, -O0):
<XInternalConnectionNumbers>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XInternalConnectionNumbers>:
ret

LLVM IR (-O0):
define void @XInternalConnectionNumbers() {
ret void
}

LLVM IR (-O2):
define void @XInternalConnectionNumbers() {
ret void
}
void tddfunc3(void) {
  int a = 1;
  do {
  } while (0);
  do {
    while (a < 10) {
    }
  } while (0);
  do {
    while (a > 10) {
    }
  } while (a < 10);
}


x86 assembly (clang, -O0):
<tddfunc3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
jmp    1110 <tddfunc3+0x10>
jmp    1115 <tddfunc3+0x15>
jmp    111a <tddfunc3+0x1a>
cmpl   $0xa,-0x4(%rbp)
jge    1129 <tddfunc3+0x29>
jmp    111a <tddfunc3+0x1a>
jmp    112e <tddfunc3+0x2e>
jmp    1133 <tddfunc3+0x33>
jmp    1138 <tddfunc3+0x38>
cmpl   $0xa,-0x4(%rbp)
jle    1147 <tddfunc3+0x47>
jmp    1138 <tddfunc3+0x38>
jmp    114c <tddfunc3+0x4c>
cmpl   $0xa,-0x4(%rbp)
jl     1133 <tddfunc3+0x33>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tddfunc3>:
jmp    1100 <tddfunc3>

LLVM IR (-O0):
define void @tddfunc3() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %0
br label %3
3: ; preds = %2
br label %4
4: ; preds = %3
br label %5
5: ; preds = %8, %4
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %5
br label %5
9: ; preds = %5
br label %10
10: ; preds = %9
br label %11
11: ; preds = %17, %10
br label %12
12: ; preds = %15, %11
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %12
br label %12
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %1
%19 = icmp slt i32 %18, 10
br i1 %19, label %11, label %20
20: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @tddfunc3() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
int usage(const char *s) {
  return fprintf(stderr, "lf.bb: name \"%s\"%s", s,
                 " unknown, valid names are lf.acv, lf.io, lf.lic, lf.con, "
                 "lf.tld, lf.qplay\n"),
         1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xedc(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee8(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"lf.bb: name \22%s\22%s\00"
@.str.1 = [75 x i8] c" unknown, valid names are lf.acv, lf.io, lf.lic, lf.con, lf.tld, lf.qplay\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"lf.bb: name \22%s\22%s\00"
@.str.1 = [75 x i8] c" unknown, valid names are lf.acv, lf.io, lf.lic, lf.con, lf.tld, lf.qplay\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
unsigned int curr_stack_frame_level();
unsigned int getmycontext_level() { return curr_stack_frame_level(); }


x86 assembly (clang, -O0):
<getmycontext_level>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <curr_stack_frame_level@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmycontext_level>:
xor    %eax,%eax
jmp    1030 <curr_stack_frame_level@plt>

LLVM IR (-O0):
define i32 @getmycontext_level() {
%1 = call i32 (...) @curr_stack_frame_level()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getmycontext_level() {
%1 = tail call i32 (...) @curr_stack_frame_level()
ret i32 %1
}
/* Type definitions */
struct pp_set {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pp_set *);
void free_pp_set(struct pp_set *set) { free(set); }


x86 assembly (clang, -O0):
<free_pp_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_pp_set>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.pp_set = type { i32 }
define void @free_pp_set(%struct.pp_set* %0) {
%2 = alloca %struct.pp_set*
store %struct.pp_set* %0, %struct.pp_set** %2
%3 = load %struct.pp_set*, %struct.pp_set** %2
%4 = call i32 @free(%struct.pp_set* %3)
ret void
}

LLVM IR (-O2):
%struct.pp_set = type { i32 }
define void @free_pp_set(%struct.pp_set* nocapture %0) {
%2 = tail call i32 @free(%struct.pp_set* %0)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
int strlen(char *);
char *rtrim(char *str) {
  int p;
  p = strlen(str) - 1;
  while (isspace(str[p]))
    p--;
  str[p + 1] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<rtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1164 <rtrim+0x44>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <rtrim+0x1b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrim>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
cltq
lea    (%rax,%r14,1),%rbx
add    $0xffffffffffffffff,%rbx
shl    $0x20,%rax
movabs $0x100000000,%r15
add    %rax,%r15
movabs $0xffffffff00000000,%r12
ff ff ff
cs nopw 0x0(%rax,%rax,1)
nop
add    %r12,%r15
movsbl (%rbx),%edi
call   1040 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1160 <rtrim+0x40>
sar    $0x20,%r15
movb   $0x0,(%r14,%r15,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @rtrim(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %15, %1
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = call i64 @isspace(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
br label %7
18: ; preds = %7
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @rtrim(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %6, %4 ], [ %3, %1 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = shl i64 %5, 32
%13 = ashr exact i64 %12, 32
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
ret i8* %0
}
void nilFB(void) {}


x86 assembly (clang, -O0):
<nilFB>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nilFB>:
ret

LLVM IR (-O0):
define void @nilFB() {
ret void
}

LLVM IR (-O2):
define void @nilFB() {
ret void
}
int param(int x) { return x + 10; }


x86 assembly (clang, -O0):
<param>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<param>:
lea    0xa(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @param(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
ret i32 %4
}

LLVM IR (-O2):
define i32 @param(i32 %0) {
%2 = add nsw i32 %0, 10
ret i32 %2
}
const char *pcStatic(void) { return "INFO:symbol[pcStatic]"; }


x86 assembly (clang, -O0):
<pcStatic>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcStatic>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"INFO:symbol[pcStatic]\00"
define i8* @pcStatic() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"INFO:symbol[pcStatic]\00"
define i8* @pcStatic() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: gpmult2 [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h] "
                  "g1 g2 groupname.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Usage: gpmult2 [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h] g1 g2 groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Usage: gpmult2 [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h] g1 g2 groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int Operand_uimm16x4_encode(unsigned int *valp) {
  unsigned imm16_0, uimm16x4_0;
  uimm16x4_0 = *valp;
  imm16_0 = (uimm16x4_0 >> 2) & 0xffff;
  *valp = imm16_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm16x4_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x2,%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm16x4_encode>:
mov    (%rdi),%eax
shr    $0x2,%eax
movzwl %ax,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm16x4_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = lshr i32 %7, 2
%9 = and i32 %8, 65535
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm16x4_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 2
%4 = and i32 %3, 65535
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *, int);
void align(int n) { emit("times ($$-$)&%d db 0\n", n - 1); }


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
lea    0xed8(%rip),%rdi
call   1030 <emit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    -0x1(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <emit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"times ($$-$)&%d db 0\0A\00"
define void @align(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = call i32 @emit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"times ($$-$)&%d db 0\0A\00"
define void @align(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @emit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ls(void) { printf("ls not implemented yet\n"); }


x86 assembly (clang, -O0):
<ls>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"ls not implemented yet\0A\00"
define void @ls() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"ls not implemented yet\00"
define void @ls() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, double);
void timer() {
  static clock_t timer = 0;
  if (timer == 0) {
    timer = clock();
  } else {
    printf("Took me %f seconds\n", (double)(clock() - timer) / CLOCKS_PER_SEC);
  }
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f0c(%rip)
jne    1145 <timer+0x25>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,0x2ef8(%rip)
jmp    116f <timer+0x4f>
mov    $0x0,%al
call   1030 <clock@plt>
sub    0x2ee5(%rip),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e89(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rbx
mov    0x2f10(%rip),%rbx
xor    %eax,%eax
call   1030 <clock@plt>
test   %rbx,%rbx
je     1158 <timer+0x38>
sub    0x2efd(%rip),%rax
cvtsi2sd %rax,%xmm0
mov    0x2ea1(%rip),%rax
divsd  (%rax),%xmm0
lea    0xeae(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>
mov    %rax,0x2ed9(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@timer.timer = internal global i64 0
@.str = [20 x i8] c"Took me %f seconds\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @timer() {
%1 = load i64, i64* @timer.timer
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i64 (...) @clock()
store i64 %4, i64* @timer.timer
br label %13
5: ; preds = %0
%6 = call i64 (...) @clock()
%7 = load i64, i64* @timer.timer
%8 = sub nsw i64 %6, %7
%9 = sitofp i64 %8 to double
%10 = load double, double* @CLOCKS_PER_SEC
%11 = fdiv double %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %11)
br label %13
13: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@timer.timer = internal unnamed_addr global i64 0
@.str = [20 x i8] c"Took me %f seconds\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @timer() {
%1 = load i64, i64* @timer.timer
%2 = icmp eq i64 %1, 0
%3 = tail call i64 (...) @clock()
br i1 %2, label %4, label %5
4: ; preds = %0
store i64 %3, i64* @timer.timer
br label %12
5: ; preds = %0
%6 = load i64, i64* @timer.timer
%7 = sub nsw i64 %3, %6
%8 = sitofp i64 %7 to double
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fdiv double %8, %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %10)
br label %12
12: ; preds = %5, %4
ret void
}
void foo(int *p, int (*q)[10], int r[10], int s[10][10]) {
  int a[10], b[10][10];
#pragma omp task depend(inout : p [-1:2])
  ;
#pragma omp task depend(inout : q [-1:2] [2:4])
  ;
#pragma omp task depend(inout : q [-1:2] [-2:4])
  ;
#pragma omp task depend(inout : r [-1:2])
  ;
#pragma omp task depend(inout : s [-1:2] [2:4])
  ;
#pragma omp task depend(inout : s [-1:2] [-2:4])
  ;
#pragma omp task depend(inout : a [-1:2])
  ;
#pragma omp task depend(inout : b [-1:2] [2:4])
  ;
#pragma omp task depend(inout : b [1:2] [-2:4])
  ;
#pragma omp task depend(inout : p [2:-3])
  ;
#pragma omp task depend(inout : q [2:-3][:])
  ;
#pragma omp task depend(inout : q [2:3] [0:-1])
  ;
#pragma omp task depend(inout : r [2:-5])
  ;
#pragma omp task depend(inout : s [2:-5][:])
  ;
#pragma omp task depend(inout : s [2:5] [0:-4])
  ;
#pragma omp task depend(inout : a [2:-5])
  ;
#pragma omp task depend(inout : b [2:-5] [0:10])
  ;
#pragma omp task depend(inout : b [2:5] [0:-4])
  ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
ret

LLVM IR (-O0):
define void @foo(i32* %0, [10 x i32]* %1, i32* %2, [10 x i32]* %3) {
%5 = alloca i32*
%6 = alloca [10 x i32]*
%7 = alloca i32*
%8 = alloca [10 x i32]*
%9 = alloca [10 x i32]
%10 = alloca [10 x [10 x i32]]
store i32* %0, i32** %5
store [10 x i32]* %1, [10 x i32]** %6
store i32* %2, i32** %7
store [10 x i32]* %3, [10 x i32]** %8
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0, [10 x i32]* nocapture %1, i32* nocapture %2, [10 x i32]* nocapture %3) {
ret void
}
/* Variables and functions */
int fileno(int /*<<< orphan*/);
scalar_t__ isatty(int);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ stdin;
int main(int argc, const char **argv) {
  printf("fd %d %s a tty\n", fileno(stdin),
         isatty(fileno(stdin)) ? "is" : "is not");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
mov    -0x14(%rbp),%esi
mov    %rax,%rcx
lea    0xe9a(%rip),%rdx
lea    0xe90(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rbx
mov    (%rbx),%edi
call   1050 <fileno@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
test   %rax,%rax
lea    0xeb8(%rip),%rax
lea    0xeae(%rip),%rdx
cmove  %rax,%rdx
lea    0xe93(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"fd %d %s a tty\0A\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [7 x i8] c"is not\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdin
%7 = call i32 @fileno(i32 %6)
%8 = load i32, i32* @stdin
%9 = call i32 @fileno(i32 %8)
%10 = call i64 @isatty(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %13)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"fd %d %s a tty\0A\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [7 x i8] c"is not\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @fileno(i32 %3)
%5 = load i32, i32* @stdin
%6 = tail call i32 @fileno(i32 %5)
%7 = tail call i64 @isatty(i32 %6)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %9)
ret i32 1
}
/* Variables and functions */
char *five_english();
scalar_t__ strcmp(char const *, char *);
char *test_five_english() {
  const char *out = five_english();
  do {
    if (strcmp(out, "five"))
      return "error, five_english != five";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_five_english>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <five_english@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     115d <test_five_english+0x3d>
lea    0xeac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <test_five_english+0x4a>
jmp    1162 <test_five_english+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_five_english>:
push   %rax
xor    %eax,%eax
call   1030 <five_english@plt>
lea    0xee8(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xebf(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"five\00"
@.str.1 = [28 x i8] c"error, five_english != five\00"
define i8* @test_five_english() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @five_english()
store i8* %3, i8** %2
br label %4
4: ; preds = %0
%5 = load i8*, i8** %2
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"five\00"
@.str.1 = [28 x i8] c"error, five_english != five\00"
define i8* @test_five_english() {
%1 = tail call i8* (...) @five_english()
%2 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
char *getTerm(unsigned int i) {
  char *arrStr[] = {"pointer", "is", "beautiful!"};
  return arrStr[i];
}


x86 assembly (clang, -O0):
<getTerm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2d22(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2d1f(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2d1c(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x20(%rbp,%rax,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTerm>:
mov    %edi,%eax
lea    0xf0f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"pointer\00"
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [11 x i8] c"beautiful!\00"
@__const.getTerm.arrStr = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0)]
define i8* @getTerm(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8*]
store i32 %0, i32* %2
%4 = bitcast [3 x i8*]* %3 to i8*
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 %6
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"pointer\00"
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [11 x i8] c"beautiful!\00"
@reltable.getTerm = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.getTerm to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.getTerm to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.getTerm to i64)) to i32)]
define i8* @getTerm(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.getTerm to i8*), i64 %3)
ret i8* %4
}
/* Type definitions */
struct cdrom_read_audio {
  int dummy;
};
typedef int /*<<< orphan*/ ra;

/* Variables and functions */
int main(void) {
  struct cdrom_read_audio ra;
  (void)ra;
  return sizeof(ra);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
%struct.cdrom_read_audio = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.cdrom_read_audio
store i32 0, i32* %1
ret i32 4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int __get_array_size(char const *);
char *strncat(char *s1, const char *s2, size_t n) {
  int size_s1;
  int size_s2;
  size_s1 = __get_array_size(s1);
  size_s2 = __get_array_size(s2);
  if ((n > size_s1) || (n > size_s2))
    while (1)
      ;
  return s1;
}


x86 assembly (clang, -O0):
<strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__get_array_size@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__get_array_size@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
ja     115e <strncat+0x4e>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
cmp    %rcx,%rax
jbe    1168 <strncat+0x58>
jmp    1163 <strncat+0x53>
jmp    1163 <strncat+0x53>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1030 <__get_array_size@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <__get_array_size@plt>
movslq %ebp,%rcx
cmp    %rbx,%rcx
jb     1150 <strncat+0x40>
cltq
cmp    %rbx,%rax
jb     1150 <strncat+0x40>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
nopl   0x0(%rax)
jmp    1150 <strncat+0x40>

LLVM IR (-O0):
define i8* @strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
%10 = call i32 @__get_array_size(i8* %9)
store i32 %10, i32* %7
%11 = load i8*, i8** %5
%12 = call i32 @__get_array_size(i8* %11)
store i32 %12, i32* %8
%13 = load i64, i64* %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = icmp ugt i64 %13, %15
br i1 %16, label %22, label %17
17: ; preds = %3
%18 = load i64, i64* %6
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = icmp ugt i64 %18, %20
br i1 %21, label %22, label %24
22: ; preds = %17, %3
br label %23
23: ; preds = %22, %23
br label %23
24: ; preds = %17
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @__get_array_size(i8* %0)
%5 = tail call i32 @__get_array_size(i8* %1)
%6 = sext i32 %4 to i64
%7 = icmp ult i64 %6, %2
%8 = sext i32 %5 to i64
%9 = icmp ult i64 %8, %2
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %11, label %12
11: ; preds = %3, %11
br label %11
12: ; preds = %3
ret i8* %0
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct hostent *gethostbyname(const char *name) {
  ;
  errno = ENOSYS;
  return NULL;
  ;
}


x86 assembly (clang, -O0):
<gethostbyname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostbyname>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.hostent* @gethostbyname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.hostent* null
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.hostent* @gethostbyname(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret %struct.hostent* null
}