xunge/DecIR huggingface dataset:
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_range(struct __test_metadata *);
void wrapper_close_range(struct __test_metadata *_metadata,
                         struct __fixture_variant_metadata *variant) {
  close_range(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_close_range>:
jmp    1030 <close_range@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @close_range(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @close_range(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_String();
int cstrcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  return cstrcmp(__VERIFIER_nondet_String(), __VERIFIER_nondet_String());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_String@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_String@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <cstrcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_String@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_String@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <cstrcmp@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @__VERIFIER_nondet_String()
%3 = call i32 (...) @__VERIFIER_nondet_String()
%4 = call i32 @cstrcmp(i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_String()
%2 = tail call i32 (...) @__VERIFIER_nondet_String()
%3 = tail call i32 @cstrcmp(i32 %1, i32 %2)
ret i32 %3
}
struct fd_state *to_fd(void *fd) {
  return (struct fd_state *)fd;
}


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

x86 assembly (clang, -O2):
<to_fd>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.fd_state = type opaque
define %struct.fd_state* @to_fd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.fd_state*
ret %struct.fd_state* %4
}

LLVM IR (-O2):
%struct.fd_state = type opaque
define %struct.fd_state* @to_fd(i8* readnone %0) {
%2 = bitcast i8* %0 to %struct.fd_state*
ret %struct.fd_state* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void viewStrings(char datastorage[][128], int length) {
  int i;
  for (i = 0; i < length; ++i) {
    printf("\nString[%d] = %s", i, datastorage[i]);
  }
}


x86 assembly (clang, -O0):
<viewStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <viewStrings+0x4e>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
movslq -0x10(%rbp),%rax
shl    $0x7,%rax
add    %rax,%rdx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <viewStrings+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewStrings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    114a <viewStrings+0x3a>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x1,%rbx
sub    $0xffffffffffffff80,%r14
cmp    %rbx,%r12
jne    1130 <viewStrings+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"\0AString[%d] = %s\00"
define void @viewStrings([128 x i8]* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %0, i64 %7, i64 0
%9 = trunc i64 %7 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %8)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
struct _mgmt_adduser_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _mgmt_adduser_rsp *);
void mgmt_adduser_rsp_free(struct _mgmt_adduser_rsp *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<mgmt_adduser_rsp_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._mgmt_adduser_rsp = type { i32 }
define void @mgmt_adduser_rsp_free(%struct._mgmt_adduser_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._mgmt_adduser_rsp* %0)
ret void
}
/* Variables and functions */
int get_minutes_since_midnight(int, int);
int /*<<< orphan*/ parse_time(char const *, int *, int *);
int parse_time_as_minutes_since_midnight(const char formatted_time[]) {
  int hours, minutes;
  parse_time(formatted_time, &hours, &minutes);
  return get_minutes_since_midnight(hours, minutes);
}


x86 assembly (clang, -O0):
<parse_time_as_minutes_since_midnight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <parse_time@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <get_minutes_since_midnight@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_time_as_minutes_since_midnight>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <parse_time@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <get_minutes_since_midnight@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @parse_time_as_minutes_since_midnight(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @parse_time(i8* %0, i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @get_minutes_since_midnight(i32 %7, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ sio_puts(char *);
void sio_error(char s[]) {
  sio_puts(s);
  _exit(1);
}


x86 assembly (clang, -O0):
<sio_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sio_puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sio_error>:
push   %rax
call   1040 <sio_puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @sio_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sio_puts(i8* %3)
%5 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sio_error(i8* %0) {
%2 = tail call i32 @sio_puts(i8* %0)
%3 = tail call i32 @_exit(i32 1)
unreachable
}
int str9100_set_ringparam(struct net_device *netdev,
                          struct ethtool_ringparam *ring) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.net_device = type opaque
%struct.ethtool_ringparam = type opaque
define i32 @str9100_set_ringparam(%struct.net_device* %0, %struct.ethtool_ringparam* %1) {
%3 = alloca %struct.net_device*
%4 = alloca %struct.ethtool_ringparam*
store %struct.net_device* %0, %struct.net_device** %3
store %struct.ethtool_ringparam* %1, %struct.ethtool_ringparam** %4
ret i32 0
}

LLVM IR (-O2):
%struct.net_device = type opaque
%struct.ethtool_ringparam = type opaque
define i32 @str9100_set_ringparam(%struct.net_device* nocapture readnone %0, %struct.ethtool_ringparam* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
__attribute__((always_)) long _zmillisecond(void) {
  long r;
  struct timeval tv;
  gettimeofday(&tv, 0);
  r = tv.tv_sec * 1000 + tv.tv_usec / 1000;
  return r;
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @_zmillisecond() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ timeout;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVTIMEO;
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int setnonblock(int sock) {
  struct timeval timeout;
  timeout.tv_sec = 10;
  timeout.tv_usec = 0;
  if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,
                 sizeof(timeout)))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<setnonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0xa,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
je     1164 <setnonblock+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116b <setnonblock+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblock>:
sub    $0x18,%rsp
movl   $0xa,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @setnonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 10, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i64 0, i64* %6
%7 = load i32, i32* %3
%8 = load i32, i32* @SOL_SOCKET
%9 = load i32, i32* @SO_RCVTIMEO
%10 = bitcast %struct.timeval* %4 to i8*
%11 = call i64 @setsockopt(i32 %7, i32 %8, i32 %9, i8* %10, i32 16)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %2
br label %15
14: ; preds = %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @setnonblock(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 10, i32* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVTIMEO
%8 = call i64 @setsockopt(i32 %0, i32 %6, i32 %7, i8* %3, i32 16)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ latch_output(unsigned long, int, int);
int /*<<< orphan*/ log_close();
int /*<<< orphan*/ log_open_for_writing(unsigned long);
void write_test(void) {
  unsigned long now = 0x12345;
  log_open_for_writing(now);
  now += 50;
  latch_output(now, ((0x3FFE) - 0x3FB0), 0x00);
  now += 10;
  latch_output(now, ((0x3FFF) - 0x3FB0), 0x00);
  log_close();
}


x86 assembly (clang, -O0):
<write_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x12345,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <log_open_for_writing@plt>
mov    -0x8(%rbp),%rax
add    $0x32,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4e,%esi
xor    %edx,%edx
call   1050 <latch_output@plt>
mov    -0x8(%rbp),%rax
add    $0xa,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4f,%esi
xor    %edx,%edx
call   1050 <latch_output@plt>
mov    $0x0,%al
call   1040 <log_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_test>:
push   %rax
mov    $0x12345,%edi
call   1030 <log_open_for_writing@plt>
mov    $0x12377,%edi
mov    $0x4e,%esi
xor    %edx,%edx
call   1050 <latch_output@plt>
mov    $0x12381,%edi
mov    $0x4f,%esi
xor    %edx,%edx
call   1050 <latch_output@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <log_close@plt>

LLVM IR (-O0):
define void @write_test() {
%1 = alloca i64
store i64 74565, i64* %1
%2 = load i64, i64* %1
%3 = call i32 @log_open_for_writing(i64 %2)
%4 = load i64, i64* %1
%5 = add i64 %4, 50
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = call i32 @latch_output(i64 %6, i32 78, i32 0)
%8 = load i64, i64* %1
%9 = add i64 %8, 10
store i64 %9, i64* %1
%10 = load i64, i64* %1
%11 = call i32 @latch_output(i64 %10, i32 79, i32 0)
%12 = call i32 (...) @log_close()
ret void
}

LLVM IR (-O2):
define void @write_test() {
%1 = tail call i32 @log_open_for_writing(i64 74565)
%2 = tail call i32 @latch_output(i64 74615, i32 78, i32 0)
%3 = tail call i32 @latch_output(i64 74625, i32 79, i32 0)
%4 = tail call i32 (...) @log_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy(int src[4], int target[4]) { memcpy(target, src, sizeof(int) * 4); }


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

x86 assembly (clang, -O2):
<copy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32*, i32** %3
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 16)
ret void
}

LLVM IR (-O2):
define void @copy(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %1, i32* %0, i32 16)
ret void
}
unsigned long long pow_fun_ullong(unsigned long long a, unsigned long long b) {
  unsigned long long r = 1;
  int i;
  for (i = 0; i < b; ++i)
    r *= a;
  return r;
}


x86 assembly (clang, -O0):
<pow_fun_ullong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1144 <pow_fun_ullong+0x44>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <pow_fun_ullong+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_fun_ullong>:
test   %rsi,%rsi
je     111b <pow_fun_ullong+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <pow_fun_ullong+0x21>
mov    $0x1,%eax
jmp    1156 <pow_fun_ullong+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <pow_fun_ullong+0x30>
test   %rcx,%rcx
je     116a <pow_fun_ullong+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <pow_fun_ullong+0x60>
ret

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

LLVM IR (-O2):
define i64 @pow_fun_ullong(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul i64 %11, %0
%14 = mul i64 %13, %0
%15 = mul i64 %14, %0
%16 = mul i64 %15, %0
%17 = mul i64 %16, %0
%18 = mul i64 %17, %0
%19 = mul i64 %18, %0
%20 = mul i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ logIT(int /*<<< orphan*/, char *, char *);
void sigPipeHandler(int signo) { logIT(LOG_ERR, "%s", "SIGPIPE empfangen"); }


x86 assembly (clang, -O0):
<sigPipeHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
lea    0xed1(%rip),%rdx
call   1030 <logIT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigPipeHandler>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xedc(%rip),%rdx
jmp    1030 <logIT@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"SIGPIPE empfangen\00"
define void @sigPipeHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_ERR
%4 = call i32 @logIT(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [18 x i8] c"SIGPIPE empfangen\00"
define void @sigPipeHandler(i32 %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @logIT(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(const void *s1, const void *s2) {
  return strcmp(*(char **)s1, *(char **)s2);
}


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

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

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *strncpyz(char *dest, const char *source, int maxlen) {
  strncpy(dest, source, maxlen);
  dest[maxlen - 1] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strncpyz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpyz>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strncpyz(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @strncpyz(i8* returned %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%5 = add nsw i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void _usage() {
  printf("ftile v%s\n\n", "1.00");
  printf("Usage:  ftile <input_raw8x8_tile_file>\n"
         "Written by Jason Andersen\n"
         "Copyright (c) 2019 Jason Andersen.\n"
         "Unauthorized use prohibited\n");
  exit(1);
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_usage>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"ftile v%s\0A\0A\00"
@.str.1 = [5 x i8] c"1.00\00"
@.str.2 = [129 x i8] c"Usage: ftile <input_raw8x8_tile_file>\0AWritten by Jason Andersen\0ACopyright (c) 2019 Jason Andersen.\0AUnauthorized use prohibited\0A\00"
define void @_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"ftile v%s\0A\0A\00"
@.str.1 = [5 x i8] c"1.00\00"
@str = [128 x i8] c"Usage: ftile <input_raw8x8_tile_file>\0AWritten by Jason Andersen\0ACopyright (c) 2019 Jason Andersen.\0AUnauthorized use prohibited\00"
define void @_usage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glLighti(unsigned int, unsigned int, int);
void Lighti(unsigned int l, unsigned int p, int v) { glLighti(l, p, v); }


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

x86 assembly (clang, -O2):
<Lighti>:
jmp    1030 <glLighti@plt>

LLVM IR (-O0):
define void @Lighti(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @glLighti(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @Lighti(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glLighti(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
long strtol(char const *, char **, int);
long atol(const char *nptr) { return strtol(nptr, (char **)NULL, 10); }


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8** null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ jump_to(int /*<<< orphan*/);
int /*<<< orphan*/ popint();
int cb_ret() {
  jump_to(popint());
  return 0;
}


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

x86 assembly (clang, -O2):
<cb_ret>:
push   %rax
xor    %eax,%eax
call   1030 <popint@plt>
mov    %eax,%edi
call   1040 <jump_to@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cb_ret() {
%1 = call i32 (...) @popint()
%2 = call i32 @jump_to(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @cb_ret() {
%1 = tail call i32 (...) @popint()
%2 = tail call i32 @jump_to(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int numbers(int x) {
  int i;
  for (i = 1; i <= x; i++)
    printf("%d\t", i);
}


x86 assembly (clang, -O0):
<numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114b <numbers+0x3b>
mov    -0xc(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <numbers+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbers>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114d <numbers+0x3d>
mov    %edi,%r15d
neg    %r15d
mov    $0x1,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <numbers+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define i32 @numbers(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 undef
}
int take_b(char cc) {
  printf("%s -- start\n", __func__);
  printf("%s -- end\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<take_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<take_b>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.take_b = [7 x i8] c"take_b\00"
@.str.1 = [11 x i8] c"%s -- end\0A\00"
define i32 @take_b(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_b, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_b, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.take_b = [7 x i8] c"take_b\00"
@.str.1 = [11 x i8] c"%s -- end\0A\00"
define i32 @take_b(i8 signext %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_b, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_b, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int is_consonant_not_r(char c) { return (strchr("bcdfgjklmnpstvxz", c) != 0); }


x86 assembly (clang, -O0):
<is_consonant_not_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_consonant_not_r>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"bcdfgjklmnpstvxz\00"
define i32 @is_consonant_not_r(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"bcdfgjklmnpstvxz\00"
define i32 @is_consonant_not_r(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("hello world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ defmac(char *);
void initmac(void) {
  defmac("MC6801\t1");
  defmac("smallc\t1");
}


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

x86 assembly (clang, -O2):
<initmac>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <defmac@plt>
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <defmac@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"MC6801\091\00"
@.str.1 = [9 x i8] c"smallc\091\00"
define void @initmac() {
%1 = call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"MC6801\091\00"
@.str.1 = [9 x i8] c"smallc\091\00"
define void @initmac() {
%1 = tail call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int getCustomCount(int argc) {
  int result = 0;
  if (argc > 0) {
    result = argc - 1;
  } else if (argc == 0) {
    result = 0;
  } else {
    abort();
  }
  return result;
}


x86 assembly (clang, -O0):
<getCustomCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113a <getCustomCount+0x2a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <getCustomCount+0x4c>
cmpl   $0x0,-0x4(%rbp)
jne    1150 <getCustomCount+0x40>
movl   $0x0,-0x8(%rbp)
jmp    1157 <getCustomCount+0x47>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    115c <getCustomCount+0x4c>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCustomCount>:
test   %edi,%edi
jle    111a <getCustomCount+0xa>
add    $0xffffffff,%edi
mov    %edi,%eax
ret
xor    %eax,%eax
test   %edi,%edi
jne    1121 <getCustomCount+0x11>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @getCustomCount(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %3
br label %16
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %3
br label %15
13: ; preds = %9
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %12
br label %16
16: ; preds = %15, %6
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @getCustomCount(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %9
5: ; preds = %1
%6 = icmp eq i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %5, %3
%10 = phi i32 [ %4, %3 ], [ 0, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
char *normalize_pathat(int /*<<< orphan*/, char const *);
char *normalize_path(const char *src) {
  return normalize_pathat(AT_FDCWD, src);
}


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

x86 assembly (clang, -O2):
<normalize_path>:
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
jmp    1030 <normalize_pathat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i8* @normalize_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @AT_FDCWD
%4 = load i8*, i8** %2
%5 = call i8* @normalize_pathat(i32 %3, i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i8* @normalize_path(i8* %0) {
%2 = load i32, i32* @AT_FDCWD
%3 = tail call i8* @normalize_pathat(i32 %2, i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, int);
void memRead(char **pPt, void *buf, int size) {
  memcpy(buf, *pPt, size);
  *pPt += size;
}


x86 assembly (clang, -O0):
<memRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memRead>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rax
mov    %rdi,%rbx
mov    (%rdi),%rsi
mov    %rax,%rdi
call   1030 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @memRead(i8** nocapture %0, i8* %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %2)
%6 = load i8*, i8** %0
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
char **readNexusTrees(char const *, int *, char *, int);
char **readNexusRangeTree(const char *infile, int *count, char *range) {
  return readNexusTrees(infile, count, ",", 100000000);
}


x86 assembly (clang, -O0):
<readNexusRangeTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xecd(%rip),%rdx
mov    $0x5f5e100,%ecx
call   1030 <readNexusTrees@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readNexusRangeTree>:
lea    0xee9(%rip),%rdx
mov    $0x5f5e100,%ecx
jmp    1030 <readNexusTrees@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define i8** @readNexusRangeTree(i8* %0, i32* %1, i8* nocapture readnone %2) {
%4 = tail call i8** @readNexusTrees(i8* %0, i32* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 100000000)
ret i8** %4
}
void gdk_draw_rectangle() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_rectangle() {
ret void
}
int int_max(int a, int b) {
  if (a >= b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<int_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <int_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <int_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void copia(void) {
  int i, con;
  extern char linea[], linea_max[];
  i = 0;
  con = 1;
  while (con) {
    linea_max[i] = linea[i];
    if (linea_max[i] == '\0')
      con = 0;
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1165 <copia+0x65>
movslq -0x4(%rbp),%rcx
mov    0x2ec9(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2ea3(%rip),%rax
mov    %dl,(%rax,%rcx,1)
movslq -0x4(%rbp),%rcx
mov    0x2e95(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1157 <copia+0x57>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <copia+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
xor    %eax,%eax
mov    0x2ee7(%rip),%rsi
mov    0x2ec8(%rip),%rdx
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdx,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copia+0x10>
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %21, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %12
store i8 %10, i8* %13
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 0, i32* %2
br label %21
21: ; preds = %20, %6
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %3
24: ; preds = %3
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %7, %1 ]
%3 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %2
store i8 %4, i8* %5
%6 = icmp eq i8 %4, 0
%7 = add nuw i64 %2, 1
br i1 %6, label %8, label %1
8: ; preds = %1
ret void
}