xunge/DecIR huggingface dataset:
/* Variables and functions */
char sscanf(char *, char *, size_t *, char *);
int /*<<< orphan*/ usage(int);
int /*<<< orphan*/ warnx(char *, char *);
size_t parse_size_t(char *str) {
  char r, x;
  size_t size;
  r = sscanf(str, "%zu%c", &size, &x);
  if (1 != r) {
    warnx("invalid size: %s", str);
    usage(5);
  }
  return size;
}


x86 assembly (clang, -O0):
<parse_size_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0xa(%rbp),%rcx
call   1040 <sscanf@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1182 <parse_size_t+0x52>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <warnx@plt>
mov    $0x5,%edi
call   1050 <usage@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_size_t>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xec1(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0x7(%rsp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%al
je     116b <parse_size_t+0x3b>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
call   1030 <warnx@plt>
mov    $0x5,%edi
call   1050 <usage@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%zu%c\00"
@.str.1 = [17 x i8] c"invalid size: %s\00"
define i64 @parse_size_t(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call signext i8 @sscanf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %5, i8* %4)
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 1, %9
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @warnx(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 @usage(i32 5)
br label %15
15: ; preds = %11, %1
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"%zu%c\00"
@.str.1 = [17 x i8] c"invalid size: %s\00"
define i64 @parse_size_t(i8* %0) {
%2 = alloca i8
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call signext i8 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %3, i8* %2)
%6 = icmp eq i8 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 @warnx(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = call i32 @usage(i32 5)
br label %10
10: ; preds = %7, %1
%11 = load i64, i64* %3
ret i64 %11
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_sqr_256(uint64_t c[8], uint64_t a[4]) {
  c[0] = a[1] + a[2];
  return 0;
}


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

x86 assembly (clang, -O2):
<mp_sqr_256>:
mov    0x10(%rsi),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_sqr_256(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 = getelementptr inbounds i64, i64* %5, i64 1
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 2
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 0
store i64 %11, i64* %13
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_sqr_256(i64* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %1, i64 2
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
store i64 %7, i64* %0
ret i64 0
}
/* Variables and functions */
int strcmp(char *, char *);
int changed(char *a, char *b) {
  if (a == 0 && b == 0)
    return 0;
  if (a == 0 || b == 0)
    return 1;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<changed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <changed+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <changed+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1174 <changed+0x64>
cmpq   $0x0,-0x10(%rbp)
je     1158 <changed+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <changed+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1174 <changed+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changed>:
xor    %eax,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     112e <changed+0x1e>
mov    $0x1,%eax
test   %rdi,%rdi
je     112e <changed+0x1e>
test   %rsi,%rsi
je     112e <changed+0x1e>
jmp    1030 <strcmp@plt>
ret

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

LLVM IR (-O2):
define i32 @changed(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = or i1 %3, %4
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %6, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void getAddress() { printf("Processing delievery address. "); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Processing delievery address. \00"
define void @getAddress() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Processing delievery address. \00"
define void @getAddress() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hashfn_uint8_djb(void *, int);
uint32_t hashtable_hashfn_uint64(void *k) {
  return hashfn_uint8_djb(k, sizeof(uint64_t));
}


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

x86 assembly (clang, -O2):
<hashtable_hashfn_uint64>:
mov    $0x4,%esi
jmp    1030 <hashfn_uint8_djb@plt>

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

LLVM IR (-O2):
define i32 @hashtable_hashfn_uint64(i8* %0) {
%2 = tail call i32 @hashfn_uint8_djb(i8* %0, i32 4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("A"); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x41,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @putchar(i32 65)
ret void
}
/* Variables and functions */
double remainder(double, double);
double drem(double x, double y) { return remainder(x, y); }


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

x86 assembly (clang, -O2):
<drem>:
jmp    1030 <remainder@plt>

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

LLVM IR (-O2):
define double @drem(double %0, double %1) {
%3 = tail call double @remainder(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ funct(int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int *p, *q, s, t;
  q = &s;
  p = &t;
  {
    *q--;
    p = q;
    funct(p, q);
    printf("%d%d%d", *p, *q, s);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <funct@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    (%rsp),%rdi
mov    %rdi,%rsi
call   1040 <funct@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xec5(%rip),%rdi
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = getelementptr inbounds i32, i32* %1, i64 -1
%4 = call i32 @funct(i32* %3, i32* %3)
%5 = load i32, i32* %3
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
const char *pidstr(pid_t pid) {
  static char buffer[20];
  itoa((int)pid, buffer);
  return buffer;
}


x86 assembly (clang, -O0):
<pidstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
lea    0x2f17(%rip),%rsi
call   1030 <itoa@plt>
lea    0x2f0b(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pidstr>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
call   1030 <itoa@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@pidstr.buffer = internal global [20 x i8] zeroinitializer
define i8* @pidstr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @itoa(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @pidstr.buffer, i64 0, i64 0))
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @pidstr.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@pidstr.buffer = internal global [20 x i8] zeroinitializer
define i8* @pidstr(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @itoa(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @pidstr.buffer, i64 0, i64 0))
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @pidstr.buffer, i64 0, i64 0)
}
void print_elem_struct(const struct elem *e) {}


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

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

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

LLVM IR (-O2):
%struct.elem = type opaque
define void @print_elem_struct(%struct.elem* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToLedController(char *);
int mgrPlayStopped(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToLedController("/led/green/off");
  if (code != 0) {
    mgrSendMessageToLedController("/led/orange/blink/fast");
  }
  return 0;
}


x86 assembly (clang, -O0):
<mgrPlayStopped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
cmpl   $0x0,-0x4(%rbp)
je     1145 <mgrPlayStopped+0x35>
lea    0xecf(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrPlayStopped>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
test   %ebx,%ebx
je     112f <mgrPlayStopped+0x1f>
lea    0xee5(%rip),%rdi
call   1030 <mgrSendMessageToLedController@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/led/green/off\00"
@.str.1 = [23 x i8] c"/led/orange/blink/fast\00"
define i32 @mgrPlayStopped(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/led/green/off\00"
@.str.1 = [23 x i8] c"/led/orange/blink/fast\00"
define i32 @mgrPlayStopped(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @mgrSendMessageToLedController(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  int *null_ptr = 0;
  printf("Hello, segfault!\n");
  printf("Now crash %d\n", *null_ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Now crash %d\0A\00"
@str = [17 x i8] c"Hello, segfault!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int powf(float, double);
float distance(int value) {
  float volts = value * 0.00322265625;
  float distance = 65 * powf(volts, -1.10);
  return distance;
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
call   1030 <powf@plt>
imul   $0x41,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xedf(%rip),%xmm1
call   1030 <powf@plt>
mov    %eax,%ecx
shl    $0x6,%ecx
add    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @distance(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3F6A666666666666
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @powf(float %9, double -1.100000e+00)
%11 = mul nsw i32 65, %10
%12 = sitofp i32 %11 to float
store float %12, float* %4
%13 = load float, float* %4
ret float %13
}

LLVM IR (-O2):
define float @distance(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3F6A666666666666
%4 = fptrunc double %3 to float
%5 = tail call i32 @powf(float %4, double -1.100000e+00)
%6 = mul nsw i32 %5, 65
%7 = sitofp i32 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ file_write(int, char *);
unsigned put_socket(int i) {
  file_write(i, "packet");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"packet\00"
define i32 @put_socket(i32 %0) {
%2 = tail call i32 @file_write(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int ft_is_flag(char c) {
  return (c == '#' || c == '0' || c == '-' || c == '+' || c == ' ');
}


x86 assembly (clang, -O0):
<ft_is_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x23,%ecx
mov    %al,-0x2(%rbp)
je     115f <ft_is_flag+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
je     115f <ft_is_flag+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     115f <ft_is_flag+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     115f <ft_is_flag+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_is_flag(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, 35
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 48
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 43
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 32
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_is_flag(i8 signext %0) {
switch i8 %0, label %2 [
i8 48, label %5
i8 45, label %5
i8 43, label %5
i8 35, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 32
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Curl_cfree(void *);
void curl_free(void *p) {
  if (p)
    Curl_cfree(p);
}


x86 assembly (clang, -O0):
<curl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <curl_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <Curl_cfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curl_free>:
test   %rdi,%rdi
je     111a <curl_free+0xa>
jmp    1030 <Curl_cfree@plt>
ret

LLVM IR (-O0):
define void @curl_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @Curl_cfree(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @curl_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @Curl_cfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *strcat(char *, char const *);
char *strcpy(char *dest, const char *src) {
  *dest = 0;
  return strcat(dest, src);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
movb   $0x0,(%rdi)
jmp    1030 <strcat@plt>

LLVM IR (-O0):
define i8* @strcpy(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
store i8 0, i8* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @strcat(i8* %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* nocapture %1) {
store i8 0, i8* %0
%3 = tail call i8* @strcat(i8* %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
unsigned int strlen(char *);
void fit(char *str, unsigned int size) {
  if (strlen(str) > size) {
    str[size] = '\0';
  }
}


x86 assembly (clang, -O0):
<fit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0xc(%rbp),%eax
jbe    113c <fit+0x2c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %ebp,%eax
jbe    1127 <fit+0x17>
mov    %ebp,%eax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fit(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp ugt i32 %3, %1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = zext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srcopy(int /*<<< orphan*/);
void cmd_srread() { srcopy(0); }


x86 assembly (clang, -O0):
<cmd_srread>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <srcopy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_srread>:
xor    %edi,%edi
jmp    1030 <srcopy@plt>

LLVM IR (-O0):
define void @cmd_srread() {
%1 = call i32 @srcopy(i32 0)
ret void
}

LLVM IR (-O2):
define void @cmd_srread() {
%1 = tail call i32 @srcopy(i32 0)
ret void
}
int do_487() { return 487; }


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

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

LLVM IR (-O0):
define i32 @do_487() {
ret i32 487
}

LLVM IR (-O2):
define i32 @do_487() {
ret i32 487
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ sig_unblock(int /*<<< orphan*/);
void sig_hangupunblock() { sig_unblock(SIGHUP); }


x86 assembly (clang, -O0):
<sig_hangupunblock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_unblock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_hangupunblock>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_unblock@plt>

LLVM IR (-O0):
@SIGHUP = global i32 0
define void @sig_hangupunblock() {
%1 = load i32, i32* @SIGHUP
%2 = call i32 @sig_unblock(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGHUP = global i32 0
define void @sig_hangupunblock() {
%1 = load i32, i32* @SIGHUP
%2 = tail call i32 @sig_unblock(i32 %1)
ret void
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_64 {
  int dummy;
};

/* Variables and functions */
int pcg_unique_64_rxs_m_xs_64_random_r(struct pcg_state_64 *);
uint64_t pcg_unique_64_rxs_m_xs_64_boundedrand_r(struct pcg_state_64 *rng,
                                                 uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_unique_64_rxs_m_xs_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_unique_64_rxs_m_xs_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_unique_64_rxs_m_xs_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_unique_64_rxs_m_xs_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_unique_64_rxs_m_xs_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_unique_64_rxs_m_xs_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_unique_64_rxs_m_xs_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_unique_64_rxs_m_xs_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_unique_64_rxs_m_xs_64_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_64* %0, %struct.pcg_state_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_64*, %struct.pcg_state_64** %3
%13 = call i32 @pcg_unique_64_rxs_m_xs_64_random_r(%struct.pcg_state_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_unique_64_rxs_m_xs_64_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_unique_64_rxs_m_xs_64_random_r(%struct.pcg_state_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              void *, int);
void set_socket_reuseaddr(int s) {
  int opt = 1;
  setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt));
}


x86 assembly (clang, -O0):
<set_socket_reuseaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_socket_reuseaddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @set_socket_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @set_socket_reuseaddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero_test_1(int);
int /*<<< orphan*/ memcpy_test_1(int);
int /*<<< orphan*/ mempcpy_test_1(int);
int /*<<< orphan*/ memset_test_1(int);
void test_stringops_1(int len) {
  bzero_test_1(len);
  memcpy_test_1(len);
  mempcpy_test_1(len);
  memset_test_1(len);
}


x86 assembly (clang, -O0):
<test_stringops_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bzero_test_1@plt>
mov    -0x4(%rbp),%edi
call   1040 <memcpy_test_1@plt>
mov    -0x4(%rbp),%edi
call   1050 <mempcpy_test_1@plt>
mov    -0x4(%rbp),%edi
call   1060 <memset_test_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stringops_1>:
push   %rbx
mov    %edi,%ebx
call   1030 <bzero_test_1@plt>
mov    %ebx,%edi
call   1040 <memcpy_test_1@plt>
mov    %ebx,%edi
call   1050 <mempcpy_test_1@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <memset_test_1@plt>

LLVM IR (-O0):
define void @test_stringops_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bzero_test_1(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @memcpy_test_1(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @mempcpy_test_1(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @memset_test_1(i32 %9)
ret void
}

LLVM IR (-O2):
define void @test_stringops_1(i32 %0) {
%2 = tail call i32 @bzero_test_1(i32 %0)
%3 = tail call i32 @memcpy_test_1(i32 %0)
%4 = tail call i32 @mempcpy_test_1(i32 %0)
%5 = tail call i32 @memset_test_1(i32 %0)
ret void
}
/* Type definitions */
struct feed_tty {
  int dummy;
};

/* Variables and functions */
char feed_tty_clear(struct feed_tty *const, int);
char feed_tty_clear_history(struct feed_tty *const p_tty) {
  return feed_tty_clear(p_tty, 3);
}


x86 assembly (clang, -O0):
<feed_tty_clear_history>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <feed_tty_clear@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_tty_clear_history>:
mov    $0x3,%esi
jmp    1030 <feed_tty_clear@plt>

LLVM IR (-O0):
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_clear_history(%struct.feed_tty* %0) {
%2 = alloca %struct.feed_tty*
store %struct.feed_tty* %0, %struct.feed_tty** %2
%3 = load %struct.feed_tty*, %struct.feed_tty** %2
%4 = call signext i8 @feed_tty_clear(%struct.feed_tty* %3, i32 3)
ret i8 %4
}

LLVM IR (-O2):
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_clear_history(%struct.feed_tty* %0) {
%2 = tail call signext i8 @feed_tty_clear(%struct.feed_tty* %0, i32 3)
ret i8 %2
}
void lq2x_generic_output(void *data, unsigned *out_width, unsigned *out_height,
                         unsigned width, unsigned height) {
  *out_width = width * 2;
  *out_height = height * 2;
}


x86 assembly (clang, -O0):
<lq2x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lq2x_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @lq2x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = mul i32 %11, 2
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %10
%15 = mul i32 %14, 2
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @lq2x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_40(int /*<<< orphan*/);
int gen_40() { handle_40(0); }


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

x86 assembly (clang, -O2):
<gen_40>:
xor    %edi,%edi
jmp    1030 <handle_40@plt>

LLVM IR (-O0):
define i32 @gen_40() {
%1 = alloca i32
%2 = call i32 @handle_40(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_40() {
%1 = tail call i32 @handle_40(i32 0)
ret i32 undef
}
void swap2(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


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

x86 assembly (clang, -O2):
<swap2>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assume(int);
int /*<<< orphan*/ static_assert(int);
void main() {
  int i, k, n, l;
  assume(l > 0);
  for (k = 1; k < n; k++) {
    for (i = l; i < n; i++) {
    }
    for (i = l; i < n; i++) {
      static_assert(1 <= i);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b9 <main+0x99>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1171 <main+0x51>
jmp    1163 <main+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <main+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a6 <main+0x86>
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <static_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <main+0x57>
jmp    11ab <main+0x8b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <assume@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assume(i32 %7)
store i32 1, i32* %2
br label %9
9: ; preds = %38, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %41
13: ; preds = %9
%14 = load i32, i32* %4
store i32 %14, i32* %1
br label %15
15: ; preds = %20, %13
%16 = load i32, i32* %1
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
br label %20
20: ; preds = %19
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
br label %15
23: ; preds = %15
%24 = load i32, i32* %4
store i32 %24, i32* %1
br label %25
25: ; preds = %34, %23
%26 = load i32, i32* %1
%27 = load i32, i32* %3
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %37
29: ; preds = %25
%30 = load i32, i32* %1
%31 = icmp sle i32 1, %30
%32 = zext i1 %31 to i32
%33 = call i32 @static_assert(i32 %32)
br label %34
34: ; preds = %29
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
br label %25
37: ; preds = %25
br label %38
38: ; preds = %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %9
41: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @assume(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void crash(void) { assert(0); }


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @crash() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @crash() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Type definitions */
struct crate_t {
  int dummy;
};

/* Variables and functions */
int crate_cmp(struct crate_t *, struct crate_t *);
int qcompar(const void *a, const void *b) {
  return crate_cmp(*(struct crate_t **)a, *(struct crate_t **)b);
}


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

x86 assembly (clang, -O2):
<qcompar>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <crate_cmp@plt>

LLVM IR (-O0):
%struct.crate_t = type { i32 }
define i32 @qcompar(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 = bitcast i8* %5 to %struct.crate_t**
%7 = load %struct.crate_t*, %struct.crate_t** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.crate_t**
%10 = load %struct.crate_t*, %struct.crate_t** %9
%11 = call i32 @crate_cmp(%struct.crate_t* %7, %struct.crate_t* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.crate_t = type { i32 }
define i32 @qcompar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.crate_t**
%4 = load %struct.crate_t*, %struct.crate_t** %3
%5 = bitcast i8* %1 to %struct.crate_t**
%6 = load %struct.crate_t*, %struct.crate_t** %5
%7 = tail call i32 @crate_cmp(%struct.crate_t* %4, %struct.crate_t* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ draw_gfx(int, int, int, int /*<<< orphan*/,
                            int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gfx_dimensions(int, int *, int *);
void draw_bitmap(int id, int x, int y) {
  int W, H;
  gfx_dimensions(id, &W, &H);
  draw_gfx(id, x, y, 0, 0, W, H);
}


x86 assembly (clang, -O0):
<draw_bitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <gfx_dimensions@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%eax
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1030 <draw_gfx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_bitmap>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <gfx_dimensions@plt>
mov    0xc(%rsp),%r9d
mov    0x8(%rsp),%eax
mov    %eax,(%rsp)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <draw_gfx@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @draw_bitmap(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = call i32 @gfx_dimensions(i32 %9, i32* %7, i32* %8)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @draw_gfx(i32 %11, i32 %12, i32 %13, i32 0, i32 0, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @draw_bitmap(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 @gfx_dimensions(i32 %0, i32* %4, i32* %5)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @draw_gfx(i32 %0, i32 %1, i32 %2, i32 0, i32 0, i32 %9, i32 %10)
ret void
}
/* Variables and functions */
int getFactorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", getFactorial(5));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @getFactorial(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
int main(void) {
  printf("Before: my pid is %d\n", getpid());
  int ret_from_fork = fork();
  sleep(1);
  printf("After: my pid is %d\n, fork() said %d\n", getpid(), ret_from_fork);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <fork@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Before: my pid is %d\0A\00"
@.str.1 = [38 x i8] c"After: my pid is %d\0A, fork() said %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getpid()
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @fork()
store i32 %5, i32* %2
%6 = call i32 @sleep(i32 1)
%7 = call i32 (...) @getpid()
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [22 x i8] c"Before: my pid is %d\0A\00"
@.str.1 = [38 x i8] c"After: my pid is %d\0A, fork() said %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %3)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
void destroy_socket(int sockfd) {}


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

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

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

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