xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FAIL(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
__attribute__((destructor)) void myterm() {
  FAIL("terminator-bounds-check, terminator called");
  exit(0);
}


x86 assembly (clang, -O0):
<myterm>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <FAIL@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<myterm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <FAIL@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"terminator-bounds-check, terminator called\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myterm, i8* null }]
define void @myterm() {
%1 = call i32 @FAIL(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"terminator-bounds-check, terminator called\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myterm, i8* null }]
define void @myterm() {
%1 = tail call i32 @FAIL(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
assert(_Bool b) {
  static unsigned i;
  if (!b) {
    write(2, (char[]){i + '0', '\n'}, 2);
    abort();
  }
  i++;
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
testb  $0x1,-0x5(%rbp)
jne    1161 <assert+0x41>
mov    0x2ef4(%rip),%eax
add    $0x30,%eax
mov    %al,-0x7(%rbp)
movb   $0xa,-0x6(%rbp)
lea    -0x7(%rbp),%rsi
mov    $0x2,%edx
mov    %edx,%edi
mov    $0x0,%al
call   1040 <write@plt>
call   1030 <abort@plt>
mov    0x2ecd(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec4(%rip)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
push   %rax
test   %edi,%edi
je     112e <assert+0xe>
addl   $0x1,0x2f08(%rip)
pop    %rcx
ret
mov    0x2f00(%rip),%al
add    $0x30,%al
mov    %al,0x6(%rsp)
movb   $0xa,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <write@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
@assert.i = internal global i32 0
define i32 @assert(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [2 x i8]
%5 = zext i1 %0 to i8
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = trunc i8 %6 to i1
br i1 %7, label %16, label %8
8: ; preds = %1
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%10 = load i32, i32* @assert.i
%11 = add i32 %10, 48
%12 = trunc i32 %11 to i8
store i8 %12, i8* %9
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 10, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%15 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %14, i32 2)
unreachable
16: ; preds = %1
%17 = load i32, i32* @assert.i
%18 = add i32 %17, 1
store i32 %18, i32* @assert.i
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@assert.i = internal unnamed_addr global i32 0
define i32 @assert(i1 zeroext %0) {
%2 = alloca [2 x i8]
br i1 %0, label %10, label %3
3: ; preds = %1
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @assert.i
%6 = trunc i32 %5 to i8
%7 = add i8 %6, 48
store i8 %7, i8* %4
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 10, i8* %8
%9 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 2, i8* %4, i32 2)
unreachable
10: ; preds = %1
%11 = load i32, i32* @assert.i
%12 = add i32 %11, 1
store i32 %12, i32* @assert.i
ret i32 undef
}
void HibernateIntClear(unsigned long ulIntFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC020))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<HibernateIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400fc020,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fc020,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntClear>:
or     %rdi,0x400fc020
40
ret

LLVM IR (-O0):
define void @HibernateIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774048 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074774048 to i64*)
ret void
}

LLVM IR (-O2):
define void @HibernateIntClear(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774048 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074774048 to i64*)
ret void
}
void flush_thread(void) {}


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

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

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

LLVM IR (-O2):
define void @flush_thread() {
ret void
}
void kiss_F_fft_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @kiss_F_fft_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *realloc(long *, int);
void *enlarge_array(long *arr, int *cap) {
  assert(*cap < *cap + 1024);
  *cap = *cap + 1024;
  return realloc(arr, *cap * sizeof(long));
}


x86 assembly (clang, -O0):
<enlarge_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x400,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x400,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enlarge_array>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x1,%edi
call   1030 <assert@plt>
mov    (%rbx),%eax
lea    0x400(%rax),%ecx
mov    %ecx,(%rbx)
lea    0x2000(,%rax,8),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <realloc@plt>

LLVM IR (-O0):
define i8* @enlarge_array(i64* %0, i32* %1) {
%3 = alloca i64*
%4 = alloca i32*
store i64* %0, i64** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1024
%10 = icmp slt i32 %6, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1024
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i64*, i64** %3
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 8
%22 = trunc i64 %21 to i32
%23 = call i8* @realloc(i64* %17, i32 %22)
ret i8* %23
}

LLVM IR (-O2):
define i8* @enlarge_array(i64* %0, i32* nocapture %1) {
%3 = tail call i32 @assert(i32 1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1024
store i32 %5, i32* %1
%6 = shl i32 %5, 3
%7 = tail call i8* @realloc(i64* %0, i32 %6)
ret i8* %7
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  while (*s)
    f(i++, s++);
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <ft_striteri+0x49>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    %rsi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    1117 <ft_striteri+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i32, i8*)*
%5 = alloca i32
store i8* %0, i8** %3
store void (i32, i8*)* %1, void (i32, i8*)** %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load void (i32, i8*)*, void (i32, i8*)** %4
%12 = load i32, i32* %5
%13 = add i32 %12, 1
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = add i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
tail call void %1(i32 %6, i8* %7)
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _jx_core_free(void *in_memory) { free(in_memory); }


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

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

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

LLVM IR (-O2):
define void @_jx_core_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
struct passwd *getpwnam(const char *a) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<getpwnam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
lea    0xedb(%rip),%rsi
lea    0xee6(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.passwd = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getpwnam = [9 x i8] c"getpwnam\00"
define %struct.passwd* @getpwnam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.getpwnam, i64 0, i64 0))
ret %struct.passwd* null
}

LLVM IR (-O2):
%struct.passwd = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getpwnam = [9 x i8] c"getpwnam\00"
define %struct.passwd* @getpwnam(i8* nocapture readnone %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.getpwnam, i64 0, i64 0))
ret %struct.passwd* null
}
/* Type definitions */
struct bpf_prog {
  int dummy;
};

/* Variables and functions */
void bpf_jit_compile(struct bpf_prog *prog) {}


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

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

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

LLVM IR (-O2):
%struct.bpf_prog = type { i32 }
define void @bpf_jit_compile(%struct.bpf_prog* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ is_valid_addr(scalar_t__);
bool is_valid_range(uint32_t from, uint32_t size) {
  return is_valid_addr(from) && is_valid_addr(from + size - 1);
}


x86 assembly (clang, -O0):
<is_valid_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_valid_addr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1156 <is_valid_range+0x46>
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <is_valid_addr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_range>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <is_valid_addr@plt>
test   %rax,%rax
je     113e <is_valid_range+0x2e>
lea    (%rbx,%r14,1),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <is_valid_addr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1140 <is_valid_range+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_valid_range(i64 %0, i64 %1) {
%3 = tail call i64 @is_valid_addr(i64 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = add i64 %0, -1
%7 = add i64 %6, %1
%8 = tail call i64 @is_valid_addr(i64 %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %2
%12 = phi i32 [ 0, %2 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *child(void *dummy) {
  for (int i = 4; i <= 6; i++) {
    printf("C %2d\n", i);
  }
  pthread_exit(NULL);
  return NULL;
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jg     115a <child+0x3a>
mov    -0xc(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <child+0x13>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"C %2d\0A\00"
define noalias i8* @child(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* null
}
/* Variables and functions */
char *strchr(char *, char);
void strip_newline(char *str) {
  char *nl;
  nl = strchr(str, '\n');
  if (nl) {
    *nl = '\0';
  }
  return;
}


x86 assembly (clang, -O0):
<strip_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <strip_newline+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_newline>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <strip_newline+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @strip_newline(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int lireCle() {
  int key;
  do {
    printf("Veuillez entrer une cle (0-255):\n");
    scanf("%d", &key);
  } while ((key < 0) || (key > 255));
  return key;
}


x86 assembly (clang, -O0):
<lireCle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1160 <lireCle+0x40>
cmpl   $0xff,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1128 <lireCle+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lireCle>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed3(%rip),%r14
lea    0xec9(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0xff,%eax
ja     1140 <lireCle+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Veuillez entrer une cle (0-255):\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @lireCle() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 255
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
br i1 %12, label %2, label %13
13: ; preds = %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [33 x i8] c"Veuillez entrer une cle (0-255):\00"
define i32 @lireCle() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp ugt i32 %6, 255
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int Getc(int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ Ungetc(int, int /*<<< orphan*/ *, int *);
void LineSkip(FILE *f, int *linep) {
  int c;
  while ((c = Getc(f, linep)) == '\n')
    ;
  Ungetc(c, f, linep);
}


x86 assembly (clang, -O0):
<LineSkip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Getc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xa,%eax
jne    114e <LineSkip+0x2e>
jmp    1130 <LineSkip+0x10>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <Ungetc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LineSkip>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Getc@plt>
cmp    $0xa,%eax
je     1130 <LineSkip+0x10>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Ungetc@plt>

LLVM IR (-O0):
define void @LineSkip(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @Getc(i32* %7, i32* %8)
store i32 %9, i32* %5
%10 = icmp eq i32 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
%13 = load i32, i32* %5
%14 = load i32*, i32** %3
%15 = load i32*, i32** %4
%16 = call i32 @Ungetc(i32 %13, i32* %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @LineSkip(i32* %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @Getc(i32* %0, i32* %1)
%5 = icmp eq i32 %4, 10
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call i32 @Ungetc(i32 %4, i32* %0, i32* %1)
ret void
}
/* Variables and functions */
unsigned long D_GET_TAG(long);
long l_cdr(long);
int list_len(long s) {
  int i;
  for (i = 0; D_GET_TAG(s) == (4UL << 28UL); s = l_cdr(s))
    i++;
  return i;
}


x86 assembly (clang, -O0):
<list_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <D_GET_TAG@plt>
cmp    $0x40000000,%rax
jne    1163 <list_len+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <l_cdr@plt>
mov    %rax,-0x8(%rbp)
jmp    1133 <list_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_len>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <D_GET_TAG@plt>
xor    %ebp,%ebp
cmp    $0x40000000,%rax
jne    115e <list_len+0x3e>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <l_cdr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <D_GET_TAG@plt>
cmp    $0x40000000,%rax
je     1140 <list_len+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @list_len(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i64, i64* %2
%6 = call i64 @D_GET_TAG(i64 %5)
%7 = icmp eq i64 %6, 1073741824
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %8
%12 = load i64, i64* %2
%13 = call i64 @l_cdr(i64 %12)
store i64 %13, i64* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @list_len(i64 %0) {
%2 = tail call i64 @D_GET_TAG(i64 %0)
%3 = icmp eq i64 %2, 1073741824
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i64 [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = tail call i64 @l_cdr(i64 %6)
%9 = tail call i64 @D_GET_TAG(i64 %8)
%10 = icmp eq i64 %9, 1073741824
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef unsigned int uint32_t;
typedef int /*<<< orphan*/ serial;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, int /*<<< orphan*/ const *, int);
unsigned int get_serial(const uint8_t *const packet) {
  uint32_t serial;
  memcpy(&serial, &packet[4], sizeof(serial));
  return serial;
}


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

x86 assembly (clang, -O2):
<get_serial>:
push   %rax
lea    0x10(%rdi),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_serial(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Bug(int /*<<< orphan*/ *, char *, char *);
void lisp_bug(char *string) {
  Bug(NULL, "Bug in Clozure CL system code:\n%s", string);
}


x86 assembly (clang, -O0):
<lisp_bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
lea    0xed5(%rip),%rsi
call   1030 <Bug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lisp_bug>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
xor    %edi,%edi
jmp    1030 <Bug@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Bug in Clozure CL system code:\0A%s\00"
define void @lisp_bug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Bug(i32* null, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Bug in Clozure CL system code:\0A%s\00"
define void @lisp_bug(i8* %0) {
%2 = tail call i32 @Bug(i32* null, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RateTorqueKFHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RateTorqueKFUpdated() { UAVObjUpdated(RateTorqueKFHandle()); }


x86 assembly (clang, -O0):
<RateTorqueKFUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RateTorqueKFHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RateTorqueKFUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <RateTorqueKFHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @RateTorqueKFUpdated() {
%1 = call i32 (...) @RateTorqueKFHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RateTorqueKFUpdated() {
%1 = tail call i32 (...) @RateTorqueKFHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int __gstrpart(char **, int, int);
void __gstrsort(char **array, int first, int last) {
  if (first >= last)
    return;
  int middle = __gstrpart(array, first, last);
  __gstrsort(array, first, middle);
  __gstrsort(array, middle + 1, last);
}


x86 assembly (clang, -O0):
<__gstrsort>:
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 <__gstrsort+0x23>
jmp    1176 <__gstrsort+0x56>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <__gstrpart@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <__gstrsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <__gstrsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gstrsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1165 <__gstrsort+0x45>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1040 <__gstrpart@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <__gstrsort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1140 <__gstrsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @__gstrsort(i8** %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @__gstrpart(i8** %0, i32 %6, i32 %2)
tail call void @__gstrsort(i8** %0, i32 %6, i32 %7)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %8, %2
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
void av_find_input_format() {}


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

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

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

LLVM IR (-O2):
define void @av_find_input_format() {
ret void
}
/* Variables and functions */
const char *in_def_get_key_name(int keycode) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @in_def_get_key_name(i32 %0) {
ret i8* null
}
int init_seq(int seq[], int size) {
  int i;
  for (i = 0; i < size; i++)
    seq[i] = 0;
}


x86 assembly (clang, -O0):
<init_seq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    113b <init_seq+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <init_seq+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_seq>:
test   %esi,%esi
jle    1126 <init_seq+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @init_seq(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret i32 undef
}
void i2d_X509_NAME(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_X509_NAME() {
ret void
}
/* Variables and functions */
double magnitude(double *);
int /*<<< orphan*/ vector_subtract(double *, double *, double *);
double points_distance(double A[], double B[]) {
  double AB[3];
  vector_subtract(B, A, AB);
  return magnitude(AB);
}


x86 assembly (clang, -O0):
<points_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <vector_subtract@plt>
lea    -0x30(%rbp),%rdi
call   1030 <magnitude@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<points_distance>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rax
mov    %rsp,%rbx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1040 <vector_subtract@plt>
mov    %rbx,%rdi
call   1030 <magnitude@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @points_distance(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = load double*, double** %3
%8 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%9 = call i32 @vector_subtract(double* %6, double* %7, double* %8)
%10 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%11 = call double @magnitude(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @points_distance(double* %0, double* %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%6 = call i32 @vector_subtract(double* %1, double* %0, double* %5)
%7 = call double @magnitude(double* %5)
ret double %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned char equal(signed char b, signed char c) {
  unsigned char ub = b;
  unsigned char uc = c;
  unsigned char x = ub ^ uc;
  uint32_t y = x;
  y -= 1;
  y >>= 31;
  return y;
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x4(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
xor    %esi,%edi
movzbl %dil,%eax
add    $0xffffffff,%eax
sar    $0x1f,%eax
ret

LLVM IR (-O0):
define zeroext i8 @equal(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%9 = load i8, i8* %3
store i8 %9, i8* %5
%10 = load i8, i8* %4
store i8 %10, i8* %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %7
%17 = load i8, i8* %7
%18 = zext i8 %17 to i32
store i32 %18, i32* %8
%19 = load i32, i32* %8
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %8
%21 = load i32, i32* %8
%22 = ashr i32 %21, 31
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = trunc i32 %23 to i8
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @equal(i8 signext %0, i8 signext %1) {
%3 = xor i8 %1, %0
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, -1
%6 = ashr i32 %5, 31
%7 = trunc i32 %6 to i8
ret i8 %7
}
void _M2_RawIO_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_RawIO_finish(i32 %0, i8** nocapture %1) {
ret void
}
int is_leap_year(int year) {
  return (year % 4 == 0) && !((year % 100 == 0) && (year % 400 != 0));
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1155 <is_leap_year+0x55>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leap_year+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_codever(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_codever_(char codever[]) {
  char name[10];
  strncpy(name, codever, 8);
  *(name + 8) = '\0';
  gmvwrite_codever(name);
}


x86 assembly (clang, -O0):
<fgmvwrite_codever_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0xa(%rbp)
lea    -0x12(%rbp),%rdi
call   1040 <gmvwrite_codever@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_codever_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rsp)
mov    %rbx,%rdi
call   1040 <gmvwrite_codever@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fgmvwrite_codever_(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 8)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 8
store i8 0, i8* %8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @gmvwrite_codever(i8* %9)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_codever_(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 8)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i32 @gmvwrite_codever(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int inotify_add_watch(int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int inotify_add_watch_x(int fd, const char *pathname, uint32_t mask) {
  int watch = inotify_add_watch(fd, pathname, mask);
  if (watch == -1) {
    perror("inotify_add_watch");
    exit(EXIT_FAILURE);
  }
  return watch;
}


x86 assembly (clang, -O0):
<inotify_add_watch_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <inotify_add_watch@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1178 <inotify_add_watch_x+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotify_add_watch_x>:
push   %rax
call   1030 <inotify_add_watch@plt>
cmp    $0xffffffff,%eax
je     113d <inotify_add_watch_x+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"inotify_add_watch\00"
@EXIT_FAILURE = global i32 0
define i32 @inotify_add_watch_x(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @inotify_add_watch(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [18 x i8] c"inotify_add_watch\00"
@EXIT_FAILURE = global i32 0
define i32 @inotify_add_watch_x(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @inotify_add_watch(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *tmpnam(char *);
int main(int argc, char *argv[]) {
  char buffer[10], *c;
  tmpnam(buffer);
  c = tmpnam(NULL);
  printf("Temporary name 1: %s", buffer);
  printf("\nTemporary name 2: %s", c);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
call   1040 <tmpnam@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <tmpnam@plt>
mov    %rax,-0x28(%rbp)
lea    -0x1a(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe(%rsp),%r14
mov    %r14,%rdi
call   1040 <tmpnam@plt>
xor    %edi,%edi
call   1040 <tmpnam@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Temporary name 1: %s\00"
@.str.1 = [22 x i8] c"\0ATemporary name 2: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%9 = call i8* @tmpnam(i8* %8)
%10 = call i8* @tmpnam(i8* null)
store i8* %10, i8** %7
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %7
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Temporary name 1: %s\00"
@.str.1 = [22 x i8] c"\0ATemporary name 2: %s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i8* @tmpnam(i8* %4)
%6 = call i8* @tmpnam(i8* null)
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ int2str(int, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int i = 123;
  char *s = (char *)malloc(sizeof(char));
  int2str(i, s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <int2str@plt>
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x7b,%edi
mov    %rax,%rsi
call   1030 <int2str@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @int2str(i32 123, i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}