xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int exitval) {
  fprintf(exitval ? stderr : stdout,
          "Usage: wdtimer [--help] [--device id] <interval>\n");
  exit(exitval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <usage+0x26>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <usage+0x32>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <usage+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <usage+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [50 x i8] c"Usage: wdtimer [--help] [--device id] <interval>\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [50 x i8] c"Usage: wdtimer [--help] [--device id] <interval>\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ double_swap(size_t, size_t, double *);
void double_flip(double *array, size_t Nelements) {
  size_t i, end;
  end = Nelements - 1;
  for (i = 0; i < Nelements / 2; i++) {
    double_swap(i, end, array);
    end--;
  }
}


x86 assembly (clang, -O0):
<double_flip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
cmp    %rcx,%rax
jae    1177 <double_flip+0x67>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <double_swap@plt>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <double_flip+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_flip>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%rsi
jb     114b <double_flip+0x3b>
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%r12
shr    %r12
add    $0xffffffffffffffff,%r15
xor    %ebx,%ebx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <double_swap@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
cmp    %rbx,%r12
jne    1130 <double_flip+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @double_flip(double* %0, i64 %1) {
%3 = icmp ult i64 %1, 2
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = lshr i64 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %9, %6 ], [ %1, %4 ]
%8 = phi i64 [ %11, %6 ], [ 0, %4 ]
%9 = add i64 %7, -1
%10 = tail call i32 @double_swap(i64 %8, i64 %9, double* %0)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
double r_off_F(double x, double y, double z, double A, double B, double C,
               double D) {
  return (A * x + B * y + C * z + D);
}


x86 assembly (clang, -O0):
<r_off_F>:
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  %xmm6,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @r_off_F(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%15 = load double, double* %11
%16 = load double, double* %8
%17 = load double, double* %12
%18 = load double, double* %9
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = load double, double* %13
%22 = load double, double* %10
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double %20)
%24 = load double, double* %14
%25 = fadd double %23, %24
ret double %25
}

LLVM IR (-O2):
define double @r_off_F(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fmul double %1, %4
%9 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %9)
%11 = fadd double %10, %6
ret double %11
}
int islower(int c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <islower+0x20>
cmpl   $0x7a,-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):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
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 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ mode_native_to_git(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int git_stat(const char *path, struct stat *buf) {
  int rc = stat(path, buf);
  if (rc == 0)
    buf->st_mode = mode_native_to_git(buf->st_mode);
  return rc;
}


x86 assembly (clang, -O0):
<git_stat>:
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 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115d <git_stat+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <mode_native_to_git@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_stat>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <stat@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113a <git_stat+0x1a>
mov    (%rbx),%edi
call   1040 <mode_native_to_git@plt>
mov    %eax,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @git_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @stat(i8* %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load %struct.stat*, %struct.stat** %4
%13 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @mode_native_to_git(i32 %14)
%16 = load %struct.stat*, %struct.stat** %4
%17 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 0
store i32 %15, i32* %17
br label %18
18: ; preds = %11, %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @git_stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @mode_native_to_git(i32 %7)
store i32 %8, i32* %6
br label %9
9: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts2(char *);
int main(void) {
  char *str;
  str = "0123456789";
  puts2(str);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts2(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @main() {
%1 = tail call i32 @puts2(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *insert_bold(char *data, int *pc) {
  data[(*pc)++] = '\033';
  data[(*pc)++] = '[';
  data[(*pc)++] = '1';
  data[(*pc)++] = 'm';
  return data;
}


x86 assembly (clang, -O0):
<insert_bold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
movslq %ecx,%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
movslq %ecx,%rcx
movb   $0x5b,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
movslq %ecx,%rcx
movb   $0x31,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
movslq %ecx,%rcx
movb   $0x6d,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bold>:
mov    %rdi,%rax
movslq (%rsi),%rcx
lea    0x1(%rcx),%edx
mov    %edx,(%rsi)
movb   $0x1b,(%rdi,%rcx,1)
movslq (%rsi),%rcx
lea    0x1(%rcx),%edx
mov    %edx,(%rsi)
movb   $0x5b,(%rdi,%rcx,1)
movslq (%rsi),%rcx
lea    0x1(%rcx),%edx
mov    %edx,(%rsi)
movb   $0x31,(%rdi,%rcx,1)
movslq (%rsi),%rcx
lea    0x1(%rcx),%edx
mov    %edx,(%rsi)
movb   $0x6d,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define i8* @insert_bold(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 27, i8* %10
%11 = load i8*, i8** %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
store i8 91, i8* %16
%17 = load i8*, i8** %3
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i8, i8* %17, i64 %21
store i8 49, i8* %22
%23 = load i8*, i8** %3
%24 = load i32*, i32** %4
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
%27 = sext i32 %25 to i64
%28 = getelementptr inbounds i8, i8* %23, i64 %27
store i8 109, i8* %28
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @insert_bold(i8* returned writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 27, i8* %6
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 91, i8* %10
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 49, i8* %14
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 109, i8* %18
ret i8* %0
}
/* Variables and functions */
int SIGSYS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void handler(int sig) {
  if (sig != SIGSYS) {
    printf("Bad signal code: %d\n", sig);
    exit(1);
  } else {
    printf("Handler!\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     1158 <handler+0x38>
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2ea8(%rip),%rax
cmp    %edi,(%rax)
jne    114f <handler+0x1f>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    %edi,%esi
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGSYS = global i32 0
@.str = [21 x i8] c"Bad signal code: %d\0A\00"
@.str.1 = [10 x i8] c"Handler!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGSYS
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGSYS = global i32 0
@.str = [21 x i8] c"Bad signal code: %d\0A\00"
@str = [9 x i8] c"Handler!\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @SIGSYS
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int uart_write(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/);
int _write(int32_t file, uint8_t *ptr, int32_t len) {
  return uart_write(file, ptr, len);
}


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

x86 assembly (clang, -O2):
<_write>:
jmp    1030 <uart_write@plt>

LLVM IR (-O0):
define i32 @_write(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 = load i32, i32* %6
%10 = call i32 @uart_write(i32 %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @uart_write(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
int cmp(const void *p, const void *q) {
  int l = *(const int *)p;
  int r = *(const int *)q;
  if (l > r)
    return 1;
  else if (l < r)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <cmp+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <cmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <cmp+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ release();
int /*<<< orphan*/ stderr;
void error(const char *msg, int line) {
  fprintf(stderr, "ERROR [line: %d] %s\n", line, msg);
  if (line >= 260)
    release();
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x104,-0xc(%rbp)
jl     116f <error+0x3f>
mov    $0x0,%al
call   1040 <release@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
cmp    $0x104,%ebx
jl     115c <error+0x2c>
xor    %eax,%eax
call   1040 <release@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"ERROR [line: %d] %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 260
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @release()
br label %13
13: ; preds = %11, %2
%14 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"ERROR [line: %d] %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = icmp sgt i32 %1, 259
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @release()
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @exit(i32 -1)
unreachable
}
int template_call(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @template_call() {
ret i32 0
}
int fun721() { return 721; }


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

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

LLVM IR (-O0):
define i32 @fun721() {
ret i32 721
}

LLVM IR (-O2):
define i32 @fun721() {
ret i32 721
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
const char *sas_init_dev_status_reason_to_text(uint8_t reason) {
  switch (reason) {
  case (0x01):
    return "ADDED";
  case (0x02):
    return "NOT_RESPONDING";
  }
  return "UNKNOWN";
}


x86 assembly (clang, -O0):
<sas_init_dev_status_reason_to_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <sas_init_dev_status_reason_to_text+0x2c>
jmp    111b <sas_init_dev_status_reason_to_text+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     113c <sas_init_dev_status_reason_to_text+0x3c>
jmp    114c <sas_init_dev_status_reason_to_text+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <sas_init_dev_status_reason_to_text+0x57>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <sas_init_dev_status_reason_to_text+0x57>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_init_dev_status_reason_to_text>:
cmp    $0x2,%edi
lea    0xefc(%rip),%rax
lea    0xf04(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ADDED\00"
@.str.1 = [15 x i8] c"NOT_RESPONDING\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @sas_init_dev_status_reason_to_text(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"ADDED\00"
@.str.1 = [15 x i8] c"NOT_RESPONDING\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @sas_init_dev_status_reason_to_text(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
int hxd2i(int c) { return 15 & (c + 9 * (c >> 6)); }


x86 assembly (clang, -O0):
<hxd2i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x6,%ecx
imul   $0x9,%ecx,%ecx
add    %ecx,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hxd2i>:
mov    %edi,%eax
shr    $0x6,%eax
lea    (%rax,%rax,8),%eax
add    %edi,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @hxd2i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 6
%6 = mul nsw i32 9, %5
%7 = add nsw i32 %3, %6
%8 = and i32 15, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hxd2i(i32 %0) {
%2 = ashr i32 %0, 6
%3 = mul nsw i32 %2, 9
%4 = add nsw i32 %3, %0
%5 = and i32 %4, 15
ret i32 %5
}
/* Type definitions */
struct tm {
  int tm_mon;
  int tm_mday;
  int tm_year;
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void time2str(struct tm *date, char *time_str) {
  char tmp_str[10];
  tmp_str[0] = '\0';
  return;
  if (date->tm_mon + 1 < 10)
    sprintf(tmp_str, "0%d/", date->tm_mon + 1);
  else
    sprintf(tmp_str, "%d/", date->tm_mon + 1);
  strcpy(time_str, tmp_str);
  if (date->tm_mday < 10)
    sprintf(tmp_str, "0%d/", date->tm_mday);
  else
    sprintf(tmp_str, "%d/", date->tm_mday);
  strcat(time_str, tmp_str);
  if (date->tm_year % 100 < 10)
    sprintf(tmp_str, "0%d ", date->tm_year % 100);
  else
    sprintf(tmp_str, "%d ", date->tm_year % 100);
  strcat(time_str, tmp_str);
  if (date->tm_hour < 10)
    sprintf(tmp_str, "0%d:", date->tm_hour);
  else
    sprintf(tmp_str, "%d:", date->tm_hour);
  strcat(time_str, tmp_str);
  if (date->tm_min < 10)
    sprintf(tmp_str, "0%d:", date->tm_min);
  else
    sprintf(tmp_str, "%d:", date->tm_min);
  strcat(time_str, tmp_str);
  if (date->tm_sec < 10)
    sprintf(tmp_str, "0%d", date->tm_sec);
  else
    sprintf(tmp_str, "%d", date->tm_sec);
  strcat(time_str, tmp_str);
}


x86 assembly (clang, -O0):
<time2str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x1a(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
define void @time2str(%struct.tm* %0, i8* %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
%5 = alloca [10 x i8]
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
define void @time2str(%struct.tm* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int errno;
int vfwscanf_unlocked(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                      int /*<<< orphan*/);
int vfwscanf(FILE *restrict stream, const wchar_t *restrict format,
             va_list args) {
  int r, saved_errno;
  ;
  r = vfwscanf_unlocked(stream, format, args);
  saved_errno = errno;
  ;
  return errno = saved_errno, r;
}


x86 assembly (clang, -O0):
<vfwscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfwscanf_unlocked@plt>
mov    %eax,-0x18(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    0x2e94(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfwscanf>:
jmp    1030 <vfwscanf_unlocked@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @vfwscanf(i32* noalias %0, i32* noalias %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = call i32 @vfwscanf_unlocked(i32* %9, i32* %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* @errno
store i32 %13, i32* %8
%14 = load i32, i32* %8
store i32 %14, i32* @errno
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @vfwscanf(i32* noalias %0, i32* noalias %1, i32 %2) {
%4 = tail call i32 @vfwscanf_unlocked(i32* %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int foo();
int _old_foo() { return foo(); }


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

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

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

LLVM IR (-O2):
define i32 @_old_foo() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
void foo243(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo243(i32 %0) {
ret void
}
unsigned char inportb(unsigned short int port) {
  unsigned char v;
  asm volatile("inb %w1,%0" : "=a"(v) : "Nd"(port));
  return v;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumDivisibleBy(int);
int main() {
  printf("%d\n", sumDivisibleBy(3) + sumDivisibleBy(5) - sumDivisibleBy(15));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <sumDivisibleBy@plt>
mov    %eax,-0xc(%rbp)
mov    $0x5,%edi
call   1040 <sumDivisibleBy@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xf,%edi
call   1040 <sumDivisibleBy@plt>
mov    -0x8(%rbp),%esi
sub    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1040 <sumDivisibleBy@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1040 <sumDivisibleBy@plt>
add    %eax,%ebx
mov    $0xf,%edi
call   1040 <sumDivisibleBy@plt>
sub    %eax,%ebx
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sumDivisibleBy(i32 3)
%3 = call i32 @sumDivisibleBy(i32 5)
%4 = add nsw i32 %2, %3
%5 = call i32 @sumDivisibleBy(i32 15)
%6 = sub nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sumDivisibleBy(i32 3)
%2 = tail call i32 @sumDivisibleBy(i32 5)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @sumDivisibleBy(i32 15)
%5 = sub i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_stdout_init();
void log_init(void) { log_stdout_init(); }


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

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

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

LLVM IR (-O2):
define void @log_init() {
%1 = tail call i32 (...) @log_stdout_init()
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvaddwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvaddwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvaddwstr+0x2a>
jmp    1170 <cmd_mvaddwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvaddwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvaddwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvaddwstr(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 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvaddwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ funca();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("utila 2\n");
  funca();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"utila 2\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @funca()
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"utila 2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @funca()
ret i32 0
}
void TimerConfigure(unsigned long ulBase, unsigned long ulConfig) {
  ;

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &=
      ~(0x00000001 | 0x00000100);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulConfig >> 24;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) =
      (ulConfig & 255) | 0x00000200;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) =
      ((ulConfig >> 8) & 255) | 0x00000200;
}


x86 assembly (clang, -O0):
<TimerConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    $0xfffffffffffffefe,%rcx
mov    %rcx,0xc(%rax)
mov    -0x10(%rbp),%rcx
shr    $0x18,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
and    $0xff,%rcx
or     $0x200,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4(%rax)
mov    -0x10(%rbp),%rcx
shr    $0x8,%rcx
and    $0xff,%rcx
or     $0x200,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerConfigure>:
mov    %rsi,%rax
andq   $0xfffffffffffffefe,0xc(%rdi)
ff
movzbl %al,%ecx
movzbl %ah,%edx
shr    $0x18,%rax
mov    %rax,(%rdi)
or     $0x200,%rcx
mov    %rcx,0x4(%rdi)
or     $0x200,%rdx
mov    %rdx,0x8(%rdi)
ret

LLVM IR (-O0):
define void @TimerConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 12
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -258
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = lshr i64 %10, 24
%12 = load i64, i64* %3
%13 = add i64 %12, 0
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
%15 = load i64, i64* %4
%16 = and i64 %15, 255
%17 = or i64 %16, 512
%18 = load i64, i64* %3
%19 = add i64 %18, 4
%20 = inttoptr i64 %19 to i64*
store volatile i64 %17, i64* %20
%21 = load i64, i64* %4
%22 = lshr i64 %21, 8
%23 = and i64 %22, 255
%24 = or i64 %23, 512
%25 = load i64, i64* %3
%26 = add i64 %25, 8
%27 = inttoptr i64 %26 to i64*
store volatile i64 %24, i64* %27
ret void
}

LLVM IR (-O2):
define void @TimerConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -258
store volatile i64 %6, i64* %4
%7 = lshr i64 %1, 24
%8 = inttoptr i64 %0 to i64*
store volatile i64 %7, i64* %8
%9 = and i64 %1, 255
%10 = or i64 %9, 512
%11 = add i64 %0, 4
%12 = inttoptr i64 %11 to i64*
store volatile i64 %10, i64* %12
%13 = lshr i64 %1, 8
%14 = and i64 %13, 255
%15 = or i64 %14, 512
%16 = add i64 %0, 8
%17 = inttoptr i64 %16 to i64*
store volatile i64 %15, i64* %17
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265vps_get_vps_id(const uint8_t *p_h265vps) {
  return (p_h265vps[5] & 0xf0) >> 4;
}


x86 assembly (clang, -O0):
<h265vps_get_vps_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0xf0,%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265vps_get_vps_id>:
mov    0x14(%rdi),%eax
shr    $0x4,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @h265vps_get_vps_id(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 240
%7 = ashr i32 %6, 4
ret i32 %7
}

LLVM IR (-O2):
define i32 @h265vps_get_vps_id(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = and i32 %4, 15
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void get_signal_alarm() { exit(0); }


x86 assembly (clang, -O0):
<get_signal_alarm>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<get_signal_alarm>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @get_signal_alarm() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @get_signal_alarm() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float my_random_float2();
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ srandom(int);
main(int argc, char *argv[]) {
  int i;
  float f;
  double d;
  double t0, t1;
  int iters = 1000;
  int seed = 17;
  srandom(seed);
  for (i = 0; i < iters; i++) {
    f = my_random_float2();
    printf("%f\n", f);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x34(%rbp)
movl   $0x11,-0x38(%rbp)
mov    -0x38(%rbp),%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    119a <main+0x6a>
mov    $0x0,%al
call   1040 <my_random_float2@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x11,%edi
call   1030 <srandom@plt>
mov    $0x3e8,%ebp
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <my_random_float2@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %11
store i32 17, i32* %12
%13 = load i32, i32* %12
%14 = call i32 @srandom(i32 %13)
store i32 0, i32* %6
br label %15
15: ; preds = %23, %2
%16 = load i32, i32* %6
%17 = load i32, i32* %11
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = call float (...) @my_random_float2()
store float %20, float* %7
%21 = load float, float* %7
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %21)
br label %23
23: ; preds = %19
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %15
26: ; preds = %15
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srandom(i32 17)
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call float (...) @my_random_float2()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 0
}
/* Variables and functions */
unsigned int ft_ctablen(char **const tab) {
  unsigned int len;
  len = 0;
  while (tab[len] != NULL)
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<ft_ctablen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpq   $0x0,(%rax,%rcx,8)
je     112f <ft_ctablen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_ctablen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ctablen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi,%rax,8)
jne    1110 <ft_ctablen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_ctablen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
void gtk_entry_get_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_get_text() {
ret void
}
/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/);
int putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int c;
  while ((c = getc(stdin)) != EOF) {
    if ((putc(c, stdout)) == EOF) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%eax
je     1180 <main+0x60>
mov    -0x14(%rbp),%edi
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%eax
jne    117b <main+0x5b>
jmp    1180 <main+0x60>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2ebc(%rip),%r14
mov    0x2ead(%rip),%rbx
mov    0x2e96(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%r14),%edi
call   1040 <getc@plt>
cmp    (%rbx),%eax
je     115a <main+0x3a>
mov    (%r15),%esi
mov    %eax,%edi
call   1030 <putc@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* @stdin
%9 = call i32 @getc(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = load i32, i32* %6
%14 = load i32, i32* @stdout
%15 = call i32 @putc(i32 %13, i32 %14)
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %12
br label %20
19: ; preds = %12
br label %7
20: ; preds = %18, %7
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %8, %2
%4 = load i32, i32* @stdin
%5 = tail call i32 @getc(i32 %4)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i32, i32* @stdout
%10 = tail call i32 @putc(i32 %5, i32 %9)
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %3
13: ; preds = %8, %3
ret i32 0
}