xunge/DecIR huggingface dataset:
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  if (!s || !(*f))
    return;
  i = 0;
  while (s[i]) {
    (*f)(&(s[i]));
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <ft_striter+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    112b <ft_striter+0x2b>
jmp    1163 <ft_striter+0x63>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1163 <ft_striter+0x63>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
add    %rcx,%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <ft_striter+0x32>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
tail call void %1(i8* %11)
%12 = add nuw i64 %10, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
scalar_t__ euid();
char const *getusername(int);
scalar_t__ ruid();
char const *getcaller() { return getusername(euid() != ruid()); }


x86 assembly (clang, -O0):
<getcaller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <euid@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ruid@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <getusername@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcaller>:
push   %rbx
xor    %eax,%eax
call   1030 <euid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <ruid@plt>
xor    %edi,%edi
cmp    %rax,%rbx
setne  %dil
pop    %rbx
jmp    1040 <getusername@plt>

LLVM IR (-O0):
define i8* @getcaller() {
%1 = call i64 (...) @euid()
%2 = call i64 (...) @ruid()
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = call i8* @getusername(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @getcaller() {
%1 = tail call i64 (...) @euid()
%2 = tail call i64 (...) @ruid()
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i8* @getusername(i32 %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t write_FP_BE(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
size_t int32WriteToFP(FILE *fp, const int32_t *data) {
  return write_FP_BE(fp, data, sizeof(int32_t));
}


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

x86 assembly (clang, -O2):
<int32WriteToFP>:
mov    $0x4,%edx
jmp    1030 <write_FP_BE@plt>

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

LLVM IR (-O2):
define i64 @int32WriteToFP(i32* %0, i32* %1) {
%3 = tail call i64 @write_FP_BE(i32* %0, i32* %1, i32 4)
ret i64 %3
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_div_uint(struct Var *avar, const char *areg, const char *lreg,
                     const char *rreg) {
  pA("%s = %s / %s;", areg, lreg, rreg);
}


x86 assembly (clang, -O0):
<__func_div_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s / %s;\00"
define void @__func_div_uint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s / %s;\00"
define void @__func_div_uint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wdctl_command(int);
void wdctl_clear_trusted_pan_domains(void) { wdctl_command(30); }


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

x86 assembly (clang, -O2):
<wdctl_clear_trusted_pan_domains>:
mov    $0x1e,%edi
jmp    1030 <wdctl_command@plt>

LLVM IR (-O0):
define void @wdctl_clear_trusted_pan_domains() {
%1 = call i32 @wdctl_command(i32 30)
ret void
}

LLVM IR (-O2):
define void @wdctl_clear_trusted_pan_domains() {
%1 = tail call i32 @wdctl_command(i32 30)
ret void
}
/* Variables and functions */
int fibR(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int N;
  N = 34;
  printf("fib: %d\n", fibR(N));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"fib: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fibR(i32 34)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int timespec_now_monotonic_raw(struct timespec *ts) {
  return clock_gettime(CLOCK_MONOTONIC_RAW, ts);
}


x86 assembly (clang, -O0):
<timespec_now_monotonic_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_now_monotonic_raw>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @timespec_now_monotonic_raw(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC_RAW
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i32 @clock_gettime(i32 %3, %struct.timespec* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @timespec_now_monotonic_raw(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = tail call i32 @clock_gettime(i32 %2, %struct.timespec* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int net_init_socket(void) {
  int sock;
  signal(SIGPIPE, SIG_IGN);
  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    perror("socket");
  return sock;
}


x86 assembly (clang, -O0):
<net_init_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1180 <net_init_socket+0x50>
lea    0xe85(%rip),%rdi
call   1040 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_init_socket>:
push   %rbx
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
js     116b <net_init_socket+0x3b>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe8e(%rip),%rdi
call   1040 <perror@plt>
jmp    1167 <net_init_socket+0x37>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @net_init_socket() {
%1 = alloca i32
%2 = load i32, i32* @SIGPIPE
%3 = load i32, i32* @SIG_IGN
%4 = call i32 @signal(i32 %2, i32 %3)
%5 = load i32, i32* @AF_INET
%6 = load i32, i32* @SOCK_STREAM
%7 = call i32 @socket(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %1
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @net_init_socket() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @AF_INET
%5 = load i32, i32* @SOCK_STREAM
%6 = tail call i32 @socket(i32 %4, i32 %5, i32 0)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 %6
}
unsigned char validLetter(char const letter) {
  return 'a' <= letter && letter <= 'z';
}


x86 assembly (clang, -O0):
<validLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <validLetter+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validLetter>:
add    $0x9f,%dil
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @validLetter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @validLetter(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i;
  for (i = 0; i < 5; (++i) + 1)
    printf("%d ", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
uint8_t s337_get_data_stream(const uint8_t *p_s337) {
  return (p_s337[4] & 0xe0) >> 5;
}


x86 assembly (clang, -O0):
<s337_get_data_stream>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0xe0,%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s337_get_data_stream>:
mov    0x10(%rdi),%eax
shr    $0x5,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @s337_get_data_stream(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 7
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void scan_line(FILE *file, int nbLine) {
  char c;
  int n;
  for (n = 0; n < nbLine; n++) {
    do {
      c = fgetc(file);
    } while (c != '\n');
  }
}


x86 assembly (clang, -O0):
<scan_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <scan_line+0x53>
jmp    1137 <scan_line+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
jne    1137 <scan_line+0x27>
jmp    1155 <scan_line+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <scan_line+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_line>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1134 <scan_line+0x24>
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %ebp,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1120 <scan_line+0x10>
add    $0x1,%ebp
cmp    %r14d,%ebp
jne    1120 <scan_line+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @scan_line(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %9
%5 = phi i32 [ %10, %9 ], [ 0, %2 ]
br label %6
6: ; preds = %4, %6
%7 = tail call signext i8 @fgetc(i32* %0)
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %6
9: ; preds = %6
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vmemDumpHeap();
int /*<<< orphan*/ vmemDumpStack();
void vmemDump() {
  vmemDumpHeap();
  vmemDumpStack();
}


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

x86 assembly (clang, -O2):
<vmemDump>:
push   %rax
xor    %eax,%eax
call   1030 <vmemDumpHeap@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <vmemDumpStack@plt>

LLVM IR (-O0):
define void @vmemDump() {
%1 = call i32 (...) @vmemDumpHeap()
%2 = call i32 (...) @vmemDumpStack()
ret void
}

LLVM IR (-O2):
define void @vmemDump() {
%1 = tail call i32 (...) @vmemDumpHeap()
%2 = tail call i32 (...) @vmemDumpStack()
ret void
}
void cubeb_set_coreaudio_notification_runloop() {}


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

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

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

LLVM IR (-O2):
define void @cubeb_set_coreaudio_notification_runloop() {
ret void
}
int get_motor_position_counter(int motor) {}


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

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

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

LLVM IR (-O2):
define i32 @get_motor_position_counter(i32 %0) {
ret i32 undef
}
void OTAinit() {}


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

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

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

LLVM IR (-O2):
define void @OTAinit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  scalar_t__ tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ __time_to_tm(int /*<<< orphan*/ const, struct tm *);
struct tm *gmtime(const time_t *t) {
  static struct tm tm;
  __time_to_tm(*t, &tm);
  tm.tm_isdst = 0;
  return &tm;
}


x86 assembly (clang, -O0):
<gmtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0x2f07(%rip),%rsi
call   1030 <__time_to_tm@plt>
movq   $0x0,0x2ef7(%rip)
lea    0x2ef0(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmtime>:
push   %rbx
mov    (%rdi),%edi
lea    0x2f16(%rip),%rbx
mov    %rbx,%rsi
call   1030 <__time_to_tm@plt>
movq   $0x0,0x2f03(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i64 }
@gmtime.tm = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @__time_to_tm(i32 %4, %struct.tm* @gmtime.tm)
store i64 0, i64* getelementptr inbounds (%struct.tm, %struct.tm* @gmtime.tm, i32 0, i32 0)
ret %struct.tm* @gmtime.tm
}

LLVM IR (-O2):
%struct.tm = type { i64 }
@gmtime.tm = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @__time_to_tm(i32 %2, %struct.tm* @gmtime.tm)
store i64 0, i64* getelementptr inbounds (%struct.tm, %struct.tm* @gmtime.tm, i64 0, i32 0)
ret %struct.tm* @gmtime.tm
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fetch_str(int);
int prefetch_strlen();
void fetch_skip_str(void) {
  int l = prefetch_strlen();
  assert(l >= 0);
  fetch_str(l);
}


x86 assembly (clang, -O0):
<fetch_skip_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <prefetch_strlen@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1040 <fetch_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_skip_str>:
push   %rbx
xor    %eax,%eax
call   1030 <prefetch_strlen@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1050 <assert@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <fetch_str@plt>

LLVM IR (-O0):
define void @fetch_skip_str() {
%1 = alloca i32
%2 = call i32 (...) @prefetch_strlen()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @fetch_str(i32 %7)
ret void
}

LLVM IR (-O2):
define void @fetch_skip_str() {
%1 = tail call i32 (...) @prefetch_strlen()
%2 = xor i32 %1, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @fetch_str(i32 %1)
ret void
}
/* Variables and functions */
double abs(double);
double UC_11_5_1(double M_v_s_d, double M_v_asym_u_d) {
  return (abs(M_v_s_d) / M_v_asym_u_d);
}


x86 assembly (clang, -O0):
<UC_11_5_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
divsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UC_11_5_1>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <abs@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @UC_11_5_1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @abs(double %5)
%7 = load double, double* %4
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @UC_11_5_1(double %0, double %1) {
%3 = tail call double @abs(double %0)
%4 = fdiv double %3, %1
ret double %4
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
int ops_print_avp();
int w_print_avps(struct sip_msg *msg, char *foo, char *bar) {
  return ops_print_avp();
}


x86 assembly (clang, -O0):
<w_print_avps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <ops_print_avp@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
define i32 @w_print_avps(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sip_msg*
%5 = alloca i8*
%6 = alloca i8*
store %struct.sip_msg* %0, %struct.sip_msg** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 (...) @ops_print_avp()
ret i32 %7
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @w_print_avps(%struct.sip_msg* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @ops_print_avp()
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *const, char const *const);
int fi_strcmp0(const char *const s1, const char *const s2) {
  return s1 && s2 && strcmp(s1, s2) == 0;
}


x86 assembly (clang, -O0):
<fi_strcmp0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1157 <fi_strcmp0+0x47>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1157 <fi_strcmp0+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi_strcmp0>:
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <fi_strcmp0+0x21>
test   %rsi,%rsi
je     1131 <fi_strcmp0+0x21>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @fi_strcmp0(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp eq i64 %13, 0
br label %15
15: ; preds = %10, %7, %2
%16 = phi i1 [ false, %7 ], [ false, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @fi_strcmp0(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
struct observations {
  int dummy;
};
struct dffa {
  int dummy;
};

/* Variables and functions */
double dffa_mdi_score2(struct dffa *, int, int, int);
int dffa_mdi_compatible(struct dffa *dffa, int qu, int qv, double alpha,
                        struct observations *o, int numobs) {
  double score;
  score = dffa_mdi_score2(dffa, qu, qv, numobs);
  if (score < alpha)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dffa_mdi_compatible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x2c(%rbp),%ecx
call   1030 <dffa_mdi_score2@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1166 <dffa_mdi_compatible+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <dffa_mdi_compatible+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dffa_mdi_compatible>:
push   %rax
mov    %r8d,%ecx
movsd  %xmm0,(%rsp)
call   1030 <dffa_mdi_score2@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.dffa = type { i32 }
%struct.observations = type { i32 }
define i32 @dffa_mdi_compatible(%struct.dffa* %0, i32 %1, i32 %2, double %3, %struct.observations* %4, i32 %5) {
%7 = alloca i32
%8 = alloca %struct.dffa*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca %struct.observations*
%13 = alloca i32
%14 = alloca double
store %struct.dffa* %0, %struct.dffa** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double %3, double* %11
store %struct.observations* %4, %struct.observations** %12
store i32 %5, i32* %13
%15 = load %struct.dffa*, %struct.dffa** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %13
%19 = call double @dffa_mdi_score2(%struct.dffa* %15, i32 %16, i32 %17, i32 %18)
store double %19, double* %14
%20 = load double, double* %14
%21 = load double, double* %11
%22 = fcmp olt double %20, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
%struct.dffa = type { i32 }
%struct.observations = type { i32 }
define i32 @dffa_mdi_compatible(%struct.dffa* %0, i32 %1, i32 %2, double %3, %struct.observations* nocapture readnone %4, i32 %5) {
%7 = tail call double @dffa_mdi_score2(%struct.dffa* %0, i32 %1, i32 %2, i32 %5)
%8 = fcmp olt double %7, %3
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ writev1();
int /*<<< orphan*/ writev2();
int main() {
  writev1();
  writev2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @writev1()
%2 = tail call i32 (...) @writev2()
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sstdevpn(int, int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sstdevpn(N, 1, x, stride);
  printf("sample standard deviation: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    $0x1,%esi
call   1030 <stdlib_strided_sstdevpn@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1030 <stdlib_strided_sstdevpn@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [31 x i8] c"sample standard deviation: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sstdevpn(i32 %6, i32 1, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [31 x i8] c"sample standard deviation: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sstdevpn(i32 4, i32 1, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void foo() {
  FILE *x = fopen("xyz", "r");
  fclose(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"xyz\00"
@.str.1 = [2 x i8] c"r\00"
define void @foo() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"xyz\00"
@.str.1 = [2 x i8] c"r\00"
define void @foo() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret void
}
void test4_TestExports_enable__I() {}


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

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

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

LLVM IR (-O2):
define void @test4_TestExports_enable__I() {
ret void
}
/* Variables and functions */
size_t SIZE_MAX;
void *ralloc_size(void const *, size_t);
void *ralloc_array_size(const void *ctx, size_t size, size_t count) {
  if (count > SIZE_MAX / size)
    return NULL;
  return ralloc_size(ctx, size * count);
}


x86 assembly (clang, -O0):
<ralloc_array_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    115b <ralloc_array_size+0x4b>
movq   $0x0,-0x8(%rbp)
jmp    1171 <ralloc_array_size+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1030 <ralloc_size@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ralloc_array_size>:
mov    %rdx,%rcx
mov    0x2ebe(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1136 <ralloc_array_size+0x26>
xor    %edx,%edx
div    %rsi
cmp    %rcx,%rax
jae    113f <ralloc_array_size+0x2f>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %esi
cmp    %rcx,%rax
jb     1133 <ralloc_array_size+0x23>
imul   %rsi,%rcx
mov    %rcx,%rsi
jmp    1030 <ralloc_size@plt>

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i8* @ralloc_array_size(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = load i64, i64* @SIZE_MAX
%10 = load i64, i64* %6
%11 = udiv i64 %9, %10
%12 = icmp ugt i64 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store i8* null, i8** %4
br label %20
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = mul i64 %16, %17
%19 = call i8* @ralloc_size(i8* %15, i64 %18)
store i8* %19, i8** %4
br label %20
20: ; preds = %14, %13
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i8* @ralloc_array_size(i8* %0, i64 %1, i64 %2) {
%4 = load i64, i64* @SIZE_MAX
%5 = udiv i64 %4, %1
%6 = icmp ult i64 %5, %2
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = mul i64 %2, %1
%9 = tail call i8* @ralloc_size(i8* %0, i64 %8)
br label %10
10: ; preds = %3, %7
%11 = phi i8* [ %9, %7 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ twoDsim_gravity(double);
void gravity(double g) { twoDsim_gravity(g); }


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

x86 assembly (clang, -O2):
<gravity>:
jmp    1030 <twoDsim_gravity@plt>

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

LLVM IR (-O2):
define void @gravity(double %0) {
%2 = tail call i32 @twoDsim_gravity(double %0)
ret void
}
int main() {
  void asm_main();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_adc_enable_sleep() {
  pmu_reg_write(0x3B, ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |
                       (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) |
                       (1 << 10) | (1 << 11) | (0 << 12) | (1 << 13) |
                       (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
                       (1 << 18) | (0 << 19) | (1 << 20)));
}


x86 assembly (clang, -O0):
<pmu_adc_enable_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
mov    $0x17efff,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_enable_sleep>:
mov    $0x3b,%edi
mov    $0x17efff,%esi
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_adc_enable_sleep() {
%1 = call i32 @pmu_reg_write(i32 59, i32 1568767)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_enable_sleep() {
%1 = tail call i32 @pmu_reg_write(i32 59, i32 1568767)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stdout;
void subunit_test_pass(char const *const name) {
  fprintf(stdout, "success: %s\n", name);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<subunit_test_pass>:
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   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subunit_test_pass>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"success: %s\0A\00"
define void @subunit_test_pass(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"success: %s\0A\00"
define void @subunit_test_pass(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
int main(void) {
  int *p;
  {
    int x = 5;
    p = &x;
  }
  int y = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int n = 10;
  char *s1 = malloc(10);
  char s2 = 'a';
  memset(s1, s2, n - 1);
  *(s1 + n - 1) = '\0';
  printf("%s\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movb   $0x61,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
movsbl %al,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x10(%rbp),%rsi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x61,%esi
mov    $0x9,%edx
call   1040 <memset@plt>
movb   $0x0,0x9(%rbx)
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
store i32 0, i32* %1
store i32 10, i32* %2
%5 = call i8* @malloc(i32 10)
store i8* %5, i8** %3
store i8 97, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @memset(i8* %6, i8 signext %7, i32 %9)
%11 = load i8*, i8** %3
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = getelementptr inbounds i8, i8* %14, i64 -1
store i8 0, i8* %15
%16 = load i8*, i8** %3
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @memset(i8* %1, i8 signext 97, i32 9)
%3 = getelementptr inbounds i8, i8* %1, i64 9
store i8 0, i8* %3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_mem_attrs();
void set_mem_alias_set() { get_mem_attrs(); }


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

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

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

LLVM IR (-O2):
define void @set_mem_alias_set() {
%1 = tail call i32 (...) @get_mem_attrs()
ret void
}
/* Type definitions */
struct datafile_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_new();
struct datafile_list *datafile_list_new(void) {
  return ((struct datafile_list *)(genlist_new()));
}


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

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

LLVM IR (-O0):
%struct.datafile_list = type { i32 }
define %struct.datafile_list* @datafile_list_new() {
%1 = call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.datafile_list*
ret %struct.datafile_list* %2
}

LLVM IR (-O2):
%struct.datafile_list = type { i32 }
define %struct.datafile_list* @datafile_list_new() {
%1 = tail call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.datafile_list*
ret %struct.datafile_list* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void reboot_device() {
  printf("Rebooting!\n");
  system("reboot system");
}


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

x86 assembly (clang, -O2):
<reboot_device>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Rebooting!\0A\00"
@.str.1 = [14 x i8] c"reboot system\00"
define void @reboot_device() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"reboot system\00"
@str = [11 x i8] c"Rebooting!\00"
define void @reboot_device() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void kino_MemMan_wrapped_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @kino_MemMan_wrapped_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void iommu_debug_detach_device(struct iommu_domain *domain,
                               struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.iommu_domain = type opaque
%struct.device = type opaque
define void @iommu_debug_detach_device(%struct.iommu_domain* nocapture %0, %struct.device* nocapture %1) {
ret void
}