xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ my_strncmp(char *, char *, int);
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  if ((my_strncmp(av[1], av[2], 3))) {
    printf("ok\n");
    return (0);
  }
  printf("pas ok\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    $0x3,%edx
call   1030 <my_strncmp@plt>
cmp    $0x0,%rax
je     1172 <main+0x52>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1185 <main+0x65>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
mov    $0x3,%edx
call   1040 <my_strncmp@plt>
test   %rax,%rax
lea    0xec3(%rip),%rax
lea    0xec0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ok\0A\00"
@.str.1 = [8 x i8] c"pas ok\0A\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 2
%11 = load i8*, i8** %10
%12 = call i64 @my_strncmp(i8* %8, i8* %11, i32 3)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [7 x i8] c"pas ok\00"
@str.2 = [3 x i8] c"ok\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i64 @my_strncmp(i8* %4, i8* %6, i32 3)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.2, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
bool getEnvFlag(char *name) {
  char *val = getenv(name);
  return val && val[0];
}


x86 assembly (clang, -O0):
<getEnvFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1149 <getEnvFlag+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %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):
<getEnvFlag>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1128 <getEnvFlag+0x18>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getEnvFlag(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void arch_stop_trace(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_stop_trace() {
ret void
}
/* Variables and functions */
char *print_streamtitle(char *, int, int *);
char *handle_streamtitle(char *buf, int *len, int *metasize) {
  int temp = *metasize;
  buf = print_streamtitle(buf, *len, metasize);
  *len -= temp - *metasize;
  return buf;
}


x86 assembly (clang, -O0):
<handle_streamtitle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1030 <print_streamtitle@plt>
mov    %rax,-0x8(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rax
sub    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_streamtitle>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    (%rdx),%ebp
mov    (%rsi),%esi
call   1030 <print_streamtitle@plt>
mov    (%rbx),%ecx
sub    %ebp,%ecx
add    %ecx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @handle_streamtitle(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = call i8* @print_streamtitle(i8* %10, i32 %12, i32* %13)
store i8* %14, i8** %4
%15 = load i32, i32* %7
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = sub nsw i32 %15, %17
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = sub nsw i32 %20, %18
store i32 %21, i32* %19
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @handle_streamtitle(i8* %0, i32* nocapture %1, i32* %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = tail call i8* @print_streamtitle(i8* %0, i32 %5, i32* %2)
%7 = load i32, i32* %2
%8 = sub i32 %7, %4
%9 = load i32, i32* %1
%10 = add i32 %8, %9
store i32 %10, i32* %1
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("foo bar\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"foo bar\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int WildCompare(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
                char const *);
scalar_t__ strlen(char const *);
bool WildCompareString(const char *ref, const char *wild) {
  return WildCompare((int32_t)strlen(ref), ref, (int32_t)strlen(wild), wild);
}


x86 assembly (clang, -O0):
<WildCompareString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
call   1040 <WildCompare@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WildCompareString>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <WildCompare@plt>

LLVM IR (-O0):
define i32 @WildCompareString(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 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = trunc i64 %10 to i32
%12 = load i8*, i8** %4
%13 = call i32 @WildCompare(i32 %7, i8* %8, i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @WildCompareString(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = trunc i64 %5 to i32
%7 = tail call i32 @WildCompare(i32 %4, i8* %0, i32 %6, i8* %1)
ret i32 %7
}
put1a(n) int n;
{ n; }


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

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

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

LLVM IR (-O2):
define i32 @put1a(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void error(const char *s, const char *t) {
  fprintf(stderr, "diffh: %s%s\n", s, t);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"diffh: %s%s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"diffh: %s%s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strip_suffix(char const *, char const *, size_t *);
int ends_with(const char *str, const char *suffix) {
  size_t len;
  return strip_suffix(str, suffix, &len);
}


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

x86 assembly (clang, -O2):
<ends_with>:
push   %rax
mov    %rsp,%rdx
call   1030 <strip_suffix@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ends_with(i8* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @strip_suffix(i8* %0, i8* %1, i64* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ evening();
int /*<<< orphan*/ morning();
int /*<<< orphan*/ night();
int main() {
  morning();
  evening();
  night();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @morning()
%2 = tail call i32 (...) @evening()
%3 = tail call i32 (...) @night()
ret i32 0
}
void redecl3(void) {}


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

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

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

LLVM IR (-O2):
define void @redecl3() {
ret void
}
double QuadraticEaseIn(double p) { return p * p; }


x86 assembly (clang, -O0):
<QuadraticEaseIn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuadraticEaseIn>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @QuadraticEaseIn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @QuadraticEaseIn(double %0) {
%2 = fmul double %0, %0
ret double %2
}
headed(a, b, c) { echo("a + b =", a + b, ", c = ", c); }


x86 assembly (clang, -O0):
<headed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xecf(%rip),%rdi
lea    0xed0(%rip),%rdx
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<headed>:
mov    %edx,%ecx
add    %edi,%esi
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rdx
xor    %eax,%eax
jmp    1030 <echo@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"a + b =\00"
@.str.1 = [7 x i8] c", c = \00"
define i32 @headed(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %7
%12 = call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i8*, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"a + b =\00"
@.str.1 = [7 x i8] c", c = \00"
define i32 @headed(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = tail call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i8*, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 undef
}
/* Variables and functions */
size_t strlen(char *);
char toupper(char);
void ToUpperString(char *String) {
  size_t i = 0;
  char cTempChar = '0';
  size_t iLenOfString = strlen(String);
  for (i = 0; i < iLenOfString; i++) {
    cTempChar = toupper(String[i]);
    String[i] = cTempChar;
  }
  return;
}


x86 assembly (clang, -O0):
<ToUpperString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movb   $0x30,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    118e <ToUpperString+0x6e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114d <ToUpperString+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToUpperString>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %rax,%rax
je     1157 <ToUpperString+0x37>
mov    %rax,%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <ToUpperString+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ToUpperString(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
store i8 48, i8* %4
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
store i64 0, i64* %3
br label %8
8: ; preds = %22, %1
%9 = load i64, i64* %3
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
%17 = call signext i8 @toupper(i8 signext %16)
store i8 %17, i8* %4
%18 = load i8, i8* %4
%19 = load i8*, i8** %2
%20 = load i64, i64* %3
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 %18, i8* %21
br label %22
22: ; preds = %12
%23 = load i64, i64* %3
%24 = add i64 %23, 1
store i64 %24, i64* %3
br label %8
25: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @ToUpperString(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void testClosureLrV(void (*closure)(long), long a1) { (*closure)(a1); }


x86 assembly (clang, -O0):
<testClosureLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @testClosureLrV(void (i64)* nocapture %0, i64 %1) {
tail call void %0(i64 %1)
ret void
}
__attribute__((no, noclone)) char *f10(char *p, unsigned long int i) {
  return p - i;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @f10(i8* readnone %0, i64 %1) {
%3 = sub i64 0, %1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
double rndint(double, int, int);
double trunc(double x) { return rndint(x, 0x0020 | 0x0c00, ~0x0c00); }


x86 assembly (clang, -O0):
<trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0xc20,%edi
mov    $0xfffff3ff,%esi
call   1030 <rndint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trunc>:
mov    $0xc20,%edi
mov    $0xfffff3ff,%esi
jmp    1030 <rndint@plt>

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

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = tail call double @rndint(double %0, i32 3104, i32 -3073)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello world\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned le_uint8_read(const void *ptr) { return *(const unsigned char *)ptr; }


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

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

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

LLVM IR (-O2):
define i32 @le_uint8_read(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ra_vflush(int);
void ra_vflushall() {
  int i;
  for (i = 0; i < 8; ++i)
    ra_vflush(i);
}


x86 assembly (clang, -O0):
<ra_vflushall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    113f <ra_vflushall+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <ra_vflush@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ra_vflushall+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ra_vflushall>:
push   %rax
xor    %edi,%edi
call   1030 <ra_vflush@plt>
mov    $0x1,%edi
call   1030 <ra_vflush@plt>
mov    $0x2,%edi
call   1030 <ra_vflush@plt>
mov    $0x3,%edi
call   1030 <ra_vflush@plt>
mov    $0x4,%edi
call   1030 <ra_vflush@plt>
mov    $0x5,%edi
call   1030 <ra_vflush@plt>
mov    $0x6,%edi
call   1030 <ra_vflush@plt>
mov    $0x7,%edi
pop    %rax
jmp    1030 <ra_vflush@plt>

LLVM IR (-O0):
define void @ra_vflushall() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 8
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @ra_vflush(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ra_vflushall() {
%1 = tail call i32 @ra_vflush(i32 0)
%2 = tail call i32 @ra_vflush(i32 1)
%3 = tail call i32 @ra_vflush(i32 2)
%4 = tail call i32 @ra_vflush(i32 3)
%5 = tail call i32 @ra_vflush(i32 4)
%6 = tail call i32 @ra_vflush(i32 5)
%7 = tail call i32 @ra_vflush(i32 6)
%8 = tail call i32 @ra_vflush(i32 7)
ret void
}
void rop3_206_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_206_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_206_0_0>:
not    %dl
and    (%rdi),%dl
or     %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_206_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_206_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int write_permission_p(char *);
int fileutils___write_permission_p(char *filename) {
  return (write_permission_p(filename));
}


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

x86 assembly (clang, -O2):
<fileutils___write_permission_p>:
jmp    1030 <write_permission_p@plt>

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

LLVM IR (-O2):
define i32 @fileutils___write_permission_p(i8* %0) {
%2 = tail call i32 @write_permission_p(i8* %0)
ret i32 %2
}
/* Variables and functions */
unsigned int XXH32_getIntermediateResult_SSE4(void *);
int /*<<< orphan*/ free(void *);
unsigned int XXH32_result_SSE4(void *state_in) {
  unsigned int h32 = XXH32_getIntermediateResult_SSE4(state_in);
  free(state_in);
  return h32;
}


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

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

LLVM IR (-O0):
define i32 @XXH32_result_SSE4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @XXH32_getIntermediateResult_SSE4(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @XXH32_result_SSE4(i8* %0) {
%2 = tail call i32 @XXH32_getIntermediateResult_SSE4(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x6a() {
  Assert_real((iscntrl(106) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              535, ("iscntrl should be 0 for j"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for j\00"
define void @t_iscntrl_0x6a() {
%1 = tail call i64 @iscntrl(i32 106)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_54uint16_mem(unsigned short *val) {
  return ((*val) & (0x54 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_54uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 84
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int,
                          struct sockaddr const *, int /*<<< orphan*/);
ssize_t olsr_sendto(int s, const void *buf, size_t len, int flags,
                    const struct sockaddr *to, socklen_t tolen) {
  return sendto(s, buf, len, flags, to, tolen);
}


x86 assembly (clang, -O0):
<olsr_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<olsr_sendto>:
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @olsr_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = load i32, i32* %12
%19 = call i32 @sendto(i32 %13, i8* %14, i64 %15, i32 %16, %struct.sockaddr* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @olsr_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = tail call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int execvp(char const *, char **);
int execlp(const char *file, const char *arg, ...) {
  return execvp(file, (char **)&arg);
}


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

x86 assembly (clang, -O2):
<execlp>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <execvp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execlp(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 = call i32 @execvp(i8* %5, i8** %4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @execlp(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @execvp(i8* %0, i8** %3)
ret i32 %4
}
/* Variables and functions */
long long f(int);
long long sequence(int n) { return f(n); }


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

x86 assembly (clang, -O2):
<sequence>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i64 @sequence(i32 %0) {
%2 = tail call i64 @f(i32 %0)
ret i64 %2
}
__attribute__((always_)) unsigned long native_save_fl(void) {
  unsigned long flags;
  asm volatile("# __raw_save_flags\n\t"
               "pushf ; pop %0"
               : "=rm"(flags)
               :
               : "memory");
  return flags;
}


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

x86 assembly (clang, -O2):
<native_save_fl>:
pushf
pop    -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @native_save_fl() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @native_save_fl() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
/* Variables and functions */
scalar_t__ IFNAMSIZ;
int /*<<< orphan*/ print_quoted_string(char const *, scalar_t__, int);
void print_ifname(const char *ifname) {
  print_quoted_string(ifname, IFNAMSIZ + 1, 0x01);
}


x86 assembly (clang, -O0):
<print_ifname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%rsi
add    $0x1,%rsi
mov    $0x1,%edx
call   1030 <print_quoted_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ifname>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rsi
add    $0x1,%rsi
mov    $0x1,%edx
jmp    1030 <print_quoted_string@plt>

LLVM IR (-O0):
@IFNAMSIZ = global i64 0
define void @print_ifname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i64, i64* @IFNAMSIZ
%5 = add nsw i64 %4, 1
%6 = call i32 @print_quoted_string(i8* %3, i64 %5, i32 1)
ret void
}

LLVM IR (-O2):
@IFNAMSIZ = global i64 0
define void @print_ifname(i8* %0) {
%2 = load i64, i64* @IFNAMSIZ
%3 = add nsw i64 %2, 1
%4 = tail call i32 @print_quoted_string(i8* %0, i64 %3, i32 1)
ret void
}
/* Variables and functions */
char *gettext(char *);
double log(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Logaritmo(double a) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &a);
  return (log(a));
}


x86 assembly (clang, -O0):
<Logaritmo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Logaritmo>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1060 <log@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Logaritmo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @log(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Logaritmo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @log(double %6)
ret double %7
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void LCDIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000060))) = ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<LCDIntEnable>:
mov    %rsi,0x60(%rdi)
ret

LLVM IR (-O0):
define void @LCDIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 96
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @LCDIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 96
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double time_of_day(void) {
  struct timeval tm;
  gettimeofday(&tm, NULL);
  return ((double)(tm.tv_sec) + (double)(tm.tv_usec) / 1000000.0);
}


x86 assembly (clang, -O0):
<time_of_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_of_day>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @time_of_day() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @time_of_day() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
void setMemoryLimit(int mem_size_limit) {
  struct rlimit rlp;
  if (mem_size_limit <= 0)
    return;
  return;
}


x86 assembly (clang, -O0):
<setMemoryLimit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1116 <setMemoryLimit+0x16>
jmp    111b <setMemoryLimit+0x1b>
jmp    111b <setMemoryLimit+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rlimit = type { i32 }
define void @setMemoryLimit(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.rlimit
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @setMemoryLimit(i32 %0) {
ret void
}
/* Type definitions */
struct block_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ HsFreeBdev(struct block_device *);
void blkdev_put(struct block_device *x) {
  HsFreeBdev(x);
  return;
}


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

x86 assembly (clang, -O2):
<blkdev_put>:
jmp    1030 <HsFreeBdev@plt>

LLVM IR (-O0):
%struct.block_device = type { i32 }
define void @blkdev_put(%struct.block_device* %0) {
%2 = alloca %struct.block_device*
store %struct.block_device* %0, %struct.block_device** %2
%3 = load %struct.block_device*, %struct.block_device** %2
%4 = call i32 @HsFreeBdev(%struct.block_device* %3)
ret void
}

LLVM IR (-O2):
%struct.block_device = type { i32 }
define void @blkdev_put(%struct.block_device* %0) {
%2 = tail call i32 @HsFreeBdev(%struct.block_device* %0)
ret void
}
/* Variables and functions */
char *malloc(size_t);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *getInfo() {
  char *name;
  size_t size;
  size = strlen("Chess (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
                "under the GNU GPL");
  name = malloc(size + 1);
  strncpy(name,
          ("Chess (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
           "under the GNU GPL"),
          size + 1);
  return name;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
lea    0xe94(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbx
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    $0x50,%edx
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [80 x i8] c"Chess (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under the GNU GPL\00"
define i8* @getInfo() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @strlen(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = load i64, i64* %2
%9 = add i64 %8, 1
%10 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [80 x i8] c"Chess (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under the GNU GPL\00"
define i8* @getInfo() {
%1 = tail call dereferenceable_or_null(80) i8* @malloc(i64 80)
%2 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i64 80)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ assume(int);
int /*<<< orphan*/ error();
void foo(int a) {
  int i, c;
  i = 0;
  c = 0;
  while (i < 1000) {
    c = c + i;
    i = i + 1;
  }
  assume(a <= 0);
  error();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    115d <foo+0x3d>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <foo+0x19>
cmpl   $0x0,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    $0x0,%al
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
setle  %al
mov    %eax,%edi
call   1040 <assume@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <error@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %5
14: ; preds = %5
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assume(i32 %17)
%19 = call i32 (...) @error()
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assume(i32 %3)
%5 = tail call i32 (...) @error()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t Count1s(uint32_t LongWord) {
  return Count1s((uint16_t)LongWord) + Count1s((uint16_t)(LongWord >> 16));
}


x86 assembly (clang, -O0):
<Count1s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Count1s@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
call   1030 <Count1s@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @Count1s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @Count1s(i32 %3)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = call i64 @Count1s(i32 %6)
%8 = add nsw i64 %4, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @Count1s(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i64 @Count1s(i32 %3)
%5 = ashr i32 %3, 16
br label %2
}
unsigned back_height(void) { return 480; }


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

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

LLVM IR (-O0):
define i32 @back_height() {
ret i32 480
}

LLVM IR (-O2):
define i32 @back_height() {
ret i32 480
}
/* Variables and functions */
int toupper(int);
int toUpperCase(int c) { return toupper(c); }


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

x86 assembly (clang, -O2):
<toUpperCase>:
jmp    1030 <toupper@plt>

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

LLVM IR (-O2):
define i32 @toUpperCase(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
ret i32 %2
}