xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int sub(int);
int main() {
  int i = 1, n;
  scanf("%d", &n);
  while (sub(n) != 0) {
    n = sub(n);
    i++;
  }
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1050 <sub@plt>
cmp    $0x0,%eax
je     1180 <main+0x50>
mov    -0xc(%rbp),%edi
call   1050 <sub@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x26>
mov    -0x8(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <sub@plt>
mov    $0x1,%ebx
test   %eax,%eax
je     117b <main+0x4b>
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%edi
call   1050 <sub@plt>
mov    %eax,0xc(%rsp)
add    $0x1,%ebx
mov    %eax,%edi
call   1050 <sub@plt>
test   %eax,%eax
jne    1160 <main+0x30>
lea    0xe7e(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @sub(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %11, %7 ], [ 1, %0 ]
%9 = load i32, i32* %1
%10 = call i32 @sub(i32 %9)
store i32 %10, i32* %1
%11 = add nuw nsw i32 %8, 1
%12 = call i32 @sub(i32 %10)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %0
%15 = phi i32 [ 1, %0 ], [ %11, %7 ]
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}
/* Variables and functions */
scalar_t__ getegid();
scalar_t__ geteuid();
scalar_t__ getgid();
scalar_t__ getuid();
int _sndio_issetugid(void) {
  if (getuid() != geteuid())
    return 1;
  if (getgid() != getegid())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<_sndio_issetugid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     1176 <_sndio_issetugid+0x36>
movl   $0x1,-0x4(%rbp)
jmp    11ab <_sndio_issetugid+0x6b>
mov    $0x0,%al
call   1050 <getgid@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <getegid@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     11a4 <_sndio_issetugid+0x64>
movl   $0x1,-0x4(%rbp)
jmp    11ab <_sndio_issetugid+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sndio_issetugid>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    %rcx,%rbx
jne    117b <_sndio_issetugid+0x3b>
xor    %eax,%eax
call   1050 <getgid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <getegid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_sndio_issetugid() {
%1 = alloca i32
%2 = call i64 (...) @getuid()
%3 = call i64 (...) @geteuid()
%4 = icmp ne i64 %2, %3
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %12
6: ; preds = %0
%7 = call i64 (...) @getgid()
%8 = call i64 (...) @getegid()
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6
store i32 1, i32* %1
br label %12
11: ; preds = %6
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10, %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @_sndio_issetugid() {
%1 = tail call i64 (...) @getuid()
%2 = tail call i64 (...) @geteuid()
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 (...) @getgid()
%6 = tail call i64 (...) @getegid()
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ 1, %0 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
char *_cow_malloc(int);
int /*<<< orphan*/ cow_trim_out(char const *, char *, char);
int strlen(char const *);
const char *cow_trim(const char *str, char c) {
  char *trimmed_str = _cow_malloc((sizeof(char) * strlen(str) + 1));
  cow_trim_out(str, trimmed_str, c);
  return trimmed_str;
}


x86 assembly (clang, -O0):
<cow_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <_cow_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsbl -0x9(%rbp),%edx
call   1050 <cow_trim_out@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow_trim>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%edi
call   1040 <_cow_malloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14d,%edx
call   1050 <cow_trim_out@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @cow_trim(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = add i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i8* @_cow_malloc(i32 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %5
%15 = load i8, i8* %4
%16 = call i32 @cow_trim_out(i8* %13, i8* %14, i8 signext %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @cow_trim(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add i32 %3, 1
%5 = tail call i8* @_cow_malloc(i32 %4)
%6 = tail call i32 @cow_trim_out(i8* %0, i8* %5, i8 signext %1)
ret i8* %5
}
int foo_me(int foo_int, char *foo_char) {}


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

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

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

LLVM IR (-O2):
define i32 @foo_me(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Write_LCD(int, char *, int);
void Disable_Wrap(int fd) {
  char cmd[] = {254, 68, 253};
  Write_LCD(fd, cmd, 3);
}


x86 assembly (clang, -O0):
<Disable_Wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Disable_Wrap>:
push   %rax
movb   $0xfd,0x6(%rsp)
movw   $0x44fe,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.Disable_Wrap.cmd = [3 x i8] c"\FED\FD"
define void @Disable_Wrap(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = bitcast [3 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @Write_LCD(i32 %5, i8* %6, i32 3)
ret void
}

LLVM IR (-O2):
@__const.Disable_Wrap.cmd = [3 x i8] c"\FED\FD"
define void @Disable_Wrap(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @Write_LCD(i32 %0, i8* %3, i32 3)
ret void
}
int foo(int x) { return (x) > 0 ? 0 : 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 0, i32 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned int void_hash(void *p) {
  unsigned int n = (int)p;
  return n;
}


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

x86 assembly (clang, -O2):
<void_hash>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @void_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int rand();
void generate_start_state(int *state, int k) {
  for (int i = 0; i < k; i++) {
    state[i] = rand() % k - 1;
  }
}


x86 assembly (clang, -O0):
<generate_start_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <generate_start_state+0x49>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
sub    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <generate_start_state+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_start_state>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    114b <generate_start_state+0x3b>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
add    $0xffffffff,%edx
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <generate_start_state+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @generate_start_state(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, %1
%11 = add nsw i32 %10, -1
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
int internal_sign_i(int value) {
  return (value >= 0 ? (value == 0 ? 0 : 1) : -1);
}


x86 assembly (clang, -O0):
<internal_sign_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1129 <internal_sign_i+0x29>
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <internal_sign_i+0x36>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <internal_sign_i+0x36>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_sign_i>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @internal_sign_i(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 %4, i32 -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x7e() {
  Assert_real((isprint(126)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              635, ("isprint should be 1 for ~"));
}


x86 assembly (clang, -O0):
<t_isprint_0x7e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x27b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x7e>:
push   %rax
mov    $0x7e,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x27b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for ~\00"
define void @t_isprint_0x7e() {
%1 = call i32 @isprint(i32 126)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for ~\00"
define void @t_isprint_0x7e() {
%1 = tail call i32 @isprint(i32 126)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void wifi_rsp_sme_scan_results_sort_rssi(
    const struct wifi_msg_sme_scan_results_sort_rssi_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_sme_scan_results_sort_rssi_rsp_t = type opaque
define void @wifi_rsp_sme_scan_results_sort_rssi(%struct.wifi_msg_sme_scan_results_sort_rssi_rsp_t* %0) {
%2 = alloca %struct.wifi_msg_sme_scan_results_sort_rssi_rsp_t*
store %struct.wifi_msg_sme_scan_results_sort_rssi_rsp_t* %0, %struct.wifi_msg_sme_scan_results_sort_rssi_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_sme_scan_results_sort_rssi_rsp_t = type opaque
define void @wifi_rsp_sme_scan_results_sort_rssi(%struct.wifi_msg_sme_scan_results_sort_rssi_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int putint(int x) { printf("%d", x); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @putint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
char *strchr(char *, char);
int slashes(char *cp) {
  int n = 0;
  while ((cp = strchr(++cp, '/')))
    n++;
  return n;
}


x86 assembly (clang, -O0):
<slashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1155 <slashes+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <slashes+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slashes>:
push   %rbx
mov    %rdi,%rax
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1120 <slashes+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @slashes(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = call i8* @strchr(i8* %6, i8 signext 47)
store i8* %7, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @slashes(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %8, %2 ]
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = tail call i8* @strchr(i8* %5, i8 signext 47)
%7 = icmp eq i8* %6, null
%8 = add nuw nsw i32 %4, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %4
}
/* Variables and functions */
float floor(float);
float fmod(float x, float y) {
  if (x < y)
    return x;
  else
    return (x - y * floor(x / y));
}


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1144 <fmod+0x34>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118e <fmod+0x7e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
call   1030 <floor@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
ucomiss %xmm0,%xmm1
ja     113d <fmod+0x2d>
push   %rax
movss  %xmm0,0x4(%rsp)
divss  %xmm1,%xmm0
movss  %xmm1,(%rsp)
call   1030 <floorf@plt>
mulss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fmod(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %20
11: ; preds = %2
%12 = load float, float* %4
%13 = load float, float* %5
%14 = load float, float* %4
%15 = load float, float* %5
%16 = fdiv float %14, %15
%17 = call float @floor(float %16)
%18 = fneg float %13
%19 = call float @llvm.fmuladd.f32(float %18, float %17, float %12)
store float %19, float* %3
br label %20
20: ; preds = %11, %9
%21 = load float, float* %3
ret float %21
}

LLVM IR (-O2):
define float @fmod(float %0, float %1) {
%3 = fcmp olt float %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fdiv float %0, %1
%6 = tail call float @llvm.floor.f32(float %5)
%7 = fneg float %1
%8 = tail call float @llvm.fmuladd.f32(float %7, float %6, float %0)
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ %0, %2 ]
ret float %10
}
/* Variables and functions */
unsigned long SysCtlPeripheralMapToNew(unsigned long);
void SysCtlPeripheralPowerOff(unsigned long ulPeripheral) {
  ;
  ulPeripheral = SysCtlPeripheralMapToNew(ulPeripheral);
  (*((volatile unsigned long
          *)(((unsigned long)(0x400fe900 + ((ulPeripheral & 0xff00) >> 8)) &
              0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x400fe900 + ((ulPeripheral & 0xff00) >> 8)) &
               0x000FFFFF)
              << 5) |
             ((ulPeripheral & 0xff) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<SysCtlPeripheralPowerOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <SysCtlPeripheralMapToNew@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
add    $0x400fe900,%rax
movabs $0xf0000000,%rcx
and    %rcx,%rax
or     $0x2000000,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shr    $0x8,%rcx
add    $0x400fe900,%rcx
and    $0xfffff,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff,%rcx
shl    $0x2,%rcx
or     %rcx,%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralPowerOff>:
push   %rax
call   1030 <SysCtlPeripheralMapToNew@plt>
movzbl %al,%ecx
shr    $0x3,%rax
and    $0x1fe0,%eax
shl    $0x2,%rcx
or     %rax,%rcx
movq   $0x0,0x43fd2000(%rcx)
pop    %rax
ret

LLVM IR (-O0):
define void @SysCtlPeripheralPowerOff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @SysCtlPeripheralMapToNew(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = and i64 %5, 65280
%7 = lshr i64 %6, 8
%8 = add i64 1074784512, %7
%9 = and i64 %8, 4026531840
%10 = or i64 %9, 33554432
%11 = load i64, i64* %2
%12 = and i64 %11, 65280
%13 = lshr i64 %12, 8
%14 = add i64 1074784512, %13
%15 = and i64 %14, 1048575
%16 = shl i64 %15, 5
%17 = or i64 %10, %16
%18 = load i64, i64* %2
%19 = and i64 %18, 255
%20 = shl i64 %19, 2
%21 = or i64 %17, %20
%22 = inttoptr i64 %21 to i64*
store volatile i64 0, i64* %22
ret void
}

LLVM IR (-O2):
define void @SysCtlPeripheralPowerOff(i64 %0) {
%2 = tail call i64 @SysCtlPeripheralMapToNew(i64 %0)
%3 = lshr i64 %2, 3
%4 = and i64 %3, 8160
%5 = shl i64 %2, 2
%6 = and i64 %5, 1020
%7 = or i64 %6, %4
%8 = or i64 %7, 1140662272
%9 = inttoptr i64 %8 to i64*
store volatile i64 0, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void printCPUxUserInfo(const char *cmd) {
  int id;
  sscanf(cmd + 7, "%d", &id);
  output("CPU %d User Load\t0\t100\t%%\n", id + 1);
}


x86 assembly (clang, -O0):
<printCPUxUserInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
lea    0xec5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xeb2(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCPUxUserInfo>:
push   %rax
add    $0x7,%rdi
lea    0xed4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%esi
lea    0xebf(%rip),%rdi
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"CPU %d User Load\090\09100\09%%\0A\00"
define void @printCPUxUserInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 7
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i32 @output(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"CPU %d User Load\090\09100\09%%\0A\00"
define void @printCPUxUserInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 7
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @output(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
void find_fi(mpz_t fi, mpz_t p, mpz_t q) {
  mpz_t p_1, q_1;
  mpz_init(p_1);
  mpz_init(q_1);
  mpz_sub_ui(p_1, p, 1);
  mpz_sub_ui(q_1, q, 1);
  mpz_mul(fi, p_1, q_1);
}


x86 assembly (clang, -O0):
<find_fi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <mpz_init@plt>
mov    -0x14(%rbp),%edi
call   1030 <mpz_init@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mpz_mul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_fi>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
call   1030 <mpz_init@plt>
call   1030 <mpz_init@plt>
mov    %ebp,%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    %ebx,%esi
mov    $0x1,%edx
call   1050 <mpz_sub_ui@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mpz_mul@plt>

LLVM IR (-O0):
define void @find_fi(i32 %0, i32 %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* %7
%10 = call i32 @mpz_init(i32 %9)
%11 = load i32, i32* %8
%12 = call i32 @mpz_init(i32 %11)
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = call i32 @mpz_sub_ui(i32 %13, i32 %14, i32 1)
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = call i32 @mpz_sub_ui(i32 %16, i32 %17, i32 1)
%19 = load i32, i32* %4
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = call i32 @mpz_mul(i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @find_fi(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_init(i32 undef)
%5 = tail call i32 @mpz_init(i32 undef)
%6 = tail call i32 @mpz_sub_ui(i32 undef, i32 %1, i32 1)
%7 = tail call i32 @mpz_sub_ui(i32 undef, i32 %2, i32 1)
%8 = tail call i32 @mpz_mul(i32 %0, i32 undef, i32 undef)
ret void
}
void __attribute__((no)) bar(void) {
  foo();
  printf("%s\n", __func__);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
lea    0xece(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@__func__.bar = [4 x i8] c"bar\00"
define void @bar() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.bar, i64 0, i64 0))
ret void
}
void index_reader_docommit(struct _index_reader *_ir) { return; }


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

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

LLVM IR (-O0):
%struct._index_reader = type opaque
define void @index_reader_docommit(%struct._index_reader* %0) {
%2 = alloca %struct._index_reader*
store %struct._index_reader* %0, %struct._index_reader** %2
ret void
}

LLVM IR (-O2):
%struct._index_reader = type opaque
define void @index_reader_docommit(%struct._index_reader* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int mbrtowc(int /*<<< orphan*/ *, char const *, size_t, int /*<<< orphan*/ *);
int mbtowc(wchar_t *pwc, const char *s, size_t n) {
  return mbrtowc(pwc, s, n, NULL);
}


x86 assembly (clang, -O0):
<mbtowc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <mbrtowc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbtowc>:
xor    %ecx,%ecx
jmp    1030 <mbrtowc@plt>

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

LLVM IR (-O2):
define i32 @mbtowc(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @mbrtowc(i32* %0, i8* %1, i64 %2, i32* null)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ndelay(int);
void spin(void) {
  for (;;) {
    ndelay(20);
  }
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <spin+0x9>
mov    $0x14,%edi
call   1030 <ndelay@plt>
jmp    1119 <spin+0x9>

x86 assembly (clang, -O2):
<spin>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x14,%edi
call   1030 <ndelay@plt>
jmp    1120 <spin+0x10>

LLVM IR (-O0):
define void @spin() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @ndelay(i32 20)
br label %1
}

LLVM IR (-O2):
define void @spin() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @ndelay(i32 20)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ cmd_type(char *);
int get_numvar(char *);
void cmd_yes(char *str) {
  if (get_numvar("#MATCHED") == 1) {
    cmd_type(str);
  }
}


x86 assembly (clang, -O0):
<cmd_yes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <get_numvar@plt>
cmp    $0x1,%eax
jne    114a <cmd_yes+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <cmd_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_yes>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <get_numvar@plt>
cmp    $0x1,%eax
jne    113e <cmd_yes+0x1e>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <cmd_type@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"#MATCHED\00"
define void @cmd_yes(i8* %0) {
%2 = tail call i32 @get_numvar(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @cmd_type(i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double c = 299792458.0;
  double m;
  printf("weight?\n");
  scanf("%lf", &m);
  printf(" E = %e [J]\n", (m * (c * c)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xea7(%rip),%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"weight?\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c" E = %e [J]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0x41B1DE784A000000, double* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fmul double %6, %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c" E = %e [J]\0A\00"
@str = [8 x i8] c"weight?\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 0x4373F4D4EACDD756
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
int limit_delta(int delta, int min, int max) {
  return delta > max ? max : delta < min ? min : delta;
}


x86 assembly (clang, -O0):
<limit_delta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1124 <limit_delta+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <limit_delta+0x47>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113b <limit_delta+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <limit_delta+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_delta>:
mov    %esi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
cmp    %edx,%edi
cmovg  %edx,%eax
ret

LLVM IR (-O0):
define i32 @limit_delta(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* %6
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %6
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %5
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @limit_delta(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %1, i32 %0
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ find_colindrome(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char *argv[]) {
  printf("%s is %s\n", argv[1],
         find_colindrome(argv[1]) ? "Colindrome" : "Not a Colindrome");
  return 0;
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <find_colindrome@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rcx
lea    0xead(%rip),%rdx
lea    0xeac(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1030 <find_colindrome@plt>
test   %rax,%rax
lea    0xed3(%rip),%rax
lea    0xed2(%rip),%rdx
cmove  %rax,%rdx
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s is %s\0A\00"
@.str.1 = [11 x i8] c"Colindrome\00"
@.str.2 = [17 x i8] c"Not a Colindrome\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @find_colindrome(i8* %11)
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s is %s\0A\00"
@.str.1 = [11 x i8] c"Colindrome\00"
@.str.2 = [17 x i8] c"Not a Colindrome\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @find_colindrome(i8* %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void mem_zero(void *block, unsigned size) { memset(block, 0, size); }


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

x86 assembly (clang, -O2):
<mem_zero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @mem_zero(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 = call i32 @memset(i8* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @mem_zero(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
char *mydlerror(void) {
  ;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @mydlerror() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mydlerror() {
ret i8* null
}
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int memcmp(struct in6_addr const *, struct in6_addr const *, int);
int in6_addr_compare_func(const struct in6_addr *a, const struct in6_addr *b) {
  return memcmp(a, b, sizeof(*a));
}


x86 assembly (clang, -O0):
<in6_addr_compare_func>:
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 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @in6_addr_compare_func(%struct.in6_addr* %0, %struct.in6_addr* %1) {
%3 = tail call i32 @memcmp(%struct.in6_addr* %0, %struct.in6_addr* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
float __nv_saturatef(float);
float __saturatef(float __a) { return __nv_saturatef(__a); }


x86 assembly (clang, -O0):
<__saturatef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_saturatef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__saturatef>:
jmp    1030 <__nv_saturatef@plt>

LLVM IR (-O0):
define float @__saturatef(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__nv_saturatef(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__saturatef(float %0) {
%2 = tail call float @__nv_saturatef(float %0)
ret float %2
}
void zconfdump(void) {
  char *p, *p2;
  for (p2 = p; p2;) {
    char __a0, __a1, __a2;
    __a0 = ((__const char *)("\"\\"))[0];
    if (__a0)
      return;
  }
}


x86 assembly (clang, -O0):
<zconfdump>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <zconfdump+0x34>
mov    0xee3(%rip),%al
mov    %al,-0x11(%rbp)
cmpb   $0x0,-0x11(%rbp)
je     112f <zconfdump+0x2f>
jmp    1134 <zconfdump+0x34>
jmp    110c <zconfdump+0xc>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @zconfdump() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_not_null_(char *, int, int *);
void test_not_null_pass() {
  int x = 1;
  assert_not_null_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/"
                   "heads/master/test/pass_test.c",
                   18, (&x));
}


x86 assembly (clang, -O0):
<test_not_null_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x12,%esi
lea    -0x4(%rbp),%rdx
call   1030 <assert_not_null_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_not_null_pass>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    $0x12,%esi
call   1030 <assert_not_null_@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_not_null_pass() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @assert_not_null_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 18, i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_not_null_pass() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @assert_not_null_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 18, i32* %1)
ret void
}
void sanity_check_one(void) {
  do {
    if (!(1 == 1)) {
      char buf[200];
      snprintf(buf, sizeof(buf), "%s:%d:%s(): %s",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ShobhitSharma/chao/refs/"
               "heads/master/tests/tests_example.c",
               11, __func__, "One failed to be equal to one.");
      test_failed(buf);
    } else {
      test_succeeded();
    }
  } while (0);
}


x86 assembly (clang, -O0):
<sanity_check_one>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <sanity_check_one+0x9>
mov    $0x0,%al
call   1030 <test_succeeded@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sanity_check_one() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @test_succeeded()
br label %3
3: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @sanity_check_one() {
%1 = tail call i32 (...) @test_succeeded()
ret void
}
g(float a, long double b) {
  _Static_assert(__builtin_types_compatible_p(__typeof(a + b), long double),
                 "?");
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
movss  %xmm0,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g(float %0, x86_fp80 %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca x86_fp80
store float %0, float* %4
store x86_fp80 %1, x86_fp80* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @g(float %0, x86_fp80 %1) {
ret i32 undef
}
void atomic_write_barrier(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @atomic_write_barrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @atomic_write_barrier() {
fence seq_cst
ret void
}