xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x96() {
  Assert_real((isprint(150) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              755, ("isprint should be 0 for 0x96"));
}


x86 assembly (clang, -O0):
<t_isprint_0x96>:
push   %rbp
mov    %rsp,%rbp
mov    $0x96,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2f3,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x96>:
push   %rax
mov    $0x96,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2f3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x96\00"
define void @t_isprint_0x96() {
%1 = call i64 @isprint(i32 150)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 755, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x96\00"
define void @t_isprint_0x96() {
%1 = tail call i64 @isprint(i32 150)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 755, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned char *, int);
ssize_t WriteSword(int hFilename, unsigned dValue) {
  unsigned char cBuffer[2];
  cBuffer[0] = dValue & 0xFF;
  cBuffer[1] = (dValue >> 8) & 0xFF;
  return write(hFilename, cBuffer, 2);
}


x86 assembly (clang, -O0):
<WriteSword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteSword>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @WriteSword(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %8, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %13, i8* %14
%15 = load i32, i32* %3
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%17 = call i32 @write(i32 %15, i8* %16, i32 2)
ret i32 %17
}

LLVM IR (-O2):
define i32 @WriteSword(i32 %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @write(i32 %0, i8* %4, i32 2)
ret i32 %9
}
void olpc_ofw_detect(void) {}


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

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

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

LLVM IR (-O2):
define void @olpc_ofw_detect() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ r_type_inst(int, int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void nop_inst() { r_type_inst(506, 0, 0, 0); }


x86 assembly (clang, -O0):
<nop_inst>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1fa,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <r_type_inst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop_inst>:
mov    $0x1fa,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <r_type_inst@plt>

LLVM IR (-O0):
define void @nop_inst() {
%1 = call i32 @r_type_inst(i32 506, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @nop_inst() {
%1 = tail call i32 @r_type_inst(i32 506, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usartWrite(char *, int);
int _write(int fd, char *buf, int nbytes) {
  usartWrite(buf, nbytes);
  return nbytes;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <usartWrite@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <usartWrite@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* %1, i32 returned %2) {
%4 = tail call i32 @usartWrite(i8* %1, i32 %2)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int main() {
  regex_t regex;
  char regex_pattern[] = "([A-Z]{1,2})[0-9][0-9A-Z]? +[0-9][A-Z]{2}";
  int status;
  char string[101];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x30(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x2a,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.regex_pattern = [42 x i8] c"([A-Z]{1,2})[0-9][0-9A-Z]? +[0-9][A-Z]{2}\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [42 x i8]
%3 = alloca i32
%4 = alloca [101 x i8]
%5 = bitcast [42 x i8]* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ burnstack(int);
int /*<<< orphan*/ conv_sk_ed25519_to_x25519(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/ const *);
void sk_ed25519_to_x25519(uint8_t out[32], const uint8_t in[32]) {
  conv_sk_ed25519_to_x25519(out, in);
  burnstack(1024);
}


x86 assembly (clang, -O0):
<sk_ed25519_to_x25519>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <conv_sk_ed25519_to_x25519@plt>
mov    $0x400,%edi
call   1040 <burnstack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_ed25519_to_x25519>:
push   %rax
call   1030 <conv_sk_ed25519_to_x25519@plt>
mov    $0x400,%edi
pop    %rax
jmp    1040 <burnstack@plt>

LLVM IR (-O0):
define void @sk_ed25519_to_x25519(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 = call i32 @conv_sk_ed25519_to_x25519(i32* %5, i32* %6)
%8 = call i32 @burnstack(i32 1024)
ret void
}

LLVM IR (-O2):
define void @sk_ed25519_to_x25519(i32* %0, i32* %1) {
%3 = tail call i32 @conv_sk_ed25519_to_x25519(i32* %0, i32* %1)
%4 = tail call i32 @burnstack(i32 1024)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_ixf_integer(unsigned char const *, int);
size_t get_varchar_cur_len(const unsigned char *len_ind) {
  return (size_t)parse_ixf_integer(len_ind, 2);
}


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

x86 assembly (clang, -O2):
<get_varchar_cur_len>:
push   %rax
mov    $0x2,%esi
call   1030 <parse_ixf_integer@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_varchar_cur_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @parse_ixf_integer(i8* %3, i32 2)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_varchar_cur_len(i8* %0) {
%2 = tail call i32 @parse_ixf_integer(i8* %0, i32 2)
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
long double fabsl(long double);
int _eq(long double epsilon, long double a, long double b) {
  long double delta;
  delta = fabsl(a - b);
  return (delta <= epsilon);
}


x86 assembly (clang, -O0):
<_eq>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fsubrp %st,%st(1)
fabs
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
fldt   -0x10(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eq>:
fldt   0x8(%rsp)
fldt   0x28(%rsp)
fldt   0x18(%rsp)
fsubp  %st,%st(1)
fabs
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @_eq(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%8 = load x86_fp80, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %6
%10 = fsub x86_fp80 %8, %9
%11 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %10)
store x86_fp80 %11, x86_fp80* %7
%12 = load x86_fp80, x86_fp80* %7
%13 = load x86_fp80, x86_fp80* %4
%14 = fcmp ole x86_fp80 %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @_eq(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = fsub x86_fp80 %1, %2
%5 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %4)
%6 = fcmp ole x86_fp80 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef enum xprt_stat { ____Placeholder_xprt_stat } xprt_stat;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int XPRT_IDLE;
enum xprt_stat svcraw_stat(SVCXPRT *xprt) { return XPRT_IDLE; }


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

x86 assembly (clang, -O2):
<svcraw_stat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@XPRT_IDLE = global i32 0
define i32 @svcraw_stat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @XPRT_IDLE
ret i32 %3
}

LLVM IR (-O2):
@XPRT_IDLE = global i32 0
define i32 @svcraw_stat(i32* nocapture readnone %0) {
%2 = load i32, i32* @XPRT_IDLE
ret i32 %2
}
void foo611() {}


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

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

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

LLVM IR (-O2):
define void @foo611() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NumberIO_StrToCard(char *, int, unsigned int *);
int /*<<< orphan*/ StrIO_ReadString(char *, int);
void NumberIO_ReadCard(unsigned int *x) {
  typedef struct _T1_a _T1;
  struct _T1_a {
    char array[79 + 1];
  };
  _T1 a;
  StrIO_ReadString((char *)&a.array[0], 79);
  NumberIO_StrToCard((char *)&a.array[0], 79, x);
}


x86 assembly (clang, -O0):
<NumberIO_ReadCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x58(%rbp),%rdi
mov    $0x4f,%esi
call   1040 <StrIO_ReadString@plt>
lea    -0x58(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x4f,%esi
call   1030 <NumberIO_StrToCard@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberIO_ReadCard>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x4f,%esi
call   1040 <StrIO_ReadString@plt>
mov    %r14,%rdi
mov    $0x4f,%esi
mov    %rbx,%rdx
call   1030 <NumberIO_StrToCard@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct._T1_a = type { [80 x i8] }
define void @NumberIO_ReadCard(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct._T1_a
store i32* %0, i32** %2
%4 = getelementptr inbounds %struct._T1_a, %struct._T1_a* %3, i32 0, i32 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = call i32 @StrIO_ReadString(i8* %5, i32 79)
%7 = getelementptr inbounds %struct._T1_a, %struct._T1_a* %3, i32 0, i32 0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%9 = load i32*, i32** %2
%10 = call i32 @NumberIO_StrToCard(i8* %8, i32 79, i32* %9)
ret void
}

LLVM IR (-O2):
%struct._T1_a = type { [80 x i8] }
define void @NumberIO_ReadCard(i32* %0) {
%2 = alloca %struct._T1_a
%3 = getelementptr inbounds %struct._T1_a, %struct._T1_a* %2, i64 0, i32 0, i64 0
%4 = call i32 @StrIO_ReadString(i8* %3, i32 79)
%5 = call i32 @NumberIO_StrToCard(i8* %3, i32 79, i32* %0)
ret void
}
void i_to_x(int i, char x[]) {
  if (i >= 8) {
    i++;
  }
  x[0] = i + 65;
  x[1] = '\0';
  return;
}


x86 assembly (clang, -O0):
<i_to_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x8,-0x4(%rbp)
jl     111e <i_to_x+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x41,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_to_x>:
xor    %eax,%eax
cmp    $0x8,%edi
setge  %al
add    %edi,%eax
add    $0x41,%al
mov    %al,(%rsi)
movb   $0x0,0x1(%rsi)
ret

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

LLVM IR (-O2):
define void @i_to_x(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 7
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %0
%6 = trunc i32 %5 to i8
%7 = add i8 %6, 65
store i8 %7, i8* %1
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 0, i8* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ReadUint32Be(void const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(float *, int /*<<< orphan*/ *, int);
int32_t ReadFloatBe(const void *in, float *value) {
  uint32_t u32;
  int32_t length = ReadUint32Be(in, &u32);
  memcpy(value, &u32, sizeof(*value));
  return length;
}


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

x86 assembly (clang, -O2):
<ReadFloatBe>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rsi
call   1040 <ReadUint32Be@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ReadFloatBe(i8* %0, float* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @ReadUint32Be(i8* %0, i32* %3)
%6 = call i32 @memcpy(float* %1, i32* %3, i32 4)
ret i32 %5
}
int bar(long int x) { return !!x ? x : 1; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <bar+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112e <bar+0x2e>
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    112e <bar+0x2e>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %rdi,%rdi
mov    $0x1,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @bar(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i64 [ %6, %5 ], [ 1, %7 ]
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @bar(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = trunc i64 %0 to i32
%4 = select i1 %2, i32 1, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ap_log_get_lock();
int /*<<< orphan*/ ap_log_release_lock();
int remove_debug_handle_internal(int);
int ap_log_remove_debug_handle(int fd) {
  int retcode;
  if (!ap_log_get_lock())
    return 0;
  retcode = remove_debug_handle_internal(fd);
  ap_log_release_lock();
  return retcode;
}


x86 assembly (clang, -O0):
<ap_log_remove_debug_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ap_log_get_lock@plt>
cmp    $0x0,%eax
jne    1157 <ap_log_remove_debug_handle+0x27>
movl   $0x0,-0x4(%rbp)
jmp    116f <ap_log_remove_debug_handle+0x3f>
mov    -0x8(%rbp),%edi
call   1050 <remove_debug_handle_internal@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ap_log_release_lock@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_log_remove_debug_handle>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <ap_log_get_lock@plt>
test   %eax,%eax
je     1152 <ap_log_remove_debug_handle+0x22>
mov    %ebx,%edi
call   1050 <remove_debug_handle_internal@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <ap_log_release_lock@plt>
mov    %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ap_log_remove_debug_handle(i32 %0) {
%2 = tail call i32 (...) @ap_log_get_lock()
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @remove_debug_handle_internal(i32 %0)
%6 = tail call i32 (...) @ap_log_release_lock()
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_menu() {
  puts("\n-------------------------------------\n1: View order\n2: Add "
       "order\n3: Update order\n4: "
       "Exit\n-------------------------------------\n");
}


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

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

LLVM IR (-O0):
@.str = [129 x i8] c"\0A-------------------------------------\0A1: View order\0A2: Add order\0A3: Update order\0A4: Exit\0A-------------------------------------\0A\00"
define void @print_menu() {
%1 = call i32 @puts(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"\0A-------------------------------------\0A1: View order\0A2: Add order\0A3: Update order\0A4: Exit\0A-------------------------------------\0A\00"
define void @print_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct silly_config {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ logfileopen(struct silly_config const *);
void silly_daemon_sigusr1(const struct silly_config *conf) {
  logfileopen(conf);
  return;
}


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

x86 assembly (clang, -O2):
<silly_daemon_sigusr1>:
jmp    1030 <logfileopen@plt>

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

LLVM IR (-O2):
%struct.silly_config = type { i32 }
define void @silly_daemon_sigusr1(%struct.silly_config* %0) {
%2 = tail call i32 @logfileopen(%struct.silly_config* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearline();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fbreset();
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fred();
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void sim_error(const char msg[]) {
  clearline();
  fred();
  printf("ERROR: %s\n", msg);
  fputc('\n', stdout);
  fbreset();
  exit(-1);
}


x86 assembly (clang, -O0):
<sim_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clearline@plt>
mov    $0x0,%al
call   1070 <fred@plt>
mov    -0x8(%rbp),%rsi
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <fputc@plt>
mov    $0x0,%al
call   1040 <fbreset@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<sim_error>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clearline@plt>
xor    %eax,%eax
call   1070 <fred@plt>
lea    0xe87(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <fputc@plt>
xor    %eax,%eax
call   1040 <fbreset@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ERROR: %s\0A\00"
@stdout = global i32 0
define void @sim_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @clearline()
%4 = call i32 (...) @fred()
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fputc(i8 signext 10, i32 %7)
%9 = call i32 (...) @fbreset()
%10 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
@stdout = global i32 0
define void @sim_error(i8* %0) {
%2 = tail call i32 (...) @clearline()
%3 = tail call i32 (...) @fred()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputc(i8 signext 10, i32 %5)
%7 = tail call i32 (...) @fbreset()
%8 = tail call i32 @exit(i32 -1)
unreachable
}
long long llabs(long long x) {
  do {
  } while (0);
  return x < 0 ? -x : x;
}


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <llabs+0xd>
cmpq   $0x0,-0x8(%rbp)
jge    1127 <llabs+0x27>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112f <llabs+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i64, i64* %2
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %12
10: ; preds = %4
%11 = load i64, i64* %2
br label %12
12: ; preds = %10, %7
%13 = phi i64 [ %9, %7 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
int functionC(int val1, int val2) {
  int total = val1 + val2;
  return total;
}


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

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

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

LLVM IR (-O2):
define i32 @functionC(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mix1(unsigned int);
unsigned hash1(unsigned a) {
  mix1(a);
  return a;
}


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

x86 assembly (clang, -O2):
<hash1>:
push   %rbx
mov    %edi,%ebx
call   1030 <mix1@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hash1(i32 returned %0) {
%2 = tail call i32 @mix1(i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, char *, int *);
int main() {
  char sentence[] = "Rudolph is 12 years old";
  char str[20];
  int i;
  sscanf(sentence, "%s %*s %d", str, &i);
  printf("%s -> %d\n", str, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    0xeb9(%rip),%rsi
lea    -0x44(%rbp),%rcx
call   1040 <sscanf@plt>
lea    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x646c6f20737261,%rax
mov    %rax,0x20(%rsp)
lea    0xed1(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0x30(%rsp),%rbx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdx
call   1040 <sscanf@plt>
mov    0xc(%rsp),%edx
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.sentence = [24 x i8] c"Rudolph is 12 years old\00"
@.str = [10 x i8] c"%s %*s %d\00"
@.str.1 = [10 x i8] c"%s -> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i8]
%3 = alloca [20 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [24 x i8]* %2 to i8*
%6 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7, i32* %4)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.sentence = [24 x i8] c"Rudolph is 12 years old\00"
@.str = [10 x i8] c"%s %*s %d\00"
@.str.1 = [10 x i8] c"%s -> %d\0A\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = bitcast i32* %3 to i8*
%7 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %8)
ret i32 0
}
int main(register int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 returned %0) {
ret i32 %0
}
void pthread_attr_getschedpolicy() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_getschedpolicy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void receivemsg(char *msg, int lenmsg) {
  printf("Received: ");
  printf("%s\n", msg);
}


x86 assembly (clang, -O0):
<receivemsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Received: \00"
define void @receivemsg(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
void av_codec_get_id() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_get_id() {
ret void
}
unsigned long mfspr(unsigned char rd, unsigned char spr) {
  return (31 << 26) | (rd << 21) | (spr << 16) | (339 << 1);
}


x86 assembly (clang, -O0):
<mfspr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x15,%eax
or     $0x7c000000,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
or     $0x2a6,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfspr>:
mov    %edi,%ecx
shl    $0x15,%rcx
mov    %esi,%eax
shl    $0x10,%rax
or     %rcx,%rax
or     $0x7c0002a6,%rax
ret

LLVM IR (-O0):
define i64 @mfspr(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 21
%8 = or i32 2080374784, %7
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 16
%12 = or i32 %8, %11
%13 = or i32 %12, 678
%14 = sext i32 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @mfspr(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i64
%4 = shl nuw nsw i64 %3, 21
%5 = zext i8 %1 to i64
%6 = shl nuw nsw i64 %5, 16
%7 = or i64 %4, %6
%8 = or i64 %7, 2080375462
ret i64 %8
}
signed long int signedlongint_ignoring_signedint(signed long int x,
                                                 signed int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @signedlongint_ignoring_signedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int report_error(int, char const *, char *);
bool process_error(int scon, const char *client_name, const char *buf) {
  return report_error(scon, client_name, "Invalid command");
}


x86 assembly (clang, -O0):
<process_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xecf(%rip),%rdx
call   1030 <report_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_error>:
lea    0xee9(%rip),%rdx
jmp    1030 <report_error@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Invalid command\00"
define i32 @process_error(i32 %0, i8* %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 i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i32 @report_error(i32 %7, i8* %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 %9
}

LLVM IR (-O2):
@.str = [16 x i8] c"Invalid command\00"
define i32 @process_error(i32 %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @report_error(i32 %0, i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int factorise(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Enter the number to print and find its distinct prime factors: ");
  scanf("%d", &num);
  printf("Total number of distinct prime factors of %d is %d", num,
         factorise(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <factorise@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <factorise@plt>
lea    0xeda(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"Enter the number to print and find its distinct prime factors: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [51 x i8] c"Total number of distinct prime factors of %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @factorise(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [64 x i8] c"Enter the number to print and find its distinct prime factors: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [51 x i8] c"Total number of distinct prime factors of %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorise(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
unsigned int ar5312_cpu_frequency(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ar5312_cpu_frequency() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ar5312_cpu_frequency() {
ret i32 0
}
/* Variables and functions */
double erfc(double);
double fabs(double);
double sqrt(int);
double pvalue(double mean, double sd, double value) {
  return erfc(fabs(value - mean) / (sqrt(2) * sd)) / 2.0;
}


x86 assembly (clang, -O0):
<pvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movaps 0xec8(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <erfc@plt>
movsd  0xe87(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvalue>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
subsd  %xmm0,%xmm2
andpd  0xeca(%rip),%xmm2
movapd %xmm2,0x10(%rsp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <erfc@plt>
mulsd  0xea9(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @pvalue(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fsub double %7, %8
%10 = call double @llvm.fabs.f64(double %9)
%11 = call double @sqrt(i32 2)
%12 = load double, double* %5
%13 = fmul double %11, %12
%14 = fdiv double %10, %13
%15 = call double @erfc(double %14)
%16 = fdiv double %15, 2.000000e+00
ret double %16
}

LLVM IR (-O2):
define double @pvalue(double %0, double %1, double %2) {
%4 = fsub double %2, %0
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = tail call double @sqrt(i32 2)
%7 = fmul double %6, %1
%8 = fdiv double %5, %7
%9 = tail call double @erfc(double %8)
%10 = fmul double %9, 5.000000e-01
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t direct_read32(volatile uint32_t *addr) { return *addr; }


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

x86 assembly (clang, -O2):
<direct_read32>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @direct_read32(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ RB_POWER_OFF;
int /*<<< orphan*/ reboot(int /*<<< orphan*/);
int main() {
  reboot(RB_POWER_OFF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RB_POWER_OFF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @RB_POWER_OFF
%3 = call i32 @reboot(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@RB_POWER_OFF = global i32 0
define i32 @main() {
%1 = load i32, i32* @RB_POWER_OFF
%2 = tail call i32 @reboot(i32 %1)
ret i32 0
}
void av_url_split() {}


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

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

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

LLVM IR (-O2):
define void @av_url_split() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void DELAY(unsigned int delay) { usleep(delay); }


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

x86 assembly (clang, -O2):
<DELAY>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @DELAY(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
void gtk_icon_source_set_icon_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_set_icon_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
void print_float_array(float *array, int columns) {
  int iterator_column;
  for (iterator_column = 0; iterator_column < columns; iterator_column++) {
    printf("[DEBUG] [%d]: %g\n", iterator_column, array[iterator_column]);
  }
}


x86 assembly (clang, -O0):
<print_float_array>:
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    115c <print_float_array+0x4c>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_float_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_float_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1149 <print_float_array+0x39>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movss  (%r14,%rbx,4),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_float_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"[DEBUG] [%d]: %g\0A\00"
define void @print_float_array(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %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 float*, float** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds float, float* %12, i64 %14
%16 = load float, float* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11, float %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 = [18 x i8] c"[DEBUG] [%d]: %g\0A\00"
define void @print_float_array(float* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = load float, float* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10, float %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void file_close(FILE *file) {
  int res;
  res = fclose(file);
  if (res != 0) {
    perror("could not close file");
  }
}


x86 assembly (clang, -O0):
<file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <file_close+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_close>:
push   %rax
call   1030 <fclose@plt>
test   %eax,%eax
jne    112c <file_close+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"could not close file\00"
define void @file_close(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fclose(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"could not close file\00"
define void @file_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_spifunc3(void) { return GppcFinfoV1(); }


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

x86 assembly (clang, -O2):
<pg_finfo_spifunc3>:
xor    %eax,%eax
jmp    1030 <GppcFinfoV1@plt>

LLVM IR (-O0):
define i8* @pg_finfo_spifunc3() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_spifunc3() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}