xunge/DecIR huggingface dataset:
strnlen(s, n) char *s;
int n;
{
  int i = 0;
  while (n-- > 0 && *s++)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jle    1146 <strnlen+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1156 <strnlen+0x56>
jmp    1164 <strnlen+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <strnlen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
test   %esi,%esi
jle    111f <strnlen+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
je     1122 <strnlen+0x22>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <strnlen+0x10>
ret
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strnlen(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %9
%5 = phi i32 [ %11, %9 ], [ 0, %2 ]
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i32 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_map_valid() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_map_valid"
         "\n");
}


x86 assembly (clang, -O0):
<pa_channel_map_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_channel_map_valid\0A\00"
define i32 @pa_channel_map_valid() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_channel_map_valid\00"
define i32 @pa_channel_map_valid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ clear_bit(int, unsigned long *);
int test_bit(int, unsigned long *);
int test_and_clear_bit(int nr, unsigned long *addr) {
  int oldbit = test_bit(nr, addr);
  clear_bit(nr, addr);
  return oldbit;
}


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

x86 assembly (clang, -O2):
<test_and_clear_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <test_bit@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <clear_bit@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i32, i32* %3
%7 = load i64*, i64** %4
%8 = call i32 @test_bit(i32 %6, i64* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i64*, i64** %4
%11 = call i32 @clear_bit(i32 %9, i64* %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_and_clear_bit(i32 %0, i64* %1) {
%3 = tail call i32 @test_bit(i32 %0, i64* %1)
%4 = tail call i32 @clear_bit(i32 %0, i64* %1)
ret i32 %3
}
double dist2(double x, double y, double z, double x2, double y2, double z2) {
  double xd = x - x2, yd = y - y2, zd = z - z2;
  return (xd * xd + yd * yd + zd * zd);
}


x86 assembly (clang, -O0):
<dist2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist2>:
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
subsd  %xmm5,%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dist2(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%16 = load double, double* %7
%17 = load double, double* %10
%18 = fsub double %16, %17
store double %18, double* %13
%19 = load double, double* %8
%20 = load double, double* %11
%21 = fsub double %19, %20
store double %21, double* %14
%22 = load double, double* %9
%23 = load double, double* %12
%24 = fsub double %22, %23
store double %24, double* %15
%25 = load double, double* %13
%26 = load double, double* %13
%27 = load double, double* %14
%28 = load double, double* %14
%29 = fmul double %27, %28
%30 = call double @llvm.fmuladd.f64(double %25, double %26, double %29)
%31 = load double, double* %15
%32 = load double, double* %15
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double %30)
ret double %33
}

LLVM IR (-O2):
define double @dist2(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %3
%8 = fsub double %1, %4
%9 = fsub double %2, %5
%10 = fmul double %8, %8
%11 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %11)
ret double %12
}
void ff_hevc_put_hevc_bi_qpel_v12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v12_8_sse4() {
ret void
}
/* Variables and functions */
int helper_should_exit();
int update_io_ticks(void) { return helper_should_exit(); }


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

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

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

LLVM IR (-O2):
define i32 @update_io_ticks() {
%1 = tail call i32 (...) @helper_should_exit()
ret i32 %1
}
int test_imm_64uint8_mem(unsigned char *val) {
  return ((*val) & (-0x64 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_64uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff9c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_64uint8_mem>:
testb  $0x9c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_64uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -100
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *s111etc(char *str) {
  register int i;
  for (i = 1; str[i] != '\0'; i++)
    str[i] = '\1';
  return (str);
}


x86 assembly (clang, -O0):
<s111etc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113e <s111etc+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <s111etc+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s111etc>:
mov    %rdi,%rax
cmpb   $0x0,0x1(%rdi)
je     111d <s111etc+0x1d>
lea    0x2(%rax),%rcx
nopl   (%rax)
movb   $0x1,-0x1(%rcx)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <s111etc+0x10>
ret

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

LLVM IR (-O2):
define i8* @s111etc(i8* returned %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %8, %5 ], [ 1, %1 ]
%7 = phi i8* [ %9, %5 ], [ %2, %1 ]
store i8 1, i8* %7
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret i8* %0
}
/* Variables and functions */
double calerf(double, int /*<<< orphan*/);
double derf(double x) { return (calerf(x, 0)); }


x86 assembly (clang, -O0):
<derf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <calerf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derf>:
xor    %edi,%edi
jmp    1030 <calerf@plt>

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

LLVM IR (-O2):
define double @derf(double %0) {
%2 = tail call double @calerf(double %0, i32 0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("hello, world!"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ readPath(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc < 2) {
    usage();
    exit(1);
  }
  char *FileName[64];
  printf("%s\n", argv[1]);
  *FileName = argv[1];
  readPath(*FileName);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1174 <main+0x34>
mov    $0x0,%al
call   1050 <usage@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x210(%rbp)
mov    -0x210(%rbp),%rdi
call   1030 <readPath@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jle    1166 <main+0x26>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
call   1030 <readPath@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1050 <usage@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [64 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 (...) @usage()
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = getelementptr inbounds [64 x i8*], [64 x i8*]* %6, i64 0, i64 0
store i8* %19, i8** %20
%21 = getelementptr inbounds [64 x i8*], [64 x i8*]* %6, i64 0, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @readPath(i8* %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @usage()
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %8
%12 = tail call i32 @readPath(i8* %11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void CopyTmplEpilog(FILE *tmpl, FILE *f) {
  char buf[1024];
  while (fgets(buf, sizeof buf, tmpl))
    (void)fputs(buf, f);
}


x86 assembly (clang, -O0):
<CopyTmplEpilog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1167 <CopyTmplEpilog+0x47>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
jmp    1133 <CopyTmplEpilog+0x13>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyTmplEpilog>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1170 <CopyTmplEpilog+0x50>
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fputs@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
jne    1150 <CopyTmplEpilog+0x30>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @CopyTmplEpilog(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1024 x i8]
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%8 = load i32*, i32** %3
%9 = call i64 @fgets(i8* %7, i32 1024, i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @fputs(i8* %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @CopyTmplEpilog(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i64 @fgets(i8* %4, i32 1024, i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2, %7
%8 = call i32 @fputs(i8* %4, i32* %1)
%9 = call i64 @fgets(i8* %4, i32 1024, i32* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %2
ret void
}
int s3d_strcharin(char c, const char *chars) {
  while (*chars != 0) {
    if (*chars == c) {
      return 1;
    }
    ++chars;
  }
  return 0;
}


x86 assembly (clang, -O0):
<s3d_strcharin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <s3d_strcharin+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    113d <s3d_strcharin+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1155 <s3d_strcharin+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <s3d_strcharin+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3d_strcharin>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <s3d_strcharin+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <s3d_strcharin+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <s3d_strcharin+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @s3d_strcharin(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i8 %9, %0
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ShowHelp(void) {
  printf(
      "\nMkhelp "
      "0.2"
      "\n"
      "Help utility to combine text files in one large help file.\n"
      "\n"
      "Syntax:\n"
      "\tMkhelp <listfile> <helpfile>\n"
      "\n"
      "listfile: file containing a list of the files that have to be included\n"
      "helpfile: file to contain the output\n");
}


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

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

LLVM IR (-O0):
@.str = [220 x i8] c"\0AMkhelp 0.2\0AHelp utility to combine text files in one large help file.\0A\0ASyntax:\0A\09Mkhelp <listfile> <helpfile>\0A\0Alistfile: file containing a list of the files that have to be included\0Ahelpfile: file to contain the output\0A\00"
define void @ShowHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([220 x i8], [220 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [219 x i8] c"\0AMkhelp 0.2\0AHelp utility to combine text files in one large help file.\0A\0ASyntax:\0A\09Mkhelp <listfile> <helpfile>\0A\0Alistfile: file containing a list of the files that have to be included\0Ahelpfile: file to contain the output\00"
define void @ShowHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([219 x i8], [219 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToSndModule(int, char *, int /*<<< orphan*/ *);
int mgrTuningStop(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToSndModule((8004), "/tuner/tune/stop", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<mgrTuningStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1f44,%edi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrTuningStop>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1f44,%edi
xor    %edx,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/tuner/tune/stop\00"
define i32 @mgrTuningStop(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToSndModule(i32 8004, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"/tuner/tune/stop\00"
define i32 @mgrTuningStop(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToSndModule(i32 8004, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}
int ft_isprint(int c) { return ((c >= 32 && c <= 126) ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void funcb() { puts("funcb"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"funcb\00"
define void @funcb() {
%1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"funcb\00"
define void @funcb() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int get_PDSGridType(unsigned char *pds) { return pds[6]; }


x86 assembly (clang, -O0):
<get_PDSGridType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_PDSGridType>:
movzbl 0x6(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_PDSGridType(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
double third_order_polynomial(double, double, double, double, double);
double mean_anomaly_sun(double jce) {
  return third_order_polynomial(-1.0 / 300000.0, -0.0001603, 35999.05034,
                                357.52772, jce);
}


x86 assembly (clang, -O0):
<mean_anomaly_sun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm4
movsd  0xed6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
movsd  0xed6(%rip),%xmm2
movsd  0xed6(%rip),%xmm3
call   1030 <third_order_polynomial@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean_anomaly_sun>:
movaps %xmm0,%xmm4
movsd  0xee5(%rip),%xmm0
movsd  0xee5(%rip),%xmm1
movsd  0xee5(%rip),%xmm2
movsd  0xee5(%rip),%xmm3
jmp    1030 <third_order_polynomial@plt>

LLVM IR (-O0):
define double @mean_anomaly_sun(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @third_order_polynomial(double 0xBECBF647612F3696, double -1.603000e-04, double 0x40E193E19C62A1B6, double 0x407658718A86D71F, double %3)
ret double %4
}

LLVM IR (-O2):
define double @mean_anomaly_sun(double %0) {
%2 = tail call double @third_order_polynomial(double 0xBECBF647612F3696, double -1.603000e-04, double 0x40E193E19C62A1B6, double 0x407658718A86D71F, double %0)
ret double %2
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t fixmulshift(int32_t x, int32_t y, int shamt) {
  int64_t temp;
  temp = x;
  temp *= y;
  temp >>= shamt;
  return (int32_t)temp;
}


x86 assembly (clang, -O0):
<fixmulshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixmulshift>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @fixmulshift(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* %4
store i32 %8, i32* %7
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = mul nsw i32 %10, %9
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = ashr i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @fixmulshift(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = ashr i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *r;
  if (s == 0 || *s == 0)
    return 0;
  r = malloc(strlen(s) + 1);
  assert(r);
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1167 <strdup+0x27>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1174 <strdup+0x34>
movq   $0x0,-0x8(%rbp)
jmp    11ab <strdup+0x6b>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     117a <strdup+0x3a>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     117a <strdup+0x3a>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1050 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    117d <strdup+0x3d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i64 @strlen(i8* %0)
%8 = add nsw i64 %7, 1
%9 = tail call i8* @malloc(i64 %8)
%10 = tail call i32 @assert(i8* %9)
%11 = tail call i32 @strcpy(i8* %9, i8* %0)
br label %12
12: ; preds = %1, %3, %6
%13 = phi i8* [ %9, %6 ], [ null, %3 ], [ null, %1 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_lnk(int const LNK) {
  switch (LNK) {
  case 0:
    printf("  Standard\n");
    break;
  default:
    printf("  Nothing to print\n");
    break;
  }
}


x86 assembly (clang, -O0):
<print_lnk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    113c <print_lnk+0x2c>
jmp    112b <print_lnk+0x1b>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    1148 <print_lnk+0x38>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_lnk>:
test   %edi,%edi
lea    0xefa(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c" Standard\0A\00"
@.str.1 = [20 x i8] c" Nothing to print\0A\00"
define void @print_lnk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 0, label %4
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c" Nothing to print\00"
@str.2 = [11 x i8] c" Standard\00"
define void @print_lnk(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _RPC_close(int);
int errno;
void do_close(int s) {
  int save;
  save = errno;
  (void)_RPC_close(s);
  errno = save;
}


x86 assembly (clang, -O0):
<do_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_RPC_close@plt>
mov    -0x8(%rbp),%ecx
mov    0x2ea7(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_close>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <_RPC_close@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @do_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @_RPC_close(i32 %5)
%7 = load i32, i32* %3
store i32 %7, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @do_close(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @_RPC_close(i32 %0)
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
short mus_char_to_lshort(const unsigned char *inp) {
  short o;
  unsigned char *outp = (unsigned char *)&o;
  memcpy((void *)outp, (void *)inp, 2);
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_lshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movswl -0xa(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_char_to_lshort>:
push   %rax
mov    %rdi,%rsi
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @mus_char_to_lshort(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i16* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %2
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 2)
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @mus_char_to_lshort(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 2)
%5 = load i16, i16* %2
ret i16 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ch(uint32_t x, uint32_t y, uint32_t z) { return (x & y) ^ ((~x) & z); }


x86 assembly (clang, -O0):
<ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ch(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 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ch(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t BME_LAC1_W(volatile uint32_t *addr,
                                             uint8_t bit) {
  return *(volatile uint32_t *)((uint32_t)addr | (1 << 27) | (bit << 21));
}


x86 assembly (clang, -O0):
<BME_LAC1_W>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
or     $0x8000000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x15,%ecx
or     %ecx,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_LAC1_W>:
shl    $0x15,%esi
or     %edi,%esi
movslq %esi,%rax
or     $0x8000000,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @BME_LAC1_W(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 = ptrtoint i32* %5 to i32
%7 = or i32 %6, 134217728
%8 = load i32, i32* %4
%9 = shl i32 %8, 21
%10 = or i32 %7, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @BME_LAC1_W(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = shl i32 %1, 21
%6 = or i32 %5, %4
%7 = or i32 %6, 134217728
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
ret i32 %10
}
long time(p)
long *p;
{
  long l = _time();
  if (p)
    *p = l;
  return l;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_time@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <time+0x2f>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_time@plt>
cltq
test   %rbx,%rbx
je     1125 <time+0x15>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i64 @time(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = call i32 (...) @_time()
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64*, i64** %2
%7 = icmp ne i64* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %3
%10 = load i64*, i64** %2
store i64 %9, i64* %10
br label %11
11: ; preds = %8, %1
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @time(i64* writeonly %0) {
%2 = tail call i32 (...) @_time()
%3 = sext i32 %2 to i64
%4 = icmp eq i64* %0, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i64 %3, i64* %0
br label %6
6: ; preds = %5, %1
ret i64 %3
}
void sif_platform_rescan_card(unsigned insert) {
  printk("%s id %d %u\n", __func__, 1, insert);
  sunxi_mci_rescan_card(1, insert);
}


x86 assembly (clang, -O0):
<sif_platform_rescan_card>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xecb(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <sunxi_mci_rescan_card@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sif_platform_rescan_card>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x1,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printk@plt>
mov    $0x1,%edi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <sunxi_mci_rescan_card@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s id %d %u\0A\00"
@__func__.sif_platform_rescan_card = [25 x i8] c"sif_platform_rescan_card\00"
define void @sif_platform_rescan_card(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.sif_platform_rescan_card, i64 0, i64 0), i32 1, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sunxi_mci_rescan_card to i32 (i32, i32, ...)*)(i32 1, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s id %d %u\0A\00"
@__func__.sif_platform_rescan_card = [25 x i8] c"sif_platform_rescan_card\00"
define void @sif_platform_rescan_card(i32 %0) {
%2 = tail call i32 (i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.sif_platform_rescan_card, i64 0, i64 0), i32 1, i32 %0)
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sunxi_mci_rescan_card to i32 (i32, i32, ...)*)(i32 1, i32 %0)
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ show_error(char *);
void *xrealloc(void *ptr, size_t size) {
  void *tmp = realloc(ptr, size);
  if (!tmp)
    show_error("Out of memory");
  return tmp;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <show_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <show_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @show_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @show_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ferror_unlocked(int /*<<< orphan*/ *);
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
int ferror(FILE *file) {
  flockfile(file);
  int result = ferror_unlocked(file);
  funlockfile(file);
  return result;
}


x86 assembly (clang, -O0):
<ferror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x8(%rbp),%rdi
call   1050 <ferror_unlocked@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ferror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <flockfile@plt>
mov    %rbx,%rdi
call   1050 <ferror_unlocked@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ferror(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @flockfile(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @ferror_unlocked(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @funlockfile(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @ferror(i32* %0) {
%2 = tail call i32 @flockfile(i32* %0)
%3 = tail call i32 @ferror_unlocked(i32* %0)
%4 = tail call i32 @funlockfile(i32* %0)
ret i32 %3
}
/* Type definitions */
struct sqlca_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OCDBFinish(int);
int _ocesqlDisconnect(struct sqlca_t *st, int id) {
  OCDBFinish(id);
  return 0;
}


x86 assembly (clang, -O0):
<_ocesqlDisconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <OCDBFinish@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ocesqlDisconnect>:
push   %rax
mov    %esi,%edi
call   1030 <OCDBFinish@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sqlca_t = type { i32 }
define i32 @_ocesqlDisconnect(%struct.sqlca_t* %0, i32 %1) {
%3 = alloca %struct.sqlca_t*
%4 = alloca i32
store %struct.sqlca_t* %0, %struct.sqlca_t** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @OCDBFinish(i32 %5)
ret i32 0
}

LLVM IR (-O2):
%struct.sqlca_t = type { i32 }
define i32 @_ocesqlDisconnect(%struct.sqlca_t* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @OCDBFinish(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stream_get_actor_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stream@%p::get_actor (rtpp_stream_get_actor) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_stream_get_actor_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_stream_get_actor_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"Method rtpp_stream@%p::get_actor (rtpp_stream_get_actor) is invoked after destruction\0A\00"
define void @rtpp_stream_get_actor_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"Method rtpp_stream@%p::get_actor (rtpp_stream_get_actor) is invoked after destruction\0A\00"
define void @rtpp_stream_get_actor_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
void g_value_get_int() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_int() {
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
void PWMGenIntTrigEnable(uint32_t ui32Base, uint32_t ui32Gen,
                         uint32_t ui32IntTrig) {
  ;
  ;

  ;
  (*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000004))) |=
      ui32IntTrig;
}


x86 assembly (clang, -O0):
<PWMGenIntTrigEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    %rcx,%rax
mov    0x4(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntTrigEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    %rdx,-0x18(%rsp)
mov    -0x18(%rsp),%rax
mov    -0x8(%rsp),%rcx
mov    -0x10(%rsp),%rdx
or     %rax,0x4(%rcx,%rdx,1)
ret

LLVM IR (-O0):
define void @PWMGenIntTrigEnable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %6
%8 = load volatile i64, i64* %4
%9 = load volatile i64, i64* %5
%10 = add nsw i64 %8, %9
%11 = add nsw i64 %10, 4
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %7
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @PWMGenIntTrigEnable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store volatile i64 %0, i64* %4
store volatile i64 %1, i64* %5
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %6
%8 = load volatile i64, i64* %4
%9 = load volatile i64, i64* %5
%10 = add i64 %8, 4
%11 = add i64 %10, %9
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %7
store volatile i64 %14, i64* %12
ret void
}