xunge/DecIR huggingface dataset:
/* Variables and functions */
int putchar(int);
int c_putchar(int arg0) { return putchar(arg0); }


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

x86 assembly (clang, -O2):
<c_putchar>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @c_putchar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 %2
}
/* Type definitions */
struct ndm_ip_sockaddr_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ AF_INET6;
scalar_t__ ndm_ip_sockaddr_family(struct ndm_ip_sockaddr_t const *const);
bool ndm_ip_sockaddr_is_v6(const struct ndm_ip_sockaddr_t *const sa) {
  return (ndm_ip_sockaddr_family(sa) == AF_INET6) ? true : false;
}


x86 assembly (clang, -O0):
<ndm_ip_sockaddr_is_v6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ndm_ip_sockaddr_family@plt>
mov    %rax,%rdx
mov    0x2eb9(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_ip_sockaddr_is_v6>:
push   %rax
call   1030 <ndm_ip_sockaddr_family@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ndm_ip_sockaddr_t = type { i32 }
@AF_INET6 = global i64 0
define i32 @ndm_ip_sockaddr_is_v6(%struct.ndm_ip_sockaddr_t* %0) {
%2 = alloca %struct.ndm_ip_sockaddr_t*
store %struct.ndm_ip_sockaddr_t* %0, %struct.ndm_ip_sockaddr_t** %2
%3 = load %struct.ndm_ip_sockaddr_t*, %struct.ndm_ip_sockaddr_t** %2
%4 = call i64 @ndm_ip_sockaddr_family(%struct.ndm_ip_sockaddr_t* %3)
%5 = load i64, i64* @AF_INET6
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
%struct.ndm_ip_sockaddr_t = type { i32 }
@AF_INET6 = global i64 0
define i32 @ndm_ip_sockaddr_is_v6(%struct.ndm_ip_sockaddr_t* %0) {
%2 = tail call i64 @ndm_ip_sockaddr_family(%struct.ndm_ip_sockaddr_t* %0)
%3 = load i64, i64* @AF_INET6
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int parseISO8601Duration(char *);
int /*<<< orphan*/ printf(char *, int);
void test_parseISO8601Duration() {
  printf("parseISO8601Duration: PT240S=%d\n", parseISO8601Duration("PT240S"));
  printf("parseISO8601Duration: PT6M=%d\n", parseISO8601Duration("PT6M"));
}


x86 assembly (clang, -O0):
<test_parseISO8601Duration>:
push   %rbp
mov    %rsp,%rbp
lea    0xef6(%rip),%rdi
call   1040 <parseISO8601Duration@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
call   1040 <parseISO8601Duration@plt>
mov    %eax,%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_parseISO8601Duration>:
push   %rax
lea    0xef9(%rip),%rdi
call   1040 <parseISO8601Duration@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
call   1040 <parseISO8601Duration@plt>
lea    0xeda(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"parseISO8601Duration: PT240S=%d\0A\00"
@.str.1 = [7 x i8] c"PT240S\00"
@.str.2 = [31 x i8] c"parseISO8601Duration: PT6M=%d\0A\00"
@.str.3 = [5 x i8] c"PT6M\00"
define void @test_parseISO8601Duration() {
%1 = call i32 @parseISO8601Duration(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @parseISO8601Duration(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"parseISO8601Duration: PT240S=%d\0A\00"
@.str.1 = [7 x i8] c"PT240S\00"
@.str.2 = [31 x i8] c"parseISO8601Duration: PT6M=%d\0A\00"
@.str.3 = [5 x i8] c"PT6M\00"
define void @test_parseISO8601Duration() {
%1 = tail call i32 @parseISO8601Duration(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @parseISO8601Duration(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void uint32_to_b4_BE(uint32_t data, uint8_t *b) {
  b[0] = (data >> 24) & 0xFF;
  b[1] = (data >> 16) & 0xFF;
  b[2] = (data >> 8) & 0xFF;
  b[3] = data & 0xFF;
}


x86 assembly (clang, -O0):
<uint32_to_b4_BE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_to_b4_BE>:
mov    %edi,%eax
mov    %edi,%ecx
movzbl %ah,%edx
movzbl %al,%edi
shr    $0x18,%eax
mov    %eax,(%rsi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rsi)
mov    %edx,0x8(%rsi)
mov    %edi,0xc(%rsi)
ret

LLVM IR (-O0):
define void @uint32_to_b4_BE(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 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %3
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %3
%21 = and i32 %20, 255
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @uint32_to_b4_BE(i32 %0, i32* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
store i32 %3, i32* %1
%4 = lshr i32 %0, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %8, i32* %9
%10 = and i32 %0, 255
%11 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int __access(char const *, int);
int __euidaccess(const char *file, int type) { return __access(file, type); }


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

x86 assembly (clang, -O2):
<__euidaccess>:
jmp    1030 <__access@plt>

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

LLVM IR (-O2):
define i32 @__euidaccess(i8* %0, i32 %1) {
%3 = tail call i32 @__access(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x3_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x3_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x3_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x3_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x3_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
double EvalAngCor_alpha1_3minus_2plus_15097_L5(double);
double funcAngCor_alpha1_3minus_2plus_15097_L5(double *x, double *par) {
  double result;
  result = par[0] * EvalAngCor_alpha1_3minus_2plus_15097_L5(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngCor_alpha1_3minus_2plus_15097_L5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngCor_alpha1_3minus_2plus_15097_L5@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngCor_alpha1_3minus_2plus_15097_L5>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngCor_alpha1_3minus_2plus_15097_L5@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngCor_alpha1_3minus_2plus_15097_L5(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngCor_alpha1_3minus_2plus_15097_L5(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngCor_alpha1_3minus_2plus_15097_L5(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngCor_alpha1_3minus_2plus_15097_L5(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int streamaccept(int);
int unixaccept(int lsock) { return streamaccept(lsock); }


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

x86 assembly (clang, -O2):
<unixaccept>:
jmp    1030 <streamaccept@plt>

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

LLVM IR (-O2):
define i32 @unixaccept(i32 %0) {
%2 = tail call i32 @streamaccept(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This test requires MSA extension.\n");
  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)
lea    0xed3(%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 = [35 x i8] c"This test requires MSA extension.\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"This test requires MSA extension.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __enable_irq();
unsigned int __get_PRIMASK();
__attribute__((always_)) __attribute__((used)) unsigned int irq_enable(void) {
  unsigned result = __get_PRIMASK();
  __enable_irq();
  return result;
}


x86 assembly (clang, -O0):
<irq_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__get_PRIMASK@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__enable_irq@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_enable>:
push   %rbx
xor    %eax,%eax
call   1030 <__get_PRIMASK@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__enable_irq@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @irq_enable to i8*)], section "llvm.metadata"
define i32 @irq_enable() {
%1 = alloca i32
%2 = call i32 (...) @__get_PRIMASK()
store i32 %2, i32* %1
%3 = call i32 (...) @__enable_irq()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @irq_enable to i8*)], section "llvm.metadata"
define i32 @irq_enable() {
%1 = tail call i32 (...) @__get_PRIMASK()
%2 = tail call i32 (...) @__enable_irq()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_devoice(char *channel, char *nick) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s -v %s", "MODE", channel, nick);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_devoice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb7(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_devoice>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %s -v %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_devoice(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, 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), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s %s -v %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_devoice(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, 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), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
/* Variables and functions */
char getnibble(char);
int gethex(char echo) {
  int ret = 0;
  char c;
  while ((c = getnibble(echo)) != -1)
    ret = (ret << 4) | c;
  return ret;
}


x86 assembly (clang, -O0):
<gethex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <getnibble@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     1151 <gethex+0x41>
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
movsbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <gethex+0x15>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethex>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <getnibble@plt>
xor    %ebx,%ebx
cmp    $0xff,%al
je     1143 <gethex+0x33>
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%eax
shl    $0x4,%ebx
or     %eax,%ebx
mov    %ebp,%edi
call   1030 <getnibble@plt>
cmp    $0xff,%al
jne    1130 <gethex+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gethex(i8 signext %0) {
%2 = tail call signext i8 @getnibble(i8 signext %0)
%3 = icmp eq i8 %2, -1
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = sext i8 %5 to i32
%8 = shl i32 %6, 4
%9 = or i32 %8, %7
%10 = tail call signext i8 @getnibble(i8 signext %0)
%11 = icmp eq i8 %10, -1
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_is_corked() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_is_corked"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_stream_is_corked\00"
define i32 @pa_stream_is_corked() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int vde_chain_nm5_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm5_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <vde_chain_nm5_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm5_alloc>:
test   %rdi,%rdi
je     110c <vde_chain_nm5_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm5_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
int do_911() { return 911; }


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

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

LLVM IR (-O0):
define i32 @do_911() {
ret i32 911
}

LLVM IR (-O2):
define i32 @do_911() {
ret i32 911
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main(void) {
  int i;
  printf("TASK2: executing...\n");
  i = 0;
  while (1) {
    printf("TASK2: %d\n", i);
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [21 x i8] c"TASK2: executing...\0A\00"
@.str.1 = [11 x i8] c"TASK2: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %3
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"TASK2: %d\0A\00"
@str = [20 x i8] c"TASK2: executing...\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
br label %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg4setBank7(int);
void m31setParams5007(uint16_t addr, uint8_t val) {
  (void)addr;
  prg4setBank7(val << 12);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xc,%edi
jmp    1030 <prg4setBank7@plt>

LLVM IR (-O0):
define void @m31setParams5007(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 = shl i32 %6, 12
%8 = call i32 @prg4setBank7(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m31setParams5007(i32 %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = tail call i32 @prg4setBank7(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char const *, size_t);
char *strncpy(char *dest, const char *str, size_t n) {
  *dest = '\0';
  strncat(dest, str, n);
  return dest;
}


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

x86 assembly (clang, -O2):
<strncpy>:
push   %rbx
mov    %rdi,%rbx
movb   $0x0,(%rdi)
call   1030 <strncat@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
store i8 0, i8* %7
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @strncat(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define i8* @strncpy(i8* returned %0, i8* %1, i64 %2) {
store i8 0, i8* %0
%4 = tail call i32 @strncat(i8* %0, i8* %1, i64 %2)
ret i8* %0
}
/* Type definitions */
struct header {
  int dummy;
};

/* Variables and functions */
struct header **tests_memory_find(void *);
int tests_memory_valid(void *ptr) {
  struct header **tmp;
  {
    tmp = tests_memory_find(ptr);
    return ((unsigned long)tmp != (unsigned long)((void *)0));
  }
}


x86 assembly (clang, -O0):
<tests_memory_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tests_memory_find@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests_memory_valid>:
push   %rax
call   1030 <tests_memory_find@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.header = type { i32 }
define i32 @tests_memory_valid(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.header**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.header** @tests_memory_find(i8* %4)
store %struct.header** %5, %struct.header*** %3
%6 = load %struct.header**, %struct.header*** %3
%7 = ptrtoint %struct.header** %6 to i64
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.header = type { i32 }
define i32 @tests_memory_valid(i8* %0) {
%2 = tail call %struct.header** @tests_memory_find(i8* %0)
%3 = icmp ne %struct.header** %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
int bics_si_test2(int a, int b, int c) {
  if ((a & b) == b)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<bics_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1127 <bics_si_test2+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <bics_si_test2+0x2d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test2>:
mov    %edx,%eax
not    %edi
test   %edi,%esi
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bics_si_test2(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = icmp eq i32 %4, %1
%6 = select i1 %5, i32 %1, i32 %2
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ time_t;
typedef int suseconds_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ utime_get_seconds(int /*<<< orphan*/);
scalar_t__ utime_get_useconds(int /*<<< orphan*/);
void utime_to_timespec(int64_t v, struct timespec *ts) {
  ts->tv_sec = (time_t)utime_get_seconds(v);
  ts->tv_nsec = (suseconds_t)utime_get_useconds(v) * 1000;
}


x86 assembly (clang, -O0):
<utime_to_timespec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <utime_get_seconds@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x4(%rbp),%edi
call   1030 <utime_get_useconds@plt>
imul   $0x3e8,%eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime_to_timespec>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <utime_get_seconds@plt>
mov    %rax,0x8(%rbx)
mov    %ebp,%edi
call   1030 <utime_get_useconds@plt>
imul   $0x3e8,%eax,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @utime_to_timespec(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = call i64 @utime_get_seconds(i32 %5)
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i64 %6, i64* %8
%9 = load i32, i32* %3
%10 = call i64 @utime_get_useconds(i32 %9)
%11 = trunc i64 %10 to i32
%12 = mul nsw i32 %11, 1000
%13 = load %struct.timespec*, %struct.timespec** %4
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @utime_to_timespec(i32 %0, %struct.timespec* nocapture writeonly %1) {
%3 = tail call i64 @utime_get_seconds(i32 %0)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 %3, i64* %4
%5 = tail call i64 @utime_get_useconds(i32 %0)
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
scalar_t__ has_suffix(char const *, char const *);
int has_suffix_succeeded(const char *str, const char *suffix) {
  if (has_suffix(str, suffix))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<has_suffix_succeeded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <has_suffix@plt>
cmp    $0x0,%rax
je     1143 <has_suffix_succeeded+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114a <has_suffix_succeeded+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_suffix_succeeded>:
push   %rax
call   1030 <has_suffix@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @has_suffix_succeeded(i8* %0, i8* %1) {
%3 = tail call i64 @has_suffix(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((no)) void func_0(void) {}


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

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

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

LLVM IR (-O2):
define void @func_0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/ikdekker/stage/refs/heads/master/lib/"
             "cpputest-3.8/.libs/lt-CppUTestTests.c",
             314, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x13a,%esi
lea    0xf4e(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf69(%rip),%rdx
mov    $0x13a,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ikdekker/stage/refs/heads/master/lib/cpputest-3.8/.libs/lt-CppUTestTests.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i32 314, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ikdekker/stage/refs/heads/master/lib/cpputest-3.8/.libs/lt-CppUTestTests.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i32 314, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char const);
void printdata(void *d, const char *data, int l) {
  int i;
  printf("data : ");
  for (i = 0; i < l; i++)
    putchar(data[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<printdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1171 <printdata+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <printdata+0x26>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printdata>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
test   %ebp,%ebp
jle    1153 <printdata+0x33>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   (%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <printdata+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"data : \00"
define void @printdata(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @putchar(i8 signext %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %3
%16 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char next_c(int /*<<< orphan*/ *);
int /*<<< orphan*/ report_error(char const *);
void consume_next_c_on_match_or_err(FILE *scene_file, char c, const char *err) {
  ((void)0);
  if (c == next_c(scene_file))
    return;
  else {
    report_error(err);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<consume_next_c_on_match_or_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <next_c@plt>
mov    %al,%cl
mov    -0x1c(%rbp),%eax
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    116c <consume_next_c_on_match_or_err+0x3c>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x18(%rbp),%rdi
call   1040 <report_error@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<consume_next_c_on_match_or_err>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <next_c@plt>
cmp    %bpl,%al
jne    1149 <consume_next_c_on_match_or_err+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1040 <report_error@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @consume_next_c_on_match_or_err(i32* %0, i8 signext %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i8*
store i32* %0, i32** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = load i32*, i32** %4
%10 = call signext i8 @next_c(i32* %9)
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %3
ret void
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = call i32 @report_error(i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @consume_next_c_on_match_or_err(i32* %0, i8 signext %1, i8* %2) {
%4 = tail call signext i8 @next_c(i32* %0)
%5 = icmp eq i8 %4, %1
br i1 %5, label %6, label %7
6: ; preds = %3
ret void
7: ; preds = %3
%8 = tail call i32 @report_error(i8* %2)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int write_verify_test_files(int, int *);
int verify_test_files(int *total_sim_minutes) {
  return write_verify_test_files(1, total_sim_minutes);
}


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

x86 assembly (clang, -O2):
<verify_test_files>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <write_verify_test_files@plt>

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

LLVM IR (-O2):
define i32 @verify_test_files(i32* %0) {
%2 = tail call i32 @write_verify_test_files(i32 1, i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char *argv[]) {
  printf("%c\n", 'a' + 1);
  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)
lea    0xed3(%rip),%rdi
mov    $0x62,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 98)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 98)
ret i32 0
}
/* Type definitions */
struct msscene {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clip_polyhedra(struct msscene *);
void do_clipping(struct msscene *ms) { clip_polyhedra(ms); }


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

x86 assembly (clang, -O2):
<do_clipping>:
jmp    1030 <clip_polyhedra@plt>

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

LLVM IR (-O2):
%struct.msscene = type { i32 }
define void @do_clipping(%struct.msscene* %0) {
%2 = tail call i32 @clip_polyhedra(%struct.msscene* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_die(char *, char *, int);
int main(int argc, char **argv) {
  OPENSSL_die("Voluntary abort",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/GaloisInc/hacrypto/refs/heads/master/"
              "Source/Platform/Target/Android/core/src/main/jni/openssl-1.1.0c/"
              "test/aborttest.c",
              14);
  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)
lea    0xed3(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0xe,%edx
call   1030 <OPENSSL_die@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0xe,%edx
call   1030 <OPENSSL_die@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Voluntary abort\00"
@.str.1 = [208 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GaloisInc/hacrypto/refs/heads/master/Source/Platform/Target/Android/core/src/main/jni/openssl-1.1.0c/test/aborttest.c\00"
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 = call i32 @OPENSSL_die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str.1, i64 0, i64 0), i32 14)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Voluntary abort\00"
@.str.1 = [208 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GaloisInc/hacrypto/refs/heads/master/Source/Platform/Target/Android/core/src/main/jni/openssl-1.1.0c/test/aborttest.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @OPENSSL_die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str.1, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
void Default_KMU_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_KMU_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_KMU_IRQHandler+0x9>
jmp    1109 <Default_KMU_IRQHandler+0x9>

x86 assembly (clang, -O2):
<Default_KMU_IRQHandler>:
jmp    1100 <Default_KMU_IRQHandler>

LLVM IR (-O0):
define void @Default_KMU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_KMU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void mov(char src, char dest) {
  printf("move %c to %c\n", src, dest);
  return;
}


x86 assembly (clang, -O0):
<mov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"move %c to %c\0A\00"
define void @mov(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"move %c to %c\0A\00"
define void @mov(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum_zero_to_onethousand();
int main(void) {
  printf("%d\n", sum_zero_to_onethousand());
  return 0;
}


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

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

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

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