xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ must_fail(char *, int /*<<< orphan*/);
char *strdup(char const *);
int /*<<< orphan*/ strlen(char const *);
char *must_strdup(const char *s) {
  char *dup = strdup(s);
  if (!dup)
    must_fail("strdup", strlen(s));
  return dup;
}


x86 assembly (clang, -O0):
<must_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <must_strdup+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1030 <must_fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <must_strdup+0x2a>
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <must_fail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @must_strdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = tail call i32 @must_fail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
int main() {
  int i = 5;
  int *ip = &i;
  printf("%d\n", *ip);
  printf("%u\n", ip);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplMcs51GeneralIOC__P13__makeOutput();
void ReverseGPIOP__1__In__makeOutput(void) {
  HplMcs51GeneralIOC__P13__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @ReverseGPIOP__1__In__makeOutput() {
%1 = tail call i32 (...) @HplMcs51GeneralIOC__P13__makeOutput()
ret void
}
unsigned int __native_hakmem_popcnt(unsigned int x) {
  unsigned int tmp;
  tmp = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
  return (((tmp + (tmp >> 3)) & 030707070707) % 63);
}


x86 assembly (clang, -O0):
<__native_hakmem_popcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0xdb6db6db,%ecx
sub    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x49249249,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x3,%ecx
add    %ecx,%eax
and    $0xc71c71c7,%eax
mov    $0x3f,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__native_hakmem_popcnt>:
mov    %edi,%eax
shr    %eax
and    $0x5b6db6db,%eax
mov    %edi,%ecx
shr    $0x2,%ecx
and    $0x9249249,%ecx
add    %eax,%ecx
sub    %ecx,%edi
mov    %edi,%ecx
shr    $0x3,%ecx
add    %edi,%ecx
and    $0xc71c71c7,%ecx
imul   $0x4104105,%rcx,%rdx
shr    $0x20,%rdx
mov    %ecx,%eax
sub    %edx,%eax
shr    %eax
add    %edx,%eax
shr    $0x5,%eax
mov    %eax,%edx
shl    $0x6,%edx
sub    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__native_hakmem_popcnt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, -613566757
%8 = sub i32 %4, %7
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
%11 = and i32 %10, 1227133513
%12 = sub i32 %8, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = lshr i32 %14, 3
%16 = add i32 %13, %15
%17 = and i32 %16, -954437177
%18 = urem i32 %17, 63
ret i32 %18
}

LLVM IR (-O2):
define i32 @__native_hakmem_popcnt(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1533916891
%4 = lshr i32 %0, 2
%5 = and i32 %4, 153391689
%6 = add nuw nsw i32 %5, %3
%7 = sub i32 %0, %6
%8 = lshr i32 %7, 3
%9 = add i32 %8, %7
%10 = and i32 %9, -954437177
%11 = urem i32 %10, 63
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int usage(char *prog, int error) {
  fprintf(error ? stderr : stdout,
          "usage: %s"
          " [ -t <sec> ] [ -g ]"
          " devnr\n",
          prog);
  exit(error);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <usage+0x2a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <usage+0x36>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
test   %esi,%esi
jne    1133 <usage+0x13>
mov    0x2ea7(%rip),%rax
jmp    113a <usage+0x1a>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [37 x i8] c"usage: %s [ -t <sec> ] [ -g ] devnr\0A\00"
define i32 @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* @stderr
br label %11
9: ; preds = %2
%10 = load i32, i32* @stdout
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %4
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [37 x i8] c"usage: %s [ -t <sec> ] [ -g ] devnr\0A\00"
define i32 @usage(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @stdout
%6 = select i1 %3, i32 %5, i32 %4
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ print_verbose(char *);
void print_failed_external() {
  print_verbose("Found no matching externalhost, will now try to contact node "
                "by address\n");
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"Found no matching externalhost, will now try to contact node by address\0A\00"
define void @print_failed_external() {
%1 = call i32 @print_verbose(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"Found no matching externalhost, will now try to contact node by address\0A\00"
define void @print_failed_external() {
%1 = tail call i32 @print_verbose(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}
char *my_stpcpy(char *dest, const char *src) {
  char *d = dest;
  const char *s = src;
  do
    *d++ = *s;
  while (*s++ != '\0');
  return d - 1;
}


x86 assembly (clang, -O0):
<my_stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    111c <my_stpcpy+0x1c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_stpcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
cmpb   $0x0,(%rsi)
lea    0x1(%rsi),%rsi
jne    1110 <my_stpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_stpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int null_gets(BIO *bp, char *buf, int size) { return (0); }


x86 assembly (clang, -O0):
<null_gets>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @null_gets(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ freezing(int /*<<< orphan*/);
int /*<<< orphan*/ get_current();
int /*<<< orphan*/ refrigerator();
__attribute__((always_)) int try_to_freeze(void) {
  if (freezing(get_current())) {
    refrigerator();
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<try_to_freeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_current@plt>
mov    %eax,%edi
call   1030 <freezing@plt>
cmp    $0x0,%rax
je     1163 <try_to_freeze+0x33>
mov    $0x0,%al
call   1040 <refrigerator@plt>
movl   $0x1,-0x4(%rbp)
jmp    116a <try_to_freeze+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_to_freeze>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <get_current@plt>
mov    %eax,%edi
call   1030 <freezing@plt>
test   %rax,%rax
je     1152 <try_to_freeze+0x22>
xor    %eax,%eax
call   1040 <refrigerator@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @try_to_freeze() {
%1 = alloca i32
%2 = call i32 (...) @get_current()
%3 = call i64 @freezing(i32 %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @refrigerator()
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @try_to_freeze() {
%1 = tail call i32 (...) @get_current()
%2 = tail call i64 @freezing(i32 %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @refrigerator()
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %7
}
void *c(unsigned x) { return __builtin_frame_address(0); }


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

x86 assembly (clang, -O2):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    %rbp,%rax
pop    %rbp
ret

LLVM IR (-O0):
define i8* @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @llvm.frameaddress.p0i8(i32 0)
ret i8* %3
}

LLVM IR (-O2):
define i8* @c(i32 %0) {
%2 = tail call i8* @llvm.frameaddress.p0i8(i32 0)
ret i8* %2
}
double ls_costN_nm10_twice(double x) { return x + x; }


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

x86 assembly (clang, -O2):
<ls_costN_nm10_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @ls_costN_nm10_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long gettimeofday_ms(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<gettimeofday_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday_ms>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @gettimeofday_ms() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @gettimeofday_ms() {
%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 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
int number_prime(int nummer) {
  int num;
  for (num = 2; num < nummer && nummer % num != 0; num++)
    if (num < nummer)
      return 1;
    else
      return 1;
}


x86 assembly (clang, -O0):
<number_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    112f <number_prime+0x2f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113f <number_prime+0x3f>
jmp    115e <number_prime+0x5e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1157 <number_prime+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <number_prime+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @number_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %22, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %9, %5
%15 = phi i1 [ false, %5 ], [ %13, %9 ]
br i1 %15, label %16, label %25
16: ; preds = %14
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %25
21: ; preds = %16
store i32 1, i32* %2
br label %25
22: ; No predecessors!
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %5
25: ; preds = %20, %21, %14
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @number_prime(i32 %0) {
ret i32 1
}
void piezo_speaker_init_binary() {}


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

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

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

LLVM IR (-O2):
define void @piezo_speaker_init_binary() {
ret void
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
int /*<<< orphan*/ foo(int);
int main() {
  if (__VERIFIER_nondet_int())
    foo(1);
  else
    foo(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     114f <main+0x2f>
mov    $0x1,%edi
call   1040 <foo@plt>
jmp    1159 <main+0x39>
mov    $0x1,%edi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @__VERIFIER_nondet_int()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @foo(i32 1)
br label %8
6: ; preds = %0
%7 = call i32 @foo(i32 1)
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @foo(i32 1)
ret i32 0
}
void yy_1_InternalLinkAutoCorrect(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_InternalLinkAutoCorrect(i8* nocapture %0, i32 %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct TYPE_3__ {
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
typedef TYPE_1__ mbstate_t;

/* Variables and functions */
size_t _mbrtowc_ptr(int /*<<< orphan*/ *, char const *, size_t, TYPE_1__ *);
int mbtowc(wchar_t *__restrict pwc, const char *__restrict s, size_t n) {
  size_t x;
  mbstate_t mb = {0, 0, 0};
  x = _mbrtowc_ptr(pwc, s, n, &mb);
  if (((int)x) < 0)
    return -1;
  return x;
}


x86 assembly (clang, -O0):
<mbtowc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1040 <_mbrtowc_ptr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    $0x0,%eax
jge    1176 <mbtowc+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <mbtowc+0x5d>
mov    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbtowc>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rcx
call   1030 <_mbrtowc_ptr@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32 }
define i32 @mbtowc(i32* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca %struct.TYPE_3__
store i32* %0, i32** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%10 = bitcast %struct.TYPE_3__* %9 to i8*
%11 = load i32*, i32** %5
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = call i64 @_mbrtowc_ptr(i32* %11, i8* %12, i64 %13, %struct.TYPE_3__* %9)
store i64 %14, i64* %8
%15 = load i64, i64* %8
%16 = trunc i64 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %3
store i32 -1, i32* %4
br label %22
19: ; preds = %3
%20 = load i64, i64* %8
%21 = trunc i64 %20 to i32
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %18
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32 }
define i32 @mbtowc(i32* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca %struct.TYPE_3__
%5 = bitcast %struct.TYPE_3__* %4 to i8*
%6 = call i64 @_mbrtowc_ptr(i32* %0, i8* %1, i64 %2, %struct.TYPE_3__* %4)
%7 = trunc i64 %6 to i32
%8 = icmp sgt i32 %7, -1
%9 = select i1 %8, i32 %7, i32 -1
ret i32 %9
}
void foo_2_2_1_2_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_1_1_2_2_1() {
ret void
}
/* Variables and functions */
int owTouchByte(int, int);
int owReadByte(int portnum) { return owTouchByte(portnum, (int)0xFF); }


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

x86 assembly (clang, -O2):
<owReadByte>:
mov    $0xff,%esi
jmp    1030 <owTouchByte@plt>

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

LLVM IR (-O2):
define i32 @owReadByte(i32 %0) {
%2 = tail call i32 @owTouchByte(i32 %0, i32 255)
ret i32 %2
}
int test_imm_1Auint8_mem(unsigned char *val) {
  return ((*val) & (0x1A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Auint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 26
%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_1Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 26
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t heap_used();
size_t talloc_used() { return heap_used(); }


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

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

LLVM IR (-O0):
define i64 @talloc_used() {
%1 = call i64 (...) @heap_used()
ret i64 %1
}

LLVM IR (-O2):
define i64 @talloc_used() {
%1 = tail call i64 (...) @heap_used()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  while (1) {
    int x = __VERIFIER_nondet_int();
    if (x == 0) {
      __VERIFIER_assert(x == 0);
    } else if (x == 2) {
      __VERIFIER_assert(x == 2);
    } else {
      __VERIFIER_assert(x != 0 && x != 2);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1159 <main+0x39>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    11a4 <main+0x84>
cmpl   $0x2,-0x8(%rbp)
jne    1179 <main+0x59>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    119f <main+0x7f>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1192 <main+0x72>
cmpl   $0x2,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    11a4 <main+0x84>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %31
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @__VERIFIER_assert(i32 %10)
br label %31
12: ; preds = %3
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 2
%18 = zext i1 %17 to i32
%19 = call i32 @__VERIFIER_assert(i32 %18)
br label %30
20: ; preds = %12
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp ne i32 %24, 2
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
%28 = zext i1 %27 to i32
%29 = call i32 @__VERIFIER_assert(i32 %28)
br label %30
30: ; preds = %26, %15
br label %31
31: ; preds = %30, %7
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @__VERIFIER_assert(i32 1)
br label %1
}
/* Variables and functions */
int foo();
int test(void) { return foo(); }


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

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

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ rgb_copy(void const *, void *, int, int, int, int, int);
void rbgx8888_copy(const void *psrc, void *pdst, int sw, int sh, int dw,
                   int dh) {
  rgb_copy(psrc, pdst, sw, sh, dw, dh, 32);
}


x86 assembly (clang, -O0):
<rbgx8888_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
movl   $0x20,(%rsp)
call   1030 <rgb_copy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbgx8888_copy>:
push   %rax
movl   $0x20,(%rsp)
call   1030 <rgb_copy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @rbgx8888_copy(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @rgb_copy(i8* %13, i8* %14, i32 %15, i32 %16, i32 %17, i32 %18, i32 32)
ret void
}

LLVM IR (-O2):
define void @rbgx8888_copy(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @rgb_copy(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 32)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_init(pthread_mutexattr_t *attr) {
  (void)attr;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_init(i32* nocapture readnone %0) {
ret i32 0
}
unsigned xrop3_192_0_0(unsigned char s, unsigned char t) {
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T & S;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_192_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_192_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_192_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %5
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = and i32 %20, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @xrop3_192_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = and i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _expect_string_eq(char *, char *, char *);
char *az_strprintf(char *, char *, double);
int /*<<< orphan*/ free(char *);
void test_strprintf(void) {
  char *str = az_strprintf("Hello, %s number %.2f!", "purple world",
                           3.1415926535897931);
  _expect_string_eq("Hello, purple world number 3.14!", str, "str");
  free(str);
}


x86 assembly (clang, -O0):
<test_strprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
lea    0xed9(%rip),%rsi
movsd  0xeb2(%rip),%xmm0
call   1050 <az_strprintf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeca(%rip),%rdi
lea    0xee4(%rip),%rdx
call   1040 <_expect_string_eq@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strprintf>:
push   %rbx
lea    0xed0(%rip),%rdi
lea    0xee0(%rip),%rsi
movsd  0xeb9(%rip),%xmm0
call   1050 <az_strprintf@plt>
mov    %rax,%rbx
lea    0xed6(%rip),%rdi
lea    0xef0(%rip),%rdx
mov    %rax,%rsi
call   1040 <_expect_string_eq@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Hello, %s number %.2f!\00"
@.str.1 = [13 x i8] c"purple world\00"
@.str.2 = [33 x i8] c"Hello, purple world number 3.14!\00"
@.str.3 = [4 x i8] c"str\00"
define void @test_strprintf() {
%1 = alloca i8*
%2 = call i8* @az_strprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 0x400921FB54442D18)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @_expect_string_eq(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello, %s number %.2f!\00"
@.str.1 = [13 x i8] c"purple world\00"
@.str.2 = [33 x i8] c"Hello, purple world number 3.14!\00"
@.str.3 = [4 x i8] c"str\00"
define void @test_strprintf() {
%1 = tail call i8* @az_strprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double 0x400921FB54442D18)
%2 = tail call i32 @_expect_string_eq(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
main(int argc, char **argv) { foo(argc); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0)
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
};

/* Variables and functions */
void timespec_correct(struct timespec *ts) { ts->tv_nsec = 1000000000 / 2; }


x86 assembly (clang, -O0):
<timespec_correct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1dcd6500,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_correct>:
movl   $0x1dcd6500,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @timespec_correct(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 500000000, i32* %4
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @timespec_correct(%struct.timespec* nocapture writeonly %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 500000000, i32* %2
ret void
}
void __attribute__((weak)) pr_stat(const char *fmt, ...) {}


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

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

LLVM IR (-O0):
define weak void @pr_stat(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define weak void @pr_stat(i8* %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ make_ip_addr(int, int, int, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *, int *, int *, int *);
u_int32_t str_to_ip(const char *s) {
  int a, b, c, d;
  sscanf(s, "%i.%i.%i.%i", &a, &b, &c, &d);
  return make_ip_addr(a, b, c, d);
}


x86 assembly (clang, -O0):
<str_to_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <make_ip_addr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_ip>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x8(%rsp),%r9
call   1030 <sscanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
call   1040 <make_ip_addr@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%i.%i.%i.%i\00"
define i32 @str_to_ip(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @make_ip_addr(i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"%i.%i.%i.%i\00"
define i32 @str_to_ip(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @make_ip_addr(i32 %11, i32 %12, i32 %13, i32 %14)
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void merge_sort(int arr[], int l, int h) {
  if (l >= h)
    return;
  int m = (l + h) / 2;
  merge_sort(arr, l, m);
  merge_sort(arr, m + 1, h);
  merge(arr, l, m, h);
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <merge_sort+0x23>
jmp    1187 <merge_sort+0x67>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    %edx,%esi
jge    1172 <merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %29
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = sdiv i32 %15, 2
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
%24 = load i32*, i32** %4
%25 = load i32, i32* %5
%26 = load i32, i32* %7
%27 = load i32, i32* %6
%28 = call i32 @merge(i32* %24, i32 %25, i32 %26, i32 %27)
br label %29
29: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @merge_sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @merge_sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void version(void) {
  printf("\n");
  printf("This is tron version 1, subversion 1 (v1.1)\n");
  printf("\n");
  printf("Copyright 2012-2013, Troro\n");
  printf("\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [45 x i8] c"This is tron version 1, subversion 1 (v1.1)\0A\00"
@.str.2 = [28 x i8] c"Copyright 2012-2013, Troro\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [44 x i8] c"This is tron version 1, subversion 1 (v1.1)\00"
@str.3 = [27 x i8] c"Copyright 2012-2013, Troro\00"
define void @version() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @exit(i32 0)
unreachable
}
int mmp_str_is_trimmable(char c) {
  return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
}


x86 assembly (clang, -O0):
<mmp_str_is_trimmable>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <mmp_str_is_trimmable+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <mmp_str_is_trimmable+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <mmp_str_is_trimmable+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmp_str_is_trimmable>:
cmp    $0x20,%dil
ja     1120 <mmp_str_is_trimmable+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <mmp_str_is_trimmable+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @mmp_str_is_trimmable(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @mmp_str_is_trimmable(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}