xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, char *);
char *prv_status_to_string(int);
void print_status(FILE *stream, uint8_t status) {
  fprintf(stream, "%d.%02d (%s)", (status & 0xE0) >> 5, status & 0x1F,
          prv_status_to_string(status));
}


x86 assembly (clang, -O0):
<print_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    $0xe0,%eax
sar    $0x5,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <prv_status_to_string@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    %rax,%r8
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%ebp
shr    $0x5,%ebp
and    $0x7,%ebp
mov    %esi,%ebx
and    $0x1f,%ebx
mov    %esi,%edi
call   1040 <prv_status_to_string@plt>
lea    0xebe(%rip),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %rax,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%d.%02d (%s)\00"
define void @print_status(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 224
%8 = ashr i32 %7, 5
%9 = load i32, i32* %4
%10 = and i32 %9, 31
%11 = load i32, i32* %4
%12 = call i8* @prv_status_to_string(i32 %11)
%13 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d.%02d (%s)\00"
define void @print_status(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %3, 7
%5 = and i32 %1, 31
%6 = tail call i8* @prv_status_to_string(i32 %1)
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i8* %6)
ret void
}
int tour_compare_ptrs(const void *left_key, const void *right_key) {
  return left_key == right_key;
}


x86 assembly (clang, -O0):
<tour_compare_ptrs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tour_compare_ptrs>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @tour_compare_ptrs(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 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @tour_compare_ptrs(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int soru_3(int dizi[], int N) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @soru_3(i32* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ nsyslog(int /*<<< orphan*/, char *);
void usage(void) {
  nsyslog(LOG_ERR, "only one argument, a signal number, allowed");
  closelog();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <nsyslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <nsyslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [44 x i8] c"only one argument, a signal number, allowed\00"
define void @usage() {
%1 = load i32, i32* @LOG_ERR
%2 = call i32 @nsyslog(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @closelog()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [44 x i8] c"only one argument, a signal number, allowed\00"
define void @usage() {
%1 = load i32, i32* @LOG_ERR
%2 = tail call i32 @nsyslog(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @closelog()
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ write(int, char *, int);
void *xmalloc(size_t size) {
  register void *val;
  val = (void *)malloc(size);
  if (!val && size) {
    write(2, "virtual memory exhausted\n", 25);
    exit(1);
  }
  return val;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <xmalloc+0x4f>
cmpq   $0x0,-0x8(%rbp)
je     117f <xmalloc+0x4f>
mov    $0x2,%edi
lea    0xe95(%rip),%rsi
mov    $0x19,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1143 <xmalloc+0x13>
test   %rax,%rax
je     1145 <xmalloc+0x15>
pop    %rbx
ret
lea    0xeb4(%rip),%rsi
mov    $0x2,%edi
mov    $0x19,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"virtual memory exhausted\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i64, i64* %2
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = call i32 @write(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 25)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %9, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [26 x i8] c"virtual memory exhausted\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 25)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %2 to i8*
ret i8* %10
}
/* Type definitions */
struct sonic_mac {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sonic_mac *);
void sonic_free_mac(struct sonic_mac *mac) {
  ;
  free(mac);
}


x86 assembly (clang, -O0):
<sonic_free_mac>:
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):
<sonic_free_mac>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sonic_mac = type { i32 }
define void @sonic_free_mac(%struct.sonic_mac* nocapture %0) {
%2 = tail call i32 @free(%struct.sonic_mac* %0)
ret void
}
/* Type definitions */
struct flock {
  short l_type;
  void *l_len;
  void *l_start;
};
typedef void *off_t;

/* Variables and functions */
void flock_init(struct flock *f, short int type, off_t start, off_t len) {
  f->l_type = type;
  f->l_start = start;
  f->l_len = len;
}


x86 assembly (clang, -O0):
<flock_init>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<flock_init>:
mov    %si,(%rdi)
mov    %rdx,0x10(%rdi)
mov    %rcx,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.flock = type { i16, i8*, i8* }
define void @flock_init(%struct.flock* %0, i16 signext %1, i8* %2, i8* %3) {
%5 = alloca %struct.flock*
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i8*
store %struct.flock* %0, %struct.flock** %5
store i16 %1, i16* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i16, i16* %6
%10 = load %struct.flock*, %struct.flock** %5
%11 = getelementptr inbounds %struct.flock, %struct.flock* %10, i32 0, i32 0
store i16 %9, i16* %11
%12 = load i8*, i8** %7
%13 = load %struct.flock*, %struct.flock** %5
%14 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 2
store i8* %12, i8** %14
%15 = load i8*, i8** %8
%16 = load %struct.flock*, %struct.flock** %5
%17 = getelementptr inbounds %struct.flock, %struct.flock* %16, i32 0, i32 1
store i8* %15, i8** %17
ret void
}

LLVM IR (-O2):
%struct.flock = type { i16, i8*, i8* }
define void @flock_init(%struct.flock* nocapture writeonly %0, i16 signext %1, i8* %2, i8* %3) {
%5 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 0
store i16 %1, i16* %5
%6 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 2
store i8* %2, i8** %6
%7 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 1
store i8* %3, i8** %7
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, float);
char *format_float(float number) {
  char *converted = (char *)malloc(12 + 1);
  sprintf(converted, "%f", number);
  return converted;
}


x86 assembly (clang, -O0):
<format_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0xd,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_float>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    $0xd,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rsi
mov    %rax,%rdi
movss  0xc(%rsp),%xmm0
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i8* @format_float(float %0) {
%2 = alloca float
%3 = alloca i8*
store float %0, float* %2
%4 = call i64 @malloc(i32 13)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load float, float* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i8* @format_float(float %0) {
%2 = tail call i64 @malloc(i32 13)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret i8* %3
}
struct x *get_array_elem_s(struct x **array, int num) {
  return array[num];
}


x86 assembly (clang, -O0):
<get_array_elem_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_array_elem_s>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
%struct.x = type opaque
define %struct.x* @get_array_elem_s(%struct.x** %0, i32 %1) {
%3 = alloca %struct.x**
%4 = alloca i32
store %struct.x** %0, %struct.x*** %3
store i32 %1, i32* %4
%5 = load %struct.x**, %struct.x*** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.x*, %struct.x** %5, i64 %7
%9 = load %struct.x*, %struct.x** %8
ret %struct.x* %9
}

LLVM IR (-O2):
%struct.x = type opaque
define %struct.x* @get_array_elem_s(%struct.x** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds %struct.x*, %struct.x** %0, i64 %3
%5 = load %struct.x*, %struct.x** %4
ret %struct.x* %5
}
void myswap(int *a, int *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<myswap>:
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):
<myswap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @myswap(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 @myswap(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
}
void initsetproctitle(int argc, char *argv[]) {}


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

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

LLVM IR (-O0):
define void @initsetproctitle(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 @initsetproctitle(i32 %0, i8** nocapture %1) {
ret void
}
void SPI_init(unsigned char config) {
  (*((volatile unsigned long *)0xE002C004)) |= 2 << ((17 - 16) * 2);
  (*((volatile unsigned long *)0xE002C004)) |= 2 << ((18 - 16) * 2);
  (*((volatile unsigned long *)0xE002C004)) |= 2 << ((19 - 16) * 2);
  (*((volatile unsigned char *)0xE0068004)) = 0x01;
  (*((volatile unsigned short *)0xE0068000)) = 0x10F;
  (*((volatile unsigned char *)0xE0068010)) = 12;
  (*((volatile unsigned char *)0xE0068004)) = 0x02;
}


x86 assembly (clang, -O0):
<SPI_init>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe002c004,%eax
mov    (%rax),%rcx
or     $0x8,%rcx
mov    $0xe002c004,%eax
mov    %rcx,(%rax)
mov    $0xe002c004,%eax
mov    (%rax),%rcx
or     $0x20,%rcx
mov    $0xe002c004,%eax
mov    %rcx,(%rax)
mov    $0xe002c004,%eax
mov    (%rax),%rcx
or     $0x80,%rcx
mov    $0xe002c004,%eax
mov    %rcx,(%rax)
mov    $0xe0068004,%eax
movb   $0x1,(%rax)
mov    $0xe0068000,%eax
movw   $0x10f,(%rax)
mov    $0xe0068010,%eax
movb   $0xc,(%rax)
mov    $0xe0068004,%eax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_init>:
mov    $0xe002c004,%eax
orq    $0x8,(%rax)
orq    $0x20,(%rax)
orq    $0x80,(%rax)
movb   $0x1,0x3c000(%rax)
movw   $0x10f,0x3bffc(%rax)
0f 01
movb   $0xc,0x3c00c(%rax)
movb   $0x2,0x3c000(%rax)
ret

LLVM IR (-O0):
define void @SPI_init(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load volatile i64, i64* inttoptr (i64 3758276612 to i64*)
%4 = or i64 %3, 8
store volatile i64 %4, i64* inttoptr (i64 3758276612 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 3758276612 to i64*)
%6 = or i64 %5, 32
store volatile i64 %6, i64* inttoptr (i64 3758276612 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 3758276612 to i64*)
%8 = or i64 %7, 128
store volatile i64 %8, i64* inttoptr (i64 3758276612 to i64*)
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 271, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 12, i8* inttoptr (i64 3758522384 to i8*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}

LLVM IR (-O2):
define void @SPI_init(i8 zeroext %0) {
%2 = load volatile i64, i64* inttoptr (i64 3758276612 to i64*)
%3 = or i64 %2, 8
store volatile i64 %3, i64* inttoptr (i64 3758276612 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 3758276612 to i64*)
%5 = or i64 %4, 32
store volatile i64 %5, i64* inttoptr (i64 3758276612 to i64*)
%6 = load volatile i64, i64* inttoptr (i64 3758276612 to i64*)
%7 = or i64 %6, 128
store volatile i64 %7, i64* inttoptr (i64 3758276612 to i64*)
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 271, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 12, i8* inttoptr (i64 3758522384 to i8*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double wall_time() {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return 1. * t.tv_sec + 1.e-9 * t.tv_nsec;
}


x86 assembly (clang, -O0):
<wall_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wall_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0xec5(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, double }
@CLOCK_MONOTONIC = global i32 0
define double @wall_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = fmul double 1.000000e-09, %8
%10 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %6, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, double }
@CLOCK_MONOTONIC = global i32 0
define double @wall_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fmul double %9, 1.000000e-09
%11 = fadd double %10, %7
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ append();
int /*<<< orphan*/ current();
scalar_t__ isdigit(int /*<<< orphan*/);
int number(void) {
  append();
  while (isdigit(current()))
    append();
  return 4;
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <append@plt>
mov    $0x0,%al
call   1050 <current@plt>
mov    %eax,%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     115f <number+0x2f>
mov    $0x0,%al
call   1030 <append@plt>
jmp    113b <number+0xb>
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <append@plt>
xor    %eax,%eax
call   1050 <current@plt>
mov    %eax,%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1140 <number+0x10>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @number() {
%1 = call i32 (...) @append()
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @current()
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @append()
br label %2
8: ; preds = %2
ret i32 4
}

LLVM IR (-O2):
define i32 @number() {
%1 = tail call i32 (...) @append()
%2 = tail call i32 (...) @current()
%3 = tail call i64 @isdigit(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = tail call i32 (...) @append()
%7 = tail call i32 (...) @current()
%8 = tail call i64 @isdigit(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 4
}
ge(float a, float b) { return a >= b; }


x86 assembly (clang, -O0):
<ge>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ge>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @ge(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ge(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;
struct pcg_state_64 {
  int dummy;
};

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


x86 assembly (clang, -O0):
<pcg_mcg_64_xsl_rr_32_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_mcg_64_xsl_rr_32_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_mcg_64_xsl_rr_32_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_mcg_64_xsl_rr_32_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_mcg_64_xsl_rr_32_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_mcg_64_xsl_rr_32_random_r@plt>
test   %eax,%eax
js     1120 <pcg_mcg_64_xsl_rr_32_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_mcg_64_xsl_rr_32_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_mcg_64_xsl_rr_32_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_mcg_64_xsl_rr_32_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_mcg_64_xsl_rr_32_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
}
/* Variables and functions */
int /*<<< orphan*/ SIGIOT;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void iotHandler(int sig) { signal(SIGIOT, iotHandler); }


x86 assembly (clang, -O0):
<iotHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    0x2eb5(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iotHandler>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rsi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGIOT = global i32 0
define void @iotHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGIOT
%4 = call i32 @signal(i32 %3, void (i32)* @iotHandler)
ret void
}

LLVM IR (-O2):
@SIGIOT = global i32 0
define void @iotHandler(i32 %0) {
%2 = load i32, i32* @SIGIOT
%3 = tail call i32 @signal(i32 %2, void (i32)* @iotHandler)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ ERR_GMP_error(int, int, char *, int);
int e_gmp_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)) {
  int to_return = 1;
  switch (cmd) {
  default:
    ERR_GMP_error(
        (100), (100),
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/5610110083/Safety-in-residential-project/"
        "refs/heads/374.43_2-update/3rdParty/openssl/engines/e_gmp.c",
        256);
    to_return = 0;
    break;
  }
  return to_return;
}


x86 assembly (clang, -O0):
<e_gmp_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    $0x64,%esi
lea    0xec2(%rip),%rdx
mov    $0x100,%ecx
mov    %esi,%edi
call   1030 <ERR_GMP_error@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_gmp_ctrl>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0x100,%ecx
call   1030 <ERR_GMP_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [191 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/5610110083/Safety-in-residential-project/refs/heads/374.43_2-update/3rdParty/openssl/engines/e_gmp.c\00"
define i32 @e_gmp_ctrl(i32* %0, i32 %1, i64 %2, i8* %3, void ()* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
%10 = alloca void ()*
%11 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store void ()* %4, void ()** %10
store i32 1, i32* %11
%12 = load i32, i32* %7
switch i32 %12, label %13 [
]
13: ; preds = %5
%14 = call i32 @ERR_GMP_error(i32 100, i32 100, i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0), i32 256)
store i32 0, i32* %11
br label %15
15: ; preds = %13
%16 = load i32, i32* %11
ret i32 %16
}

LLVM IR (-O2):
@.str = [191 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/5610110083/Safety-in-residential-project/refs/heads/374.43_2-update/3rdParty/openssl/engines/e_gmp.c\00"
define i32 @e_gmp_ctrl(i32* nocapture readnone %0, i32 %1, i64 %2, i8* nocapture readnone %3, void ()* nocapture readnone %4) {
%6 = tail call i32 @ERR_GMP_error(i32 100, i32 100, i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0), i32 256)
ret i32 0
}
/* Variables and functions */
int unmarshal_double(double *data, unsigned char **in, size_t *size) {
  double *_in = (double *)*in;
  if (*size < 8)
    return -1;
  *data = *_in;
  (*size) -= 8;
  (*in) += 8;
  return 0;
}


x86 assembly (clang, -O0):
<unmarshal_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x8,(%rax)
jae    1135 <unmarshal_double+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <unmarshal_double+0x68>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
sub    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmarshal_double>:
mov    (%rdx),%rcx
mov    $0xffffffff,%eax
cmp    $0x8,%rcx
jb     1129 <unmarshal_double+0x29>
mov    (%rsi),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rdi)
add    $0xfffffffffffffff8,%rcx
mov    %rcx,(%rdx)
add    $0x8,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @unmarshal_double(double* nocapture writeonly %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, 8
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = bitcast i8** %1 to double**
%8 = load double*, double** %7
%9 = load double, double* %8
store double %9, double* %0
%10 = add i64 %4, -8
store i64 %10, i64* %2
%11 = getelementptr inbounds double, double* %8, i64 1
store double* %11, double** %7
br label %12
12: ; preds = %3, %6
%13 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %13
}
/* Variables and functions */
void *dlopen(char const *, int);
void *dlwrap_dlopen(const char *file, int flag) {
  void *ret;
  ret = dlopen(file, flag);
  return ret;
}


x86 assembly (clang, -O0):
<dlwrap_dlopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <dlopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlwrap_dlopen>:
jmp    1030 <dlopen@plt>

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

LLVM IR (-O2):
define i8* @dlwrap_dlopen(i8* %0, i32 %1) {
%3 = tail call i8* @dlopen(i8* %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct xx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int f1(struct xx *p) {
  static int beenhere = 0;
  if (beenhere++ > 1)
    abort();
  return beenhere > 1;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x1,%eax
jle    113d <f1+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x1,0x2ee8(%rip)
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    0x2f15(%rip),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x2f0c(%rip)
cmp    $0x2,%ecx
jge    112f <f1+0x1f>
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.xx = type { i32 }
@f1.beenhere = internal global i32 0
define i32 @f1(%struct.xx* %0) {
%2 = alloca %struct.xx*
store %struct.xx* %0, %struct.xx** %2
%3 = load i32, i32* @f1.beenhere
%4 = add nsw i32 %3, 1
store i32 %4, i32* @f1.beenhere
%5 = icmp sgt i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i32, i32* @f1.beenhere
%10 = icmp sgt i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.xx = type { i32 }
@f1.beenhere = internal unnamed_addr global i32 0
define i32 @f1(%struct.xx* nocapture readnone %0) {
%2 = load i32, i32* @f1.beenhere
%3 = add nsw i32 %2, 1
store i32 %3, i32* @f1.beenhere
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = icmp eq i32 %2, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
unsigned char usr_led_on(unsigned char led_num) {
  unsigned int val = 0;
  val = 0x1 << (led_num + 21);
  (*(volatile unsigned int *)(0x4804C194) = (val));
  return 1;
}


x86 assembly (clang, -O0):
<usr_led_on>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movzbl -0x1(%rbp),%ecx
add    $0x15,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x4804c194,%eax
mov    %ecx,(%rax)
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usr_led_on>:
mov    %edi,%ecx
mov    $0x200000,%eax
shl    %cl,%eax
mov    %eax,0x4804c194
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @usr_led_on(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = add nsw i32 %5, 21
%7 = shl i32 1, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
store volatile i32 %8, i32* inttoptr (i64 1208271252 to i32*)
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @usr_led_on(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl i32 2097152, %2
store volatile i32 %3, i32* inttoptr (i64 1208271252 to i32*)
ret i8 1
}
void scamper_do_ping_cleanup() { return; }


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

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

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

LLVM IR (-O2):
define void @scamper_do_ping_cleanup() {
ret void
}
int my_strlen_index(char string[]) {
  int i;
  for (i = 0; string[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<my_strlen_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <my_strlen_index+0x37>
jmp    1129 <my_strlen_index+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen_index+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen_index>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen_index+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen_index(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

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


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

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

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

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @current_time_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int my_getpass(char *, char *, int);
int pem_passwd_cb(char *buf, int size, int rwflag, void *userdata) {
  assert(rwflag == 0);
  return my_getpass("Password for private key: ", buf, size);
}


x86 assembly (clang, -O0):
<pem_passwd_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1040 <my_getpass@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pem_passwd_cb>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %edx,%edx
sete   %dil
call   1030 <assert@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <my_getpass@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Password for private key: \00"
define i32 @pem_passwd_cb(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @my_getpass(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [27 x i8] c"Password for private key: \00"
define i32 @pem_passwd_cb(i8* %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
%5 = icmp eq i32 %2, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @my_getpass(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 %8
}
void ff_hevc_put_hevc_bi_qpel_v32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v32_12_sse4() {
ret void
}
/* Variables and functions */
int get_carry();
int get_overflow();
int save_flags(void) { return (get_overflow() << 1) | get_carry(); }


x86 assembly (clang, -O0):
<save_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_overflow@plt>
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_carry@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_flags>:
push   %rbx
xor    %eax,%eax
call   1030 <get_overflow@plt>
mov    %eax,%ebx
add    %eax,%ebx
xor    %eax,%eax
call   1040 <get_carry@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @save_flags() {
%1 = call i32 (...) @get_overflow()
%2 = shl i32 %1, 1
%3 = call i32 (...) @get_carry()
%4 = or i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @save_flags() {
%1 = tail call i32 (...) @get_overflow()
%2 = shl i32 %1, 1
%3 = tail call i32 (...) @get_carry()
%4 = or i32 %2, %3
ret i32 %4
}
int callback(int p1, int p2) { return p1 + p2; }


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

x86 assembly (clang, -O2):
<callback>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @callback(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void gtk_tree_view_get_dest_row_at_pos() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_dest_row_at_pos() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_tx_byte(unsigned char);
void uart_tx_multiple_bytes(unsigned char *buf, int size) {
  volatile int ssize = 0;
  for (ssize = 0; ssize < size; ssize++) {
    uart_tx_byte(buf[ssize]);
  }
}


x86 assembly (clang, -O0):
<uart_tx_multiple_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <uart_tx_multiple_bytes+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <uart_tx_byte@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <uart_tx_multiple_bytes+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_tx_multiple_bytes>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    %esi,%eax
jge    115c <uart_tx_multiple_bytes+0x4c>
mov    %esi,%ebx
mov    %rdi,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq 0x4(%rsp),%rax
movzbl (%r14,%rax,1),%edi
call   1030 <uart_tx_byte@plt>
addl   $0x1,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
jl     1140 <uart_tx_multiple_bytes+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @uart_tx_multiple_bytes(i8* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp slt i32 %5, %1
br i1 %6, label %7, label %17
7: ; preds = %2, %7
%8 = load volatile i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @uart_tx_byte(i8 zeroext %11)
%13 = load volatile i32, i32* %3
%14 = add nsw i32 %13, 1
store volatile i32 %14, i32* %3
%15 = load volatile i32, i32* %3
%16 = icmp slt i32 %15, %1
br i1 %16, label %7, label %17
17: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char *);
char *gettext(char *);
char *quote(char const *);
void parse_group(const char *name) {
  if (0)
    error(1, 0, gettext("invalid group name %s"), quote(name));
}


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

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

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

LLVM IR (-O2):
define void @parse_group(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *cmdname) {
  printf("Usage: %s [-m] [addr1] [addr2] .. [addrN]\n", cmdname);
  printf("\t -m : use MMIO instead of port IO\n");
  printf("\t addr : in 0xXXXX format\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: %s [-m] [addr1] [addr2] .. [addrN]\0A\00"
@.str.1 = [36 x i8] c"\09 -m : use MMIO instead of port IO\0A\00"
@.str.2 = [27 x i8] c"\09 addr : in 0xXXXX format\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Usage: %s [-m] [addr1] [addr2] .. [addrN]\0A\00"
@str = [35 x i8] c"\09 -m : use MMIO instead of port IO\00"
@str.3 = [26 x i8] c"\09 addr : in 0xXXXX format\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
ret void
}