xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ acc_free(void *);
void *acc_malloc(int const);
int /*<<< orphan*/ acc_map_data(unsigned char *, void *, int const);
int /*<<< orphan*/ acc_unmap_data(void *);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ malloc(int const);
int main(int argc, char **argv) {
  const int N = 256;
  unsigned char *h;
  void *d;
  h = (unsigned char *)malloc(N);
  d = acc_malloc(N);
  acc_map_data(h, d, N);
  acc_unmap_data(d);
  acc_free(d);
  free(h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100,-0x14(%rbp)
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x100,%edi
call   1040 <acc_malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x100,%edx
call   1060 <acc_map_data@plt>
mov    -0x28(%rbp),%rdi
call   1050 <acc_unmap_data@plt>
mov    -0x28(%rbp),%rdi
call   1080 <acc_free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x100,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x100,%edi
call   1040 <acc_malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x100,%edx
call   1060 <acc_map_data@plt>
mov    %rbx,%rdi
call   1050 <acc_unmap_data@plt>
mov    %rbx,%rdi
call   1080 <acc_free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %6
%9 = call i64 @malloc(i32 256)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %7
%11 = call i8* @acc_malloc(i32 256)
store i8* %11, i8** %8
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @acc_map_data(i8* %12, i8* %13, i32 256)
%15 = load i8*, i8** %8
%16 = call i32 @acc_unmap_data(i8* %15)
%17 = load i8*, i8** %8
%18 = call i32 @acc_free(i8* %17)
%19 = load i8*, i8** %7
%20 = call i32 @free(i8* %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 256)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i8* @acc_malloc(i32 256)
%6 = tail call i32 @acc_map_data(i8* %4, i8* %5, i32 256)
%7 = tail call i32 @acc_unmap_data(i8* %5)
%8 = tail call i32 @acc_free(i8* %5)
%9 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C(int *, int *, int);
void T(int *s1, int *s2, int ymax) {
  if ((*s2 == 0) && (*s1 < ymax)) {
    *s2 = *s1;
    *s1 = 0;
  } else {
    C(s1, s2, ymax);
  }
}


x86 assembly (clang, -O0):
<T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    115a <T+0x4a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jge    115a <T+0x4a>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    116a <T+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <C@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<T>:
cmpl   $0x0,(%rsi)
jne    1124 <T+0x14>
mov    (%rdi),%eax
cmp    %edx,%eax
jge    1124 <T+0x14>
mov    %eax,(%rsi)
movl   $0x0,(%rdi)
ret
jmp    1030 <C@plt>

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

LLVM IR (-O2):
define void @T(i32* %0, i32* %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* %0
%8 = icmp slt i32 %7, %2
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 %7, i32* %1
store i32 0, i32* %0
br label %12
10: ; preds = %6, %3
%11 = tail call i32 @C(i32* %0, i32* %1, i32 %2)
br label %12
12: ; preds = %10, %9
ret void
}
void STRCOPY(char *s1, char *s2) {
  int i;
  for (i = 0; s1[i] != '\0'; i++)
    s2[i] = s1[i];
  s2[i] = '\0';
}


x86 assembly (clang, -O0):
<STRCOPY>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <STRCOPY+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <STRCOPY+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<STRCOPY>:
mov    (%rdi),%al
test   %al,%al
je     1127 <STRCOPY+0x27>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <STRCOPY+0x10>
mov    %ecx,%eax
movb   $0x0,(%rsi,%rax,1)
ret
xor    %eax,%eax
movb   $0x0,(%rsi,%rax,1)
ret

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

LLVM IR (-O2):
define void @STRCOPY(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
int test_imm_ECint8_reg(signed char val) {
  return ((val) & (-0xEC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ECint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff14,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ECint8_reg>:
test   $0xffffff14,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ECint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -236
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int owTouchReset(int portnum) { return 0; }


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

x86 assembly (clang, -O2):
<owTouchReset>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @owTouchReset(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int var_check(char *str) {
  if (!strcmp(str, "int"))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<var_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <var_check+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <var_check+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_check>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"int\00"
define i32 @var_check(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int EOF;
int encode_character(int, int);
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    printf("%c", encode_character(c, 3));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     1178 <main+0x48>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1030 <encode_character@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
je     1172 <main+0x42>
lea    0xeb2(%rip),%rbx
xchg   %ax,%ax
mov    %eax,%edi
mov    $0x3,%esi
call   1030 <encode_character@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r14),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @encode_character(i32 %8, i32 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @encode_character(i32 %5, i32 3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
void outw(unsigned short value, unsigned short int port) {
  __asm__ __volatile__("outw %w0,%w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int get_abs_sum(int, int, int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int x, y, z;
  scanf("%d %d %d", &x, &y, &z);
  printf("%d+%d+%d = %d\n", x, y, z, get_abs_sum(x, y, z));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <get_abs_sum@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    %eax,%r8d
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    0x8(%rsp),%ebp
mov    0x4(%rsp),%r14d
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1050 <get_abs_sum@plt>
lea    0xe96(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [15 x i8] c"%d+%d+%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @get_abs_sum(i32 %9, i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [15 x i8] c"%d+%d+%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @get_abs_sum(i32 %8, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pause();
void Pause() {
  (void)pause();
  return;
}


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

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

LLVM IR (-O0):
define void @Pause() {
%1 = call i32 (...) @pause()
ret void
}

LLVM IR (-O2):
define void @Pause() {
%1 = tail call i32 (...) @pause()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_lastprivate() {
  int i;
#pragma omp parallel sections lastprivate(
  { foo(); }
#pragma omp parallel sections lastprivate(,
  { foo(); }
#pragma omp parallel sections lastprivate(, )
  { foo(); }
#pragma omp parallel sections lastprivate()
  { foo(); }
#pragma omp parallel sections lastprivate(int)
  { foo(); }
#pragma omp parallel sections lastprivate(0)
  { foo(); }
  int x, y, z;
#pragma omp parallel sections lastprivate(x)
  { foo(); }
#pragma omp parallel sections lastprivate(x, y)
  { foo(); }
#pragma omp parallel sections lastprivate(x, y, z)
  { foo(); }
}


x86 assembly (clang, -O0):
<test_lastprivate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lastprivate>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_lastprivate() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @foo()
%6 = call i32 (...) @foo()
%7 = call i32 (...) @foo()
%8 = call i32 (...) @foo()
%9 = call i32 (...) @foo()
%10 = call i32 (...) @foo()
%11 = call i32 (...) @foo()
%12 = call i32 (...) @foo()
%13 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_lastprivate() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @foo()
%8 = tail call i32 (...) @foo()
%9 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
char *gen_conn_marshall(void *, int);
char *osconn_marshall(void *obj) { return gen_conn_marshall(obj, 1); }


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

x86 assembly (clang, -O2):
<osconn_marshall>:
mov    $0x1,%esi
jmp    1030 <gen_conn_marshall@plt>

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

LLVM IR (-O2):
define i8* @osconn_marshall(i8* %0) {
%2 = tail call i8* @gen_conn_marshall(i8* %0, i32 1)
ret i8* %2
}
void modele_frottements(const double q[2], const double qdot[2], double F[2]) {
  F[0] = 50 * qdot[0];
  F[1] = 50 * qdot[1];
}


x86 assembly (clang, -O0):
<modele_frottements>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xee4(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xecc(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<modele_frottements>:
movsd  0xef8(%rip),%xmm0
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
mulsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @modele_frottements(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = fmul double 5.000000e+01, %9
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 0
store double %10, double* %12
%13 = load double*, double** %5
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = fmul double 5.000000e+01, %15
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
ret void
}

LLVM IR (-O2):
define void @modele_frottements(double* nocapture readnone %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = fmul double %4, 5.000000e+01
store double %5, double* %2
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, 5.000000e+01
%9 = getelementptr inbounds double, double* %2, i64 1
store double %8, double* %9
ret void
}
int test_imm_29uint8_reg(unsigned char val) {
  return ((val) & (-0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffd7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_29uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -41
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_TEXT_VIEW_ON;
void cec_msg_text_view_on(struct cec_msg *msg) {
  msg->len = 2;
  msg->msg[1] = CEC_MSG_TEXT_VIEW_ON;
}


x86 assembly (clang, -O0):
<cec_msg_text_view_on>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_text_view_on>:
movl   $0x2,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_TEXT_VIEW_ON = global i32 0
define void @cec_msg_text_view_on(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = load i32, i32* @CEC_MSG_TEXT_VIEW_ON
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_TEXT_VIEW_ON = global i32 0
define void @cec_msg_text_view_on(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 2, i32* %2
%3 = load i32, i32* @CEC_MSG_TEXT_VIEW_ON
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_min;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_min(void) {
  time_t t = time(NULL);
  struct tm *lt = localtime(&t);
  return lt->tm_min;
}


x86 assembly (clang, -O0):
<date_get_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_min>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_min() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_min() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
void PVD_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @PVD_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_usage(void) {
  puts("See man page for more detailed information. Usage options:\n"
       "\tadd:\t\t-a name -D description -f file\n"
       "\tdelete:\t\t-d name\n"
       "\texecute:\t-e name [-A arg] ...\n"
       "\thelp:\t\t-h\n"
       "\tlist:\t\t-l\n"
       "\treplace:\t-r name -f file\n"
       "\tsearch:\t\t-s [-n name -D description]\n"
       "\tversion:\t-v");
}


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

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

LLVM IR (-O0):
@.str = [245 x i8] c"See man page for more detailed information. Usage options:\0A\09add:\09\09-a name -D description -f file\0A\09delete:\09\09-d name\0A\09execute:\09-e name [-A arg] ...\0A\09help:\09\09-h\0A\09list:\09\09-l\0A\09replace:\09-r name -f file\0A\09search:\09\09-s [-n name -D description]\0A\09version:\09-v\00"
define void @print_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([245 x i8], [245 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [245 x i8] c"See man page for more detailed information. Usage options:\0A\09add:\09\09-a name -D description -f file\0A\09delete:\09\09-d name\0A\09execute:\09-e name [-A arg] ...\0A\09help:\09\09-h\0A\09list:\09\09-l\0A\09replace:\09-r name -f file\0A\09search:\09\09-s [-n name -D description]\0A\09version:\09-v\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([245 x i8], [245 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
double sqrt(scalar_t__);
double euclideanDistance(int x1, int x2, int y1, int y2) {
  return sqrt(pow((x1 - x2), 2) + pow((y1 - y2), 2));
}


x86 assembly (clang, -O0):
<euclideanDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclideanDistance>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
sub    %esi,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbx
sub    %r14d,%ebp
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @euclideanDistance(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 = sub nsw i32 %9, %10
%12 = call i64 @pow(i32 %11, i32 2)
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = call i64 @pow(i32 %15, i32 2)
%17 = add nsw i64 %12, %16
%18 = call double @sqrt(i64 %17)
ret double %18
}

LLVM IR (-O2):
define double @euclideanDistance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %1
%6 = tail call i64 @pow(i32 %5, i32 2)
%7 = sub nsw i32 %2, %3
%8 = tail call i64 @pow(i32 %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call double @sqrt(i64 %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int n;
  int sum;
  int i;
  if (!(n >= 0 && sum == 0 && i == 0))
    return 0;
  while (i < n) {
    sum = sum + i;
    i++;
  }
  assert(sum >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     113d <main+0x2d>
cmpl   $0x0,-0xc(%rbp)
jne    113d <main+0x2d>
cmpl   $0x0,-0x10(%rbp)
je     1149 <main+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1189 <main+0x79>
jmp    114e <main+0x3e>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1171 <main+0x61>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <main+0x3e>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10, %7, %0
store i32 0, i32* %1
br label %30
14: ; preds = %10
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = add nsw i32 %20, %21
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %15
25: ; preds = %15
%26 = load i32, i32* %3
%27 = icmp sge i32 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
store i32 0, i32* %1
br label %30
30: ; preds = %25, %13
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ name_2();
int main() {
  name_2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <name_2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <name_2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @name_2()
ret i32 0
}
/* Variables and functions */
float anglemod(float);
float angledist(float ang) {
  float a;
  a = anglemod(ang);
  if (a > 180) {
    a -= 360;
  }
  return a;
}


x86 assembly (clang, -O0):
<angledist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <anglemod@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1158 <angledist+0x48>
movss  -0x8(%rbp),%xmm0
movss  0xeb5(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angledist>:
push   %rax
call   1030 <anglemod@plt>
movss  0xee2(%rip),%xmm2
addss  %xmm0,%xmm2
movss  0xeda(%rip),%xmm1
cmpltss %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @angledist(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @anglemod(float %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fcmp ogt float %6, 1.800000e+02
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = fsub float %9, 3.600000e+02
store float %10, float* %3
br label %11
11: ; preds = %8, %1
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @angledist(float %0) {
%2 = tail call float @anglemod(float %0)
%3 = fcmp ogt float %2, 1.800000e+02
%4 = fadd float %2, -3.600000e+02
%5 = select i1 %3, float %4, float %2
ret float %5
}
void test_non_identifiers() {
  int i, x;
#pragma omp target teams distribute simd;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute simd private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute simd, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
/* Variables and functions */
int read(int, void *, int);
int tap_read(int fd, void *buf, int len) { return read(fd, buf, len); }


x86 assembly (clang, -O0):
<tap_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tap_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @tap_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @tap_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
unsigned long inl(unsigned int);
unsigned long nsp32_read4(unsigned int base, unsigned int index) {
  return inl(base + index);
}


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

x86 assembly (clang, -O2):
<nsp32_read4>:
add    %esi,%edi
jmp    1030 <inl@plt>

LLVM IR (-O0):
define i64 @nsp32_read4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add i32 %5, %6
%8 = call i64 @inl(i32 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @nsp32_read4(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call i64 @inl(i32 %3)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) {
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @pthread_attr_setstacksize(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @pthread_attr_setstacksize(i32* nocapture readnone %0, i64 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ initADC();
int /*<<< orphan*/ initPWM();
int /*<<< orphan*/ initUART();
int main(void) {
  initADC();
  initUART();
  initPWM();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initADC@plt>
mov    $0x0,%al
call   1030 <initUART@plt>
mov    $0x0,%al
call   1050 <initPWM@plt>
jmp    1154 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initADC@plt>
xor    %eax,%eax
call   1030 <initUART@plt>
xor    %eax,%eax
call   1050 <initPWM@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initADC()
%3 = call i32 (...) @initUART()
%4 = call i32 (...) @initPWM()
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initADC()
%2 = tail call i32 (...) @initUART()
%3 = tail call i32 (...) @initPWM()
br label %4
4: ; preds = %0, %4
br label %4
}
putstk(typeobj) char typeobj;
{
  debug_ol("; putstk");
  zpop();
  if (typeobj == 2) {
    ol("std	0,x");
  } else {
    ol("stab	0,x");
  }
}


x86 assembly (clang, -O0):
<putstk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1050 <debug_ol@plt>
mov    $0x0,%al
call   1030 <zpop@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x2,%eax
jne    1173 <putstk+0x43>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
jmp    1181 <putstk+0x51>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstk>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1050 <debug_ol@plt>
xor    %eax,%eax
call   1030 <zpop@plt>
cmp    $0x2,%bl
lea    0xeb7(%rip),%rax
lea    0xeb8(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <ol@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"; putstk\00"
@.str.1 = [8 x i8] c"std\090,x\00"
@.str.2 = [9 x i8] c"stab\090,x\00"
define i32 @putstk(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @zpop()
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"; putstk\00"
@.str.1 = [8 x i8] c"std\090,x\00"
@.str.2 = [9 x i8] c"stab\090,x\00"
define i32 @putstk(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @zpop()
%4 = and i32 %0, 255
%5 = icmp eq i32 %4, 2
%6 = select i1 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %6)
ret i32 undef
}
/* Variables and functions */
int partition(int *, int, int);
void _quick_sort(int *a, int p, int q) {
  if (p >= q)
    return;
  int m = partition(a, p, q);
  _quick_sort(a, p, m - 1);
  _quick_sort(a, m + 1, q);
}


x86 assembly (clang, -O0):
<_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <_quick_sort+0x23>
jmp    1179 <_quick_sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <_quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <_quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @_quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void char_ptr_strproc(ptr, proc) char *ptr;
void (*proc)(char **str);
{
  (*proc)((char **)ptr);
  return;
}


x86 assembly (clang, -O0):
<char_ptr_strproc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_ptr_strproc>:
jmp    *%rsi

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

LLVM IR (-O2):
define void @char_ptr_strproc(i8* %0, void (i8**)* nocapture %1) {
%3 = bitcast i8* %0 to i8**
tail call void %1(i8** %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldlab(int id) { lgen("%s\tax,offset %c%d", "mov", id); }


x86 assembly (clang, -O0):
<cgldlab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldlab>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s\09ax,offset %c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldlab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s\09ax,offset %c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldlab(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
struct timespec convert_sec_to_time(double sec) {
  struct timespec ts;
  ts.tv_sec = (time_t)sec;
  ts.tv_nsec = (long)((sec - ((double)ts.tv_sec)) * 1.0e9);
  return ts;
}


x86 assembly (clang, -O0):
<convert_sec_to_time>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_sec_to_time>:
cvttsd2si %xmm0,%rdx
cvtsi2sd %rdx,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xeea(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @convert_sec_to_time(double %0) {
%2 = alloca %struct.timespec
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fptosi double %4 to i64
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %5, i64* %6
%7 = load double, double* %3
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fsub double %7, %10
%12 = fmul double %11, 1.000000e+09
%13 = fptosi double %12 to i64
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %13, i64* %14
%15 = bitcast %struct.timespec* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @convert_sec_to_time(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 1.000000e+09
%6 = fptosi double %5 to i64
%7 = insertvalue { i64, i64 } poison, i64 %6, 0
%8 = insertvalue { i64, i64 } %7, i64 %2, 1
ret { i64, i64 } %8
}