xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void error(char *message) {
  printf("Erreur : %s\n", message);
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Erreur : %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Erreur : %s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t time_ns() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ((uint64_t)ts.tv_sec) * 1000000000 + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<time_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_ns>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @time_ns() {
%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 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @time_ns() {
%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 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ p16e_adc();
int /*<<< orphan*/ p16e_int_pin();
int /*<<< orphan*/ p16e_int_ports();
int /*<<< orphan*/ p16e_mssp();
int /*<<< orphan*/ p16e_tmr0();
int /*<<< orphan*/ p16e_tmr1();
int /*<<< orphan*/ p16e_tmr2();
int /*<<< orphan*/ p16e_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC16F1619_periferic(void) {
  p16e_mssp();
  p16e_adc();
  p16e_int_pin();
  p16e_int_ports();
  p16e_tmr0();
  p16e_wdt();
  p16e_tmr1();
  p16e_tmr2();
  serial(0);
}


x86 assembly (clang, -O0):
<PIC16F1619_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <p16e_mssp@plt>
mov    $0x0,%al
call   1060 <p16e_adc@plt>
mov    $0x0,%al
call   10a0 <p16e_int_pin@plt>
mov    $0x0,%al
call   1090 <p16e_int_ports@plt>
mov    $0x0,%al
call   1080 <p16e_tmr0@plt>
mov    $0x0,%al
call   1030 <p16e_wdt@plt>
mov    $0x0,%al
call   10b0 <p16e_tmr1@plt>
mov    $0x0,%al
call   1070 <p16e_tmr2@plt>
xor    %edi,%edi
call   1050 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F1619_periferic>:
push   %rax
xor    %eax,%eax
call   1040 <p16e_mssp@plt>
xor    %eax,%eax
call   1060 <p16e_adc@plt>
xor    %eax,%eax
call   10a0 <p16e_int_pin@plt>
xor    %eax,%eax
call   1090 <p16e_int_ports@plt>
xor    %eax,%eax
call   1080 <p16e_tmr0@plt>
xor    %eax,%eax
call   1030 <p16e_wdt@plt>
xor    %eax,%eax
call   10b0 <p16e_tmr1@plt>
xor    %eax,%eax
call   1070 <p16e_tmr2@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <serial@plt>

LLVM IR (-O0):
define void @PIC16F1619_periferic() {
%1 = call i32 (...) @p16e_mssp()
%2 = call i32 (...) @p16e_adc()
%3 = call i32 (...) @p16e_int_pin()
%4 = call i32 (...) @p16e_int_ports()
%5 = call i32 (...) @p16e_tmr0()
%6 = call i32 (...) @p16e_wdt()
%7 = call i32 (...) @p16e_tmr1()
%8 = call i32 (...) @p16e_tmr2()
%9 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F1619_periferic() {
%1 = tail call i32 (...) @p16e_mssp()
%2 = tail call i32 (...) @p16e_adc()
%3 = tail call i32 (...) @p16e_int_pin()
%4 = tail call i32 (...) @p16e_int_ports()
%5 = tail call i32 (...) @p16e_tmr0()
%6 = tail call i32 (...) @p16e_wdt()
%7 = tail call i32 (...) @p16e_tmr1()
%8 = tail call i32 (...) @p16e_tmr2()
%9 = tail call i32 @serial(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char const *,
                           int);
int getpid();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void fprinttime(FILE *stream, const char *progname) {
  time_t timeval;
  time(&timeval);
  fprintf(stream, "%.15s %s[%u]: ", (ctime(&timeval)) + 4, progname, getpid());
  return;
}


x86 assembly (clang, -O0):
<fprinttime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1060 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <ctime@plt>
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
lea    0xe69(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprinttime>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1040 <ctime@plt>
lea    0x4(%rax),%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe8a(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %eax,%r8d
call   1050 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%.15s %s[%u]: \00"
define void @fprinttime(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = call i32 @time(i32* %5)
%7 = load i32*, i32** %3
%8 = call i8* @ctime(i32* %5)
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = load i8*, i8** %4
%11 = call i32 (...) @getpid()
%12 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%.15s %s[%u]: \00"
define void @fprinttime(i32* nocapture %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call i8* @ctime(i32* %3)
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = call i32 (...) @getpid()
%9 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_func(void *p) {
  char *s = (char *)p;
  free(s);
}


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

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

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

LLVM IR (-O2):
define void @free_func(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};
struct wl_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_destroy(struct wl_resource *);
void shm_pool_destroy(struct wl_client *client, struct wl_resource *resource) {
  wl_resource_destroy(resource);
}


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

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

LLVM IR (-O0):
%struct.wl_client = type { i32 }
%struct.wl_resource = type { i32 }
define void @shm_pool_destroy(%struct.wl_client* %0, %struct.wl_resource* %1) {
%3 = alloca %struct.wl_client*
%4 = alloca %struct.wl_resource*
store %struct.wl_client* %0, %struct.wl_client** %3
store %struct.wl_resource* %1, %struct.wl_resource** %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %4
%6 = call i32 @wl_resource_destroy(%struct.wl_resource* %5)
ret void
}

LLVM IR (-O2):
%struct.wl_client = type { i32 }
%struct.wl_resource = type { i32 }
define void @shm_pool_destroy(%struct.wl_client* nocapture readnone %0, %struct.wl_resource* %1) {
%3 = tail call i32 @wl_resource_destroy(%struct.wl_resource* %1)
ret void
}
int *ckalloc(n)
register int n;
{
  register int *p;
  p = (int *)calloc(1, n);
  if (!p)
    fatal("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<ckalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <ckalloc+0x36>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckalloc>:
push   %rbx
movslq %edi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <ckalloc+0x24>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i32* @ckalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @calloc(i64 1, i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = bitcast i8* %3 to i32*
ret i32* %8
}
int test_imm_54uint8_reg(unsigned char val) {
  return ((val) & (0x54 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_54uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x54,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_54uint8_reg>:
test   $0x54,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_54uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 84
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ep_index(int /*<<< orphan*/, int);
int /*<<< orphan*/ usb_select_endpoint(int /*<<< orphan*/);
void usb_data_stage_enable(int dir) {
  usb_select_endpoint(ep_index(0, dir));
  (*(volatile unsigned char *)((0x24100000) + 0x28)) |= 4;
}


x86 assembly (clang, -O0):
<usb_data_stage_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <ep_index@plt>
mov    %eax,%edi
call   1040 <usb_select_endpoint@plt>
mov    $0x24100028,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x4,%eax
mov    %al,%cl
mov    $0x24100028,%eax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_data_stage_enable>:
push   %rax
mov    %edi,%esi
xor    %edi,%edi
call   1030 <ep_index@plt>
mov    %eax,%edi
call   1040 <usb_select_endpoint@plt>
orb    $0x4,0x24100028
04
pop    %rax
ret

LLVM IR (-O0):
define void @usb_data_stage_enable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ep_index(i32 0, i32 %3)
%5 = call i32 @usb_select_endpoint(i32 %4)
%6 = load volatile i8, i8* inttoptr (i64 605028392 to i8*)
%7 = zext i8 %6 to i32
%8 = or i32 %7, 4
%9 = trunc i32 %8 to i8
store volatile i8 %9, i8* inttoptr (i64 605028392 to i8*)
ret void
}

LLVM IR (-O2):
define void @usb_data_stage_enable(i32 %0) {
%2 = tail call i32 @ep_index(i32 0, i32 %0)
%3 = tail call i32 @usb_select_endpoint(i32 %2)
%4 = load volatile i8, i8* inttoptr (i64 605028392 to i8*)
%5 = or i8 %4, 4
store volatile i8 %5, i8* inttoptr (i64 605028392 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex16(int, unsigned short);
void print_warning_hex16(unsigned short value) { __console_tx_hex16(4, value); }


x86 assembly (clang, -O0):
<print_warning_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x4,%edi
movzwl -0x2(%rbp),%esi
call   1030 <__console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_warning_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__console_tx_hex16(i32 4, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_warning_hex16(i16 zeroext %0) {
%2 = tail call i32 @__console_tx_hex16(i32 4, i16 zeroext %0)
ret void
}
void ade7758_unconfigure_ring(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @ade7758_unconfigure_ring(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutInit(int *, char **);
int /*<<< orphan*/ glutMainLoop();
int /*<<< orphan*/ init();
int main(int argc, char **argv) {
  glutInit(&argc, argv);
  init();
  glutMainLoop();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1050 <glutInit@plt>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <glutMainLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <glutInit@plt>
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <glutMainLoop@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @glutInit(i32* %3, i8** %1)
%5 = call i32 (...) @init()
%6 = call i32 (...) @glutMainLoop()
ret i32 0
}
int main(void) { return -1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
/* Variables and functions */
int roadmap_square_find(int);
int /*<<< orphan*/ roadmap_tile_request(int, int, int, int /*<<< orphan*/ *);
void roadmap_square_request(int square, int priority, int force_update) {
  int slot = roadmap_square_find(square);
  if (slot < 0) {
    roadmap_tile_request(square, priority, force_update, NULL);
  }
}


x86 assembly (clang, -O0):
<roadmap_square_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <roadmap_square_find@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1158 <roadmap_square_request+0x38>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <roadmap_tile_request@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_square_request>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <roadmap_square_find@plt>
test   %eax,%eax
js     1139 <roadmap_square_request+0x19>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %ecx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <roadmap_tile_request@plt>

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

LLVM IR (-O2):
define void @roadmap_square_request(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @roadmap_square_find(i32 %0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @roadmap_tile_request(i32 %0, i32 %1, i32 %2, i32* null)
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ assert(int);
int fgetc(int /*<<< orphan*/ *);
unsigned char read_byte(FILE *file) {
  int byte = fgetc(file);
  assert(byte != EOF);
  return (unsigned char)byte;
}


x86 assembly (clang, -O0):
<read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_byte>:
push   %rbx
call   1030 <fgetc@plt>
mov    %eax,%ebx
mov    0x2eb9(%rip),%rax
xor    %edi,%edi
cmp    (%rax),%ebx
setne  %dil
call   1040 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define zeroext i8 @read_byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
@EOF = global i32 0
define zeroext i8 @read_byte(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = trunc i32 %2 to i8
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ pid;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ memcpy(char *, int *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int sqlite3OsRandomSeed(char *zBuf) {
  memset(zBuf, 0, 256);
  {
    int pid;
    time((time_t *)zBuf);
    pid = getpid();
    memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
  }
  return 0;
}


x86 assembly (clang, -O0):
<sqlite3OsRandomSeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1060 <time@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3OsRandomSeed>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1060 <time@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,0xc(%rsp)
add    $0x4,%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sqlite3OsRandomSeed(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = call i32 @time(i32* %7)
%9 = call i32 (...) @getpid()
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = call i32 @memcpy(i8* %11, i32* %3, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @sqlite3OsRandomSeed(i8* %0) {
%2 = alloca i32
%3 = tail call i32 @memset(i8* %0, i32 0, i32 256)
%4 = bitcast i32* %2 to i8*
%5 = bitcast i8* %0 to i32*
%6 = tail call i32 @time(i32* %5)
%7 = tail call i32 (...) @getpid()
store i32 %7, i32* %2
%8 = getelementptr inbounds i8, i8* %0, i64 4
%9 = call i32 @memcpy(i8* %8, i32* %2, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int abort2() { abort(); }


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

x86 assembly (clang, -O2):
<abort2>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @abort2() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @abort2() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Car_Get(int);
int Car_GetOverload(int /*<<< orphan*/);
int Car_GetCarOverload(int carnum) { return Car_GetOverload(Car_Get(carnum)); }


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

x86 assembly (clang, -O2):
<Car_GetCarOverload>:
push   %rax
call   1040 <Car_Get@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Car_GetOverload@plt>

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

LLVM IR (-O2):
define i32 @Car_GetCarOverload(i32 %0) {
%2 = tail call i32 @Car_Get(i32 %0)
%3 = tail call i32 @Car_GetOverload(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int write_int(int fd, int val) {
  char buf[32];
  sprintf(buf, "%d", val);
  return write(fd, buf, strlen(buf));
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xeb4(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%edx
mov    %edi,%ebp
lea    0xebf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @write_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @write(i32 %9, i8* %10, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @write_int(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @write(i32 %0, i8* %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ chk_err(char *);
void chkparam() {
  if ((4 != 2) && (4 != 4))
    chk_err("chkparam: Width parameter is illegal.");
  if ((4 == 2) && (0x04C11DB7L & 0xFFFF0000L))
    chk_err("chkparam: Poly parameter is too wide.");
  if ((0 != 0) && (0 != 1))
    chk_err("chkparam: Reverse parameter is not boolean.");
}


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

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

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

LLVM IR (-O2):
define void @chkparam() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void enqueue(int element, int rear, int limit, int queue[]) {
  if (rear >= limit)
    printf("queue is full \n");
  else
    queue[rear] = element;
}


x86 assembly (clang, -O0):
<enqueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1142 <enqueue+0x32>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    1150 <enqueue+0x40>
mov    -0x4(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enqueue>:
cmp    %edx,%esi
jge    111b <enqueue+0xb>
movslq %esi,%rax
mov    %edi,(%rcx,%rax,4)
ret
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"queue is full \0A\00"
define void @enqueue(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = icmp sge i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %20
14: ; preds = %4
%15 = load i32, i32* %5
%16 = load i32*, i32** %8
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"queue is full \00"
define void @enqueue(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = icmp slt i32 %1, %2
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %11
8: ; preds = %4
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %3, i64 %9
store i32 %0, i32* %10
br label %11
11: ; preds = %8, %6
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int numbtrop_quaddobl_clear(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(728, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_quaddobl_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2d8,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_quaddobl_clear>:
mov    $0x2d8,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @numbtrop_quaddobl_clear() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 728, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @numbtrop_quaddobl_clear() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 728, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
float atriangle(float b, float h) { return (0.5 * b * h); }


x86 assembly (clang, -O0):
<atriangle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atriangle>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @atriangle(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 = fpext float %5 to double
%7 = fmul double 5.000000e-01, %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fmul double %7, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @atriangle(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 5.000000e-01
%5 = fpext float %1 to double
%6 = fmul double %4, %5
%7 = fptrunc double %6 to float
ret float %7
}
void foo(int *p) {
  *p = 0;
  *((char *)p + 3) = 1;
  *((char *)p + 1) = 2;
  *((char *)p + 2) = *((char *)p + 38);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x1,0x3(%rax)
mov    -0x8(%rbp),%rax
movb   $0x2,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x26(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1000200,(%rdi)
mov    0x26(%rdi),%al
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 3
store i8 1, i8* %6
%7 = load i32*, i32** %2
%8 = bitcast i32* %7 to i8*
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 2, i8* %9
%10 = load i32*, i32** %2
%11 = bitcast i32* %10 to i8*
%12 = getelementptr inbounds i8, i8* %11, i64 38
%13 = load i8, i8* %12
%14 = load i32*, i32** %2
%15 = bitcast i32* %14 to i8*
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %13, i8* %16
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0) {
store i32 16777728, i32* %0
%2 = bitcast i32* %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 38
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %2, i64 2
store i8 %4, i8* %5
ret void
}
void __flush_cache(unsigned long dst, unsigned long size) {}


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

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

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

LLVM IR (-O2):
define void @__flush_cache(i64 %0, i64 %1) {
ret void
}
/* Type definitions */
typedef long long uint64_t;

/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ errno;
long long strtoll(char const *, int /*<<< orphan*/ *, int);
int value_to_int64(const char *val, uint64_t *result) {
  long long res = strtoll(val, NULL, 10);
  if (res == 0 && errno == EINVAL) {
    return 0;
  }
  *result = res;
  return 0;
}


x86 assembly (clang, -O0):
<value_to_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1167 <value_to_int64+0x57>
mov    0x2e98(%rip),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <value_to_int64+0x57>
movl   $0x0,-0x4(%rbp)
jmp    1179 <value_to_int64+0x69>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_to_int64>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
test   %rax,%rax
jne    113b <value_to_int64+0x2b>
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2ea2(%rip),%rdx
cmp    (%rdx),%rcx
je     113e <value_to_int64+0x2e>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINVAL = global i64 0
define i32 @value_to_int64(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @strtoll(i8* nocapture %0, i32* null, i32 10)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINVAL
%8 = icmp eq i64 %6, %7
br i1 %8, label %10, label %9
9: ; preds = %5, %2
store i64 %3, i64* %1
br label %10
10: ; preds = %5, %9
ret i32 0
}
char *parseinput(char *input) {
  int i = 0;
  while (input[i] != '\0') {
    if (input[i] == ' ') {
      input[i] = '\0';
    }
    i++;
  }
  return input;
}


x86 assembly (clang, -O0):
<parseinput>:
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     1153 <parseinput+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1145 <parseinput+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <parseinput+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseinput>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    1117 <parseinput+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x0,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x20,%dl
je     1110 <parseinput+0x10>
test   %dl,%dl
jne    1113 <parseinput+0x13>
ret

LLVM IR (-O0):
define i8* @parseinput(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %25, %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 %28
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 32
br i1 %19, label %20, label %25
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
br label %25
25: ; preds = %20, %12
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %4
28: ; preds = %4
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define i8* @parseinput(i8* returned %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 32, label %6
]
6: ; preds = %2
store i8 0, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *collection, int low, int high) {
  if (low < high) {
    int p = partition(collection, low, high);
    quick_sort(collection, low, p);
    quick_sort(collection, p + 1, high);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1171 <quick_sort+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1165 <quick_sort+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   1030 <partition@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <quick_sort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %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 @partition(i32* %0, i32 %6, i32 %2)
tail call void @quick_sort(i32* %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
}
/* Variables and functions */
int /*<<< orphan*/ w5100_writeSn_byte(unsigned int, int, unsigned int);
void w5100_writeSnDPORT(unsigned sock, unsigned data) {
  w5100_writeSn_byte(sock, 0x0010, data >> 8);
  w5100_writeSn_byte(sock, 0x0010 + 1, data & 0xFF);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
shr    $0x8,%edx
mov    $0x10,%esi
call   1030 <w5100_writeSn_byte@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    $0x11,%esi
call   1030 <w5100_writeSn_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edx
shr    $0x8,%edx
mov    $0x10,%esi
call   1030 <w5100_writeSn_byte@plt>
movzbl %bl,%edx
mov    %ebp,%edi
mov    $0x11,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <w5100_writeSn_byte@plt>

LLVM IR (-O0):
define void @w5100_writeSnDPORT(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 = lshr i32 %6, 8
%8 = call i32 @w5100_writeSn_byte(i32 %5, i32 16, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = call i32 @w5100_writeSn_byte(i32 %9, i32 17, i32 %11)
ret void
}

LLVM IR (-O2):
define void @w5100_writeSnDPORT(i32 %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 16, i32 %3)
%5 = and i32 %1, 255
%6 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 17, i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int deleteFile(char *fileName, char *dbPath) {
  char fullFilePath[100 + 20];
  sprintf(fullFilePath, "%s/%s", dbPath, fileName);
  if (remove(fullFilePath) == 0) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<deleteFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jne    1170 <deleteFile+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1177 <deleteFile+0x57>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteFile>:
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%rdx
mov    %rdi,%rcx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
neg    %rax
sbb    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define i32 @deleteFile(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [120 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [120 x i8], [120 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [120 x i8], [120 x i8]* %6, i64 0, i64 0
%12 = call i64 @remove(i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define i32 @deleteFile(i8* %0, i8* %1) {
%3 = alloca [120 x i8]
%4 = getelementptr inbounds [120 x i8], [120 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%6 = call i64 @remove(i8* %4)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
ret i32 %8
}
int support_fpu_underflow_control(int kind __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @support_fpu_underflow_control(i32 %0) {
ret i32 0
}
double lingot_signal_frequency_penalty(double freq) {
  static const double f0 = 100;
  static const double f1 = 1000;
  static const double alpha0 = 0.99;
  static const double alpha1 = 1;
  const double freqPenaltyA = (alpha0 - alpha1) / (f0 - f1);
  const double freqPenaltyB = -(alpha0 * f1 - f0 * alpha1) / (f0 - f1);
  return freq * freqPenaltyA + freqPenaltyB;
}


x86 assembly (clang, -O0):
<lingot_signal_frequency_penalty>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lingot_signal_frequency_penalty>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
@lingot_signal_frequency_penalty.f0 = internal constant double 1.000000e+02
@lingot_signal_frequency_penalty.f1 = internal constant double 1.000000e+03
@lingot_signal_frequency_penalty.alpha0 = internal constant double 0x3FEFAE147AE147AE
@lingot_signal_frequency_penalty.alpha1 = internal constant double 1.000000e+00
define double @lingot_signal_frequency_penalty(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x3EE74D3B7BA7582E, double* %3
store double 0x3FEFA4FA4FA4FA50, double* %4
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %5, double 0x3EE74D3B7BA7582E, double 0x3FEFA4FA4FA4FA50)
ret double %6
}

LLVM IR (-O2):
define double @lingot_signal_frequency_penalty(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x3EE74D3B7BA7582E, double 0x3FEFA4FA4FA4FA50)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigint() { printf("CHILD: SIGINT received\n"); }


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"CHILD: SIGINT received\00"
define void @sigint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}