xunge/DecIR huggingface dataset:
unsigned xrop3_237_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_237_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_237_1_1>:
mov    %esi,%eax
or     %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_237_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_237_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = or i32 %8, %4
%10 = xor i32 %9, -256
ret i32 %10
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", factorial(12)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1030 <factorial@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @factorial(i32 12)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef size_t int64_t;

/* Variables and functions */
void ex_swap64(int64_t v[], int64_t i, int64_t j) {
  int64_t temp;
  temp = v[i];
  v[i] = v[j];
  v[j] = temp;
}


x86 assembly (clang, -O0):
<ex_swap64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_swap64>:
mov    (%rdi,%rsi,8),%rax
mov    (%rdi,%rdx,8),%rcx
mov    %rcx,(%rdi,%rsi,8)
mov    %rax,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
define void @ex_swap64(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i64, i64* %8, i64 %9
%11 = load i64, i64* %10
store i64 %11, i64* %7
%12 = load i64*, i64** %4
%13 = load i64, i64* %6
%14 = getelementptr inbounds i64, i64* %12, i64 %13
%15 = load i64, i64* %14
%16 = load i64*, i64** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i64, i64* %16, i64 %17
store i64 %15, i64* %18
%19 = load i64, i64* %7
%20 = load i64*, i64** %4
%21 = load i64, i64* %6
%22 = getelementptr inbounds i64, i64* %20, i64 %21
store i64 %19, i64* %22
ret void
}

LLVM IR (-O2):
define void @ex_swap64(i64* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 %1
%5 = load i64, i64* %4
%6 = getelementptr inbounds i64, i64* %0, i64 %2
%7 = load i64, i64* %6
store i64 %7, i64* %4
store i64 %5, i64* %6
ret void
}
float minf(float x, float y) {
  if (y < x)
    return y;
  else
    return x;
}


x86 assembly (clang, -O0):
<minf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <minf+0x30>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <minf+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minf>:
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @minf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %5
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %4
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @minf(float %0, float %1) {
%3 = fcmp olt float %1, %0
%4 = select i1 %3, float %1, float %0
ret float %4
}
/* Variables and functions */
void *malloc(size_t);
void *create(size_t s) { return malloc(s); }


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

x86 assembly (clang, -O2):
<create>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @create(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int tabela[] = {1, 2, 4, 6, 12};
  int i = 4;
  while (i >= 0) {
    printf("%d\n", tabela[i]);
    i--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1171 <main+0x61>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1145 <main+0x35>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.tabela = [5 x i32] [i32 1, i32 2, i32 4, i32 6, i32 12]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 4, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void ff_hevc_put_hevc_uni_w_epel_hv64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_hv64_10_sse4() {
ret void
}
/* Variables and functions */
int errno;
int fcntl(int, int, void *);
int __sulong_posix_fcntl(int fd, int cmd, void *arg) {
  {
    int native_errno = errno;
    int result = fcntl(fd, cmd, arg);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  }
}


x86 assembly (clang, -O0):
<__sulong_posix_fcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fcntl@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    115a <__sulong_posix_fcntl+0x4a>
xor    %eax,%eax
mov    0x2e8d(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    0x2e7c(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_fcntl>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <fcntl@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_fcntl(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @fcntl(i32 %0, i32 %1, i8* %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %5
store i32 %4, i32* @errno
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ DecodeDD_xxxxdddxssxxxrrr();
int /*<<< orphan*/ DoBinOpSubX(int /*<<< orphan*/);
void DoCodeSubXd(void) { DoBinOpSubX(DecodeDD_xxxxdddxssxxxrrr()); }


x86 assembly (clang, -O0):
<DoCodeSubXd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DecodeDD_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
call   1040 <DoBinOpSubX@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeSubXd>:
push   %rax
xor    %eax,%eax
call   1030 <DecodeDD_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DoBinOpSubX@plt>

LLVM IR (-O0):
define void @DoCodeSubXd() {
%1 = call i32 (...) @DecodeDD_xxxxdddxssxxxrrr()
%2 = call i32 @DoBinOpSubX(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeSubXd() {
%1 = tail call i32 (...) @DecodeDD_xxxxdddxssxxxrrr()
%2 = tail call i32 @DoBinOpSubX(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void feedback() {
  printf("%s\n%s\n%s\n%s\n", "Thank you for providing your valuable feedback.",
         "You can send me mail at abhishek_verma@hotmail.com",
         "You can contribute to the project using Github.",
         "Github :https://github.com/hell-sing/nlptext");
}


x86 assembly (clang, -O0):
<feedback>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xf14(%rip),%rdx
lea    0xf40(%rip),%rcx
lea    0xf69(%rip),%r8
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<feedback>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xf18(%rip),%rdx
lea    0xf44(%rip),%rcx
lea    0xf6d(%rip),%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [48 x i8] c"Thank you for providing your valuable feedback.\00"
@.str.2 = [51 x i8] c"You can send me mail at abhishek_verma@hotmail.com\00"
@.str.3 = [48 x i8] c"You can contribute to the project using Github.\00"
@.str.4 = [45 x i8] c"Github :https://github.com/hell-sing/nlptext\00"
define void @feedback() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [48 x i8] c"Thank you for providing your valuable feedback.\00"
@.str.2 = [51 x i8] c"You can send me mail at abhishek_verma@hotmail.com\00"
@.str.3 = [48 x i8] c"You can contribute to the project using Github.\00"
@.str.4 = [45 x i8] c"Github :https://github.com/hell-sing/nlptext\00"
define void @feedback() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int mq_timedsend(int /*<<< orphan*/, char *, size_t, unsigned int,
                 struct timespec *);
void test_mq_timedsend_prototype(void) {
  mqd_t mqdes;
  struct timespec timeout;
  char *msgp;
  int err;
  size_t msg_len;
  unsigned msg_prio;
  err = mq_timedsend(mqdes, msgp, msg_len, msg_prio, &timeout);
}


x86 assembly (clang, -O0):
<test_mq_timedsend_prototype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
lea    -0x8(%rbp),%r8
call   1030 <mq_timedsend@plt>
mov    %eax,-0x14(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mq_timedsend_prototype>:
push   %rax
mov    %rsp,%r8
call   1030 <mq_timedsend@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @test_mq_timedsend_prototype() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
%7 = load i32, i32* %1
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = call i32 @mq_timedsend(i32 %7, i8* %8, i64 %9, i32 %10, %struct.timespec* %2)
store i32 %11, i32* %4
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @test_mq_timedsend_prototype() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @mq_timedsend(i32 undef, i8* undef, i64 undef, i32 undef, %struct.timespec* %1)
ret void
}
/* Variables and functions */
bool nrf91_errata_9(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf91_errata_9() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf91_errata_9() {
ret i32 0
}
__attribute__((__unused__)) int isupper(int c) {
  return (('A' <= (c)) && ((c) <= 'Z'));
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isupper+0x24>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 65, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_data(void *data) {
  int *pi = (int *)data;
  printf("%d\n", *pi);
}


x86 assembly (clang, -O0):
<print_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_data>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_data(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_data(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int do_226() { return 226; }


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

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

LLVM IR (-O0):
define i32 @do_226() {
ret i32 226
}

LLVM IR (-O2):
define i32 @do_226() {
ret i32 226
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t rm_get_uint16be(uint8_t *buf) {
  return (uint16_t)((buf[0] << 8) | buf[1]);
}


x86 assembly (clang, -O0):
<rm_get_uint16be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_get_uint16be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rm_get_uint16be(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rm_get_uint16be(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
f(int n) {
  printf("F");
  if (n != 0)
    f(n - 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     114c <f+0x2c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
mov    $0x46,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
je     113f <f+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x46,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <f+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @putchar(i32 70)
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @putchar(i32 70)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_usage(FILE *out, const char *prog) {
  fprintf(
      out,
      "usage: %s [options..] [infile]\n"
      "\n"
      "  -d, --dump    dump parsed result.\n"
      "  -t, --trace   run with Grass machine's state output step-by-step.\n"
      "                (note: lots of texts will be output.)\n"
      "  -s, --step    run in stepping mode.\n"
      "  -n, --noexec  parse only. odn't run the program.\n"
      "  -h, --help    display this help and exit.\n",
      prog);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [324 x i8] c"usage: %s [options..] [infile]\0A\0A -d, --dump dump parsed result.\0A -t, --trace run with Grass machine's state output step-by-step.\0A (note: lots of texts will be output.)\0A -s, --step run in stepping mode.\0A -n, --noexec parse only. odn't run the program.\0A -h, --help display this help and exit.\0A\00"
define void @print_usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([324 x i8], [324 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [324 x i8] c"usage: %s [options..] [infile]\0A\0A -d, --dump dump parsed result.\0A -t, --trace run with Grass machine's state output step-by-step.\0A (note: lots of texts will be output.)\0A -s, --step run in stepping mode.\0A -n, --noexec parse only. odn't run the program.\0A -h, --help display this help and exit.\0A\00"
define void @print_usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([324 x i8], [324 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void mdp4_dsi_cmd_pipe_queue(int cndx, struct mdp4_overlay_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_dsi_cmd_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* %1) {
%3 = alloca i32
%4 = alloca %struct.mdp4_overlay_pipe*
store i32 %0, i32* %3
store %struct.mdp4_overlay_pipe* %1, %struct.mdp4_overlay_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_dsi_cmd_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void explain(void) { fprintf(stderr, "Usage: ... ingress \n"); }


x86 assembly (clang, -O0):
<explain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<explain>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: ... ingress \0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: ... ingress \0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x4c() {
  Assert_real((iscntrl(76) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              385, ("iscntrl should be 0 for L"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x4c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x181,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x4c>:
push   %rax
mov    $0x4c,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x181,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for L\00"
define void @t_iscntrl_0x4c() {
%1 = call i64 @iscntrl(i32 76)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for L\00"
define void @t_iscntrl_0x4c() {
%1 = tail call i64 @iscntrl(i32 76)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printDots(int count) {
  int i = 0;
  for (i = 0; i < count; i++) {
    printf(".");
  }
}


x86 assembly (clang, -O0):
<printDots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114f <printDots+0x3f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <printDots+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDots>:
push   %rbx
test   %edi,%edi
jle    112f <printDots+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printDots+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printDots(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 46)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int mv_after_use();
int use3(void) { return mv_after_use(); }


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

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

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

LLVM IR (-O2):
define i32 @use3() {
%1 = tail call i32 (...) @mv_after_use()
ret i32 %1
}
/* Variables and functions */
long double remquol(long double, long double, int *);
long double remainderl(long double x, long double y) {
  int quo;
  return (remquol(x, y, &quo));
}


x86 assembly (clang, -O0):
<remainderl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    -0x24(%rbp),%rdi
call   1030 <remquol@plt>
fld    %st(0)
fstp   %st(0)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainderl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0x24(%rsp),%rdi
call   1030 <remquol@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @remainderl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %3)
ret x86_fp80 %5
}
/* Variables and functions */
int get_clock();
unsigned long get_second(void) { return (get_clock() >> 12) / 1000000; }


x86 assembly (clang, -O0):
<get_second>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_clock@plt>
sar    $0xc,%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @get_second() {
%1 = call i32 (...) @get_clock()
%2 = ashr i32 %1, 12
%3 = sdiv i32 %2, 1000000
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_second() {
%1 = tail call i32 (...) @get_clock()
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ magic();
void *t_fun(void *arg) {
  magic();
  return NULL;
}


x86 assembly (clang, -O0):
<t_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <magic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @t_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @magic()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @t_fun(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @magic()
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int readInt(char *input) {
  FILE *fd;
  int val;
  fd = fopen(input, "r");
  if (fd == NULL)
    return -1;
  fscanf(fd, "%d", &val);
  fclose(fd);
  return val;
}


x86 assembly (clang, -O0):
<readInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <readInt+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <readInt+0x5a>
mov    -0x18(%rbp),%rdi
lea    0xe90(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116b <readInt+0x3b>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
jmp    1170 <readInt+0x40>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @readInt(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @readInt(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @fclose(i32* %4)
%9 = load i32, i32* %2
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b_debug(int idx, int *cells, int size) {
  printf("Brain · Copyright (C) 2016 Brain Labs\nThis program comes with "
         "ABSOLUTELY NO WARRANTY.\nType 'h' for help\nType 'c' for "
         "conditions\nType 'q' for quitting\n");
}


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

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

LLVM IR (-O0):
@.str = [152 x i8] c"Brain \C2\B7 Copyright (C) 2016 Brain Labs\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AType 'h' for help\0AType 'c' for conditions\0AType 'q' for quitting\0A\00"
define void @b_debug(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 = call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [151 x i8] c"Brain \C2\B7 Copyright (C) 2016 Brain Labs\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AType 'h' for help\0AType 'c' for conditions\0AType 'q' for quitting\00"
define void @b_debug(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([151 x i8], [151 x i8]* @str, i64 0, i64 0))
ret void
}
int fun658() { return 658; }


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

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

LLVM IR (-O0):
define i32 @fun658() {
ret i32 658
}

LLVM IR (-O2):
define i32 @fun658() {
ret i32 658
}
void WIN32_sendSignal(int foo) { return; }


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

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

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

LLVM IR (-O2):
define void @WIN32_sendSignal(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chmod(char *, int);
int strtol(char *, int /*<<< orphan*/, int);
int main() {
  char mode[] = "0777";
  char buf[100] = "/home/runs/result.txt";
  int i = strtol(mode, 0, 8);
  chmod(buf, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb1(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x9(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
call   1050 <chmod@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x37373730,0x8(%rsp)
37
movaps 0xf28(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf0c(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
lea    0x10(%rsp),%rdi
mov    %eax,%esi
call   1040 <chmod@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.mode = [5 x i8] c"0777\00"
@__const.main.buf = [100 x i8] c"/home/runs/result.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [100 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x i8]* %2 to i8*
%6 = bitcast [100 x i8]* %3 to i8*
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = call i32 @strtol(i8* %7, i32 0, i32 8)
store i32 %8, i32* %4
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @chmod(i8* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mode = [5 x i8] c"0777\00"
@__const.main.buf = [100 x i8] c"/home/runs/result.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @strtol(i8* %3, i32 0, i32 8)
%6 = call i32 @chmod(i8* %4, i32 %5)
ret i32 0
}
int stringLength(char *str) {
  int count = 0;
  for (int i = 0; str[i] != '\0'; i++) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <stringLength+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <stringLength+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
cmpb   $0x0,(%rdi)
je     111c <stringLength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringLength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %8
4: ; preds = %8
%5 = trunc i64 %10 to i32
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ 0, %1 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %1, %8
%9 = phi i64 [ %10, %8 ], [ 0, %1 ]
%10 = add nuw nsw i64 %9, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %8
}
unsigned local_size(unsigned n_elems, int n_ranks, int rank) {
  return n_elems / n_ranks + ((rank < (n_elems % n_ranks)) ? 1 : 0);
}


x86 assembly (clang, -O0):
<local_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %edx,%edi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    %edi,%esi
cmovb  %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_size>:
mov    %edx,%ecx
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    %edx,%ecx
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @local_size(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* %4
%8 = load i32, i32* %5
%9 = udiv i32 %7, %8
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = urem i32 %11, %12
%14 = icmp ult i32 %10, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
%17 = add i32 %9, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @local_size(i32 %0, i32 %1, i32 %2) {
%4 = udiv i32 %0, %1
%5 = urem i32 %0, %1
%6 = icmp ugt i32 %5, %2
%7 = zext i1 %6 to i32
%8 = add i32 %4, %7
ret i32 %8
}
_Complex long double test_ctanl(_Complex long double x) {
  return __builtin_ctanl(x);
}


x86 assembly (clang, -O0):
<test_ctanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1030 <ctanl@plt>
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ctanl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fxch   %st(1)
fstpt  0x20(%rsp)
fstpt  0x30(%rsp)
movaps 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <ctanl@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @test_ctanl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = call { x86_fp80, x86_fp80 } @ctanl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
%11 = extractvalue { x86_fp80, x86_fp80 } %10, 0
%12 = extractvalue { x86_fp80, x86_fp80 } %10, 1
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%14 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %11, x86_fp80* %13
store x86_fp80 %12, x86_fp80* %14
%15 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %15
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @test_ctanl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %4, x86_fp80* %7
store x86_fp80 %6, x86_fp80* %8
%9 = tail call { x86_fp80, x86_fp80 } @ctanl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
ret { x86_fp80, x86_fp80 } %9
}
volatile char *build_popf(volatile char *tgt_addr) {
  (*(char *)tgt_addr) = 0x9d;
  tgt_addr += 0x1;
  return (tgt_addr);
}


x86 assembly (clang, -O0):
<build_popf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x9d,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_popf>:
movb   $0x9d,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @build_popf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 -99, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %2
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define i8* @build_popf(i8* writeonly %0) {
store i8 -99, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}