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

/* Variables and functions */
void rtp_get_ssrc(const uint8_t *p_rtp, uint8_t pi_ssrc[4]) {
  pi_ssrc[0] = p_rtp[8];
  pi_ssrc[1] = p_rtp[9];
  pi_ssrc[2] = p_rtp[10];
  pi_ssrc[3] = p_rtp[11];
}


x86 assembly (clang, -O0):
<rtp_get_ssrc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_get_ssrc>:
mov    0x20(%rdi),%eax
mov    %eax,(%rsi)
mov    0x24(%rdi),%eax
mov    %eax,0x4(%rsi)
mov    0x28(%rdi),%eax
mov    %eax,0x8(%rsi)
mov    0x2c(%rdi),%eax
mov    %eax,0xc(%rsi)
ret

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

LLVM IR (-O2):
define void @rtp_get_ssrc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 8
%4 = load i32, i32* %3
store i32 %4, i32* %1
%5 = getelementptr inbounds i32, i32* %0, i64 9
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 10
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %9, i32* %10
%11 = getelementptr inbounds i32, i32* %0, i64 11
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %12, i32* %13
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int binaryCollatingFunc(void *NotUsed, int nKey1, const void *pKey1, int nKey2,
                        const void *pKey2) {
  int rc, n;
  n = nKey1 < nKey2 ? nKey1 : nKey2;
  rc = memcmp(pKey1, pKey2, n);
  if (rc == 0) {
    rc = nKey1 - nKey2;
  }
  return rc;
}


x86 assembly (clang, -O0):
<binaryCollatingFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1141 <binaryCollatingFunc+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1147 <binaryCollatingFunc+0x37>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1173 <binaryCollatingFunc+0x63>
mov    -0xc(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaryCollatingFunc>:
push   %rbx
mov    %rdx,%rdi
mov    %esi,%ebx
sub    %ecx,%ebx
cmovl  %esi,%ecx
mov    %r8,%rsi
mov    %ecx,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @binaryCollatingFunc(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%13 = load i32, i32* %7
%14 = load i32, i32* %9
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %5
%17 = load i32, i32* %7
br label %20
18: ; preds = %5
%19 = load i32, i32* %9
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
store i32 %21, i32* %12
%22 = load i8*, i8** %8
%23 = load i8*, i8** %10
%24 = load i32, i32* %12
%25 = call i32 @memcmp(i8* %22, i8* %23, i32 %24)
store i32 %25, i32* %11
%26 = load i32, i32* %11
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %20
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = sub nsw i32 %29, %30
store i32 %31, i32* %11
br label %32
32: ; preds = %28, %20
%33 = load i32, i32* %11
ret i32 %33
}

LLVM IR (-O2):
define i32 @binaryCollatingFunc(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = icmp slt i32 %1, %3
%7 = select i1 %6, i32 %1, i32 %3
%8 = tail call i32 @memcmp(i8* %2, i8* %4, i32 %7)
%9 = icmp eq i32 %8, 0
%10 = sub nsw i32 %1, %3
%11 = select i1 %9, i32 %10, i32 %8
ret i32 %11
}
/* Variables and functions */
scalar_t__ ft_isalpha(int);
int ft_tolower(int c) {
  if (ft_isalpha(c) && (c <= 'Z'))
    c = c + 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_isalpha@plt>
cmp    $0x0,%rax
je     1140 <ft_tolower+0x30>
cmpl   $0x5a,-0x4(%rbp)
jg     1140 <ft_tolower+0x30>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isalpha@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
cmp    $0x5b,%ebx
cmovge %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = tail call i64 @ft_isalpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp slt i32 %0, 91
%5 = and i1 %4, %3
%6 = add nsw i32 %0, 32
%7 = select i1 %5, i32 %6, i32 %0
ret i32 %7
}
/* Variables and functions */
int IBar_QueryInterface(int *, long *, void *);
int IFoo_QueryInterface(int *iface, long *riid, void **ppv) {
  return IBar_QueryInterface(iface, riid, *ppv);
}


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

x86 assembly (clang, -O2):
<IFoo_QueryInterface>:
mov    (%rdx),%rdx
jmp    1030 <IBar_QueryInterface@plt>

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

LLVM IR (-O2):
define i32 @IFoo_QueryInterface(i32* %0, i64* %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @IBar_QueryInterface(i32* %0, i64* %1, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA1_Stream4_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_Stream4_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_Stream4_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void SPI_LEDS_RX_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_LEDS_RX_ISR() {
ret void
}
/* Variables and functions */
int dlclose(void *);
int close_dll(void *dll) { return dlclose(dll); }


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

x86 assembly (clang, -O2):
<close_dll>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define i32 @close_dll(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret i32 %2
}
void testFuncMultipleStatement(void) {
  int a = 1U;
  int b = 2U;
  int c = 3U;
  int d = 4U;
  a = a + b;
  b = b + c;
  c = c + d;
  d = d + a;
}


x86 assembly (clang, -O0):
<testFuncMultipleStatement>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testFuncMultipleStatement() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %1
%16 = add nsw i32 %14, %15
store i32 %16, i32* %4
ret void
}

LLVM IR (-O2):
define void @testFuncMultipleStatement() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("hello");
  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 <puts@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 = [6 x i8] c"hello\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 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int number, base;
  char str[100];
  number = 42425;
  base = 16;
  itob(number, str, base);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa5b9,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <itob@plt>
lea    -0x70(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    $0xa5b9,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
store i32 0, i32* %1
store i32 42425, i32* %2
store i32 16, i32* %3
%5 = load i32, i32* %2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @itob(i32 %5, i8* %6, i32 %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itob(i32 42425, i8* %2, i32 16)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x88() {
  Assert_real((isprint(136) == 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",
              685, ("isprint should be 0 for 0x88"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x88>:
push   %rax
mov    $0x88,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2ad,%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 0x88\00"
define void @t_isprint_0x88() {
%1 = call i64 @isprint(i32 136)
%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 685, 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 0x88\00"
define void @t_isprint_0x88() {
%1 = tail call i64 @isprint(i32 136)
%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 685, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  int i;
  printf(
      "Usage: tga2header [OPTION]... [file.tga]\n"
      "Transform tga graphic file into MSX C header\n"
      " -h, --help           Print this help.\n"
      " -f, --full (DEFAULT) full tga to scr2 format conversion,\n"
      " -p, --palette        convert to msx1 palette only,\n"
      " -t, --type=TYPE      output format,\n"
      "                          TILE    : scr2 pattern & color C source,\n"
      "                          TILEH   : scr2 pattern & color H source (no "
      "data),\n"
      "                          SPRITE  : msx1 16x16 sprite planes C source,\n"
      "                          SPRITEH : msx1 16x16 sprite planes H source "
      "(no data),\n"
      " -o, --output=FILE    output file,\n"
      "\n");
}


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

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

LLVM IR (-O0):
@.str = [605 x i8] c"Usage: tga2header [OPTION]... [file.tga]\0ATransform tga graphic file into MSX C header\0A -h, --help Print this help.\0A -f, --full (DEFAULT) full tga to scr2 format conversion,\0A -p, --palette convert to msx1 palette only,\0A -t, --type=TYPE output format,\0A TILE : scr2 pattern & color C source,\0A TILEH : scr2 pattern & color H source (no data),\0A SPRITE : msx1 16x16 sprite planes C source,\0A SPRITEH : msx1 16x16 sprite planes H source (no data),\0A -o, --output=FILE output file,\0A\0A\00"
define void @usage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([605 x i8], [605 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [604 x i8] c"Usage: tga2header [OPTION]... [file.tga]\0ATransform tga graphic file into MSX C header\0A -h, --help Print this help.\0A -f, --full (DEFAULT) full tga to scr2 format conversion,\0A -p, --palette convert to msx1 palette only,\0A -t, --type=TYPE output format,\0A TILE : scr2 pattern & color C source,\0A TILEH : scr2 pattern & color H source (no data),\0A SPRITE : msx1 16x16 sprite planes C source,\0A SPRITEH : msx1 16x16 sprite planes H source (no data),\0A -o, --output=FILE output file,\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([604 x i8], [604 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int recv(int, void *, int, int /*<<< orphan*/);
int receiveTCPNumber(int socket, int *number) {
  int n;
  n = recv(socket, (void *)number, sizeof(int), 0);
  if (n < sizeof(int)) {
    printf("Errore durante il comando recv() \n");
    exit(1);
  } else
    return n;
}


x86 assembly (clang, -O0):
<receiveTCPNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jae    1179 <receiveTCPNumber+0x49>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receiveTCPNumber>:
push   %rax
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x3,%eax
jbe    1144 <receiveTCPNumber+0x14>
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Errore durante il comando recv() \0A\00"
define i32 @receiveTCPNumber(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 = bitcast i32* %7 to i8*
%9 = call i32 @recv(i32 %6, i8* %8, i32 4, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 4
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@str = [34 x i8] c"Errore durante il comando recv() \00"
define i32 @receiveTCPNumber(i32 %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @recv(i32 %0, i8* %3, i32 4, i32 0)
%5 = icmp ult i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32 %4
}
/* Variables and functions */
scalar_t__ LONG_MAX;
int ulong_fits_in_long(const unsigned long x) {
  return x <= (unsigned long)LONG_MAX;
}


x86 assembly (clang, -O0):
<ulong_fits_in_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulong_fits_in_long>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
cmp    %rdi,(%rcx)
setae  %al
ret

LLVM IR (-O0):
@LONG_MAX = global i64 0
define i32 @ulong_fits_in_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @LONG_MAX
%5 = icmp ule i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@LONG_MAX = global i64 0
define i32 @ulong_fits_in_long(i64 %0) {
%2 = load i64, i64* @LONG_MAX
%3 = icmp uge i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dcopy_(int *, double *, int *, double *, int *);
void DCOPY(int ntot, double *copy_from, int inc1, double *copy_to, int inc2) {
  dcopy_(&ntot, copy_from, &inc1, copy_to, &inc2);
}


x86 assembly (clang, -O0):
<DCOPY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <dcopy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCOPY>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <dcopy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @DCOPY(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double*, double** %7
%12 = load double*, double** %9
%13 = call i32 @dcopy_(i32* %6, double* %11, i32* %8, double* %12, i32* %10)
ret void
}

LLVM IR (-O2):
define void @DCOPY(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call i32 @dcopy_(i32* %6, double* %1, i32* %7, double* %3, i32* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(void **);
void foo(int n, void **x, void **y) {
  if (n == 0)
    bar(x);
  else
    bar(y);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113b <foo+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <bar@plt>
jmp    1144 <foo+0x34>
mov    -0x18(%rbp),%rdi
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
cmovne %rdx,%rsi
mov    %rsi,%rdi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(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 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8**, i8*** %5
%11 = call i32 @bar(i8** %10)
br label %15
12: ; preds = %3
%13 = load i8**, i8*** %6
%14 = call i32 @bar(i8** %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i8** %1, i8** %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8** %1, i8** %2
%6 = tail call i32 @bar(i8** %5)
ret void
}
void peak_transfer_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @peak_transfer_lock() {
ret void
}
int test_imm_0Fuint8_mem(unsigned char *val) {
  return ((*val) & (-0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfffffff1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Fuint8_mem>:
testb  $0xf1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -15
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ matNf_setRow(float *, float const *, int const, int);
void mat3f_setRow(float matrix[9], const float v[3], const int row) {
  matNf_setRow(matrix, v, row, 3);
}


x86 assembly (clang, -O0):
<mat3f_setRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x3,%ecx
call   1030 <matNf_setRow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3f_setRow>:
mov    $0x3,%ecx
jmp    1030 <matNf_setRow@plt>

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

LLVM IR (-O2):
define void @mat3f_setRow(float* %0, float* %1, i32 %2) {
%4 = tail call i32 @matNf_setRow(float* %0, float* %1, i32 %2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_init(int);
void debug_init(void) { serial_init(115200); }


x86 assembly (clang, -O0):
<debug_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c200,%edi
call   1030 <serial_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_init>:
mov    $0x1c200,%edi
jmp    1030 <serial_init@plt>

LLVM IR (-O0):
define void @debug_init() {
%1 = call i32 @serial_init(i32 115200)
ret void
}

LLVM IR (-O2):
define void @debug_init() {
%1 = tail call i32 @serial_init(i32 115200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char *);
void setValue(char *pSource, char dest[]) {
  memset(dest, 0, 256);
  memcpy(dest, pSource, strlen(pSource));
}


x86 assembly (clang, -O0):
<setValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setValue>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memcpy@plt>

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

LLVM IR (-O2):
define void @setValue(i8* %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i32 0, i32 256)
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EOPNOTSUPP;
int /*<<< orphan*/ errno;
int getflags(int fd, unsigned long *flags) {
  errno = EOPNOTSUPP;
  return -1;
}


x86 assembly (clang, -O0):
<getflags>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getflags>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @getflags(i32 %0, i64* nocapture readnone %1) {
%3 = load i32, i32* @EOPNOTSUPP
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x57() {
  Assert_real((isdigit(87) == 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_isdigit.c",
              440, ("isdigit should be 0 for W"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x57>:
push   %rax
mov    $0x57,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1b8,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for W\00"
define void @t_isdigit_0x57() {
%1 = call i64 @isdigit(i32 87)
%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 440, i8* getelementptr inbounds ([26 x i8], [26 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for W\00"
define void @t_isdigit_0x57() {
%1 = tail call i64 @isdigit(i32 87)
%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 440, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADC_(int);
int /*<<< orphan*/ c64_memAbsoluteAddrX();
void ADC_absx(void) {
  c64_memAbsoluteAddrX();
  ADC_(1);
}


x86 assembly (clang, -O0):
<ADC_absx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <c64_memAbsoluteAddrX@plt>
mov    $0x1,%edi
call   1030 <ADC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_absx>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddrX@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <ADC_@plt>

LLVM IR (-O0):
define void @ADC_absx() {
%1 = call i32 (...) @c64_memAbsoluteAddrX()
%2 = call i32 @ADC_(i32 1)
ret void
}

LLVM IR (-O2):
define void @ADC_absx() {
%1 = tail call i32 (...) @c64_memAbsoluteAddrX()
%2 = tail call i32 @ADC_(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simplesample_amqp_run();
int main(void) {
  simplesample_amqp_run();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <simplesample_amqp_run@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @simplesample_amqp_run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
char *left(char *, int);
scalar_t__ popNumber();
char *popString();
int /*<<< orphan*/ pushStringCopy(char *);
void basLeft() {
  int pos;
  char *string;
  char *dest;
  pos = (int)popNumber();
  string = popString();
  dest = left(string, pos);
  pushStringCopy(dest);
  eFree(string);
}


x86 assembly (clang, -O0):
<basLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1070 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <left@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <pushStringCopy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <eFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basLeft>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <popNumber@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14d,%esi
call   1040 <left@plt>
mov    %rax,%rdi
call   1060 <pushStringCopy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basLeft() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i64 (...) @popNumber()
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = call i8* (...) @popString()
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = call i8* @left(i8* %7, i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @pushStringCopy(i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 @eFree(i8* %12)
ret void
}

LLVM IR (-O2):
define void @basLeft() {
%1 = tail call i64 (...) @popNumber()
%2 = trunc i64 %1 to i32
%3 = tail call i8* (...) @popString()
%4 = tail call i8* @left(i8* %3, i32 %2)
%5 = tail call i32 @pushStringCopy(i8* %4)
%6 = tail call i32 @eFree(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigterm_h(int signal) {
  dump();
  exit(0);
}


x86 assembly (clang, -O0):
<sigterm_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <dump@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigterm_h>:
push   %rax
xor    %eax,%eax
call   1030 <dump@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigterm_h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @dump()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigterm_h(i32 %0) {
%2 = tail call i32 (...) @dump()
%3 = tail call i32 @exit(i32 0)
unreachable
}
void r_csi20_callback_sendend(void) {}


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

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

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

LLVM IR (-O2):
define void @r_csi20_callback_sendend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int n1;
  int n2;
  n1 = 10;
  n2 = 20;
  printf("Valor n1=%d n2=%d!\n", n1, n2);
  swap(&n1, &n2);
  printf("Valor n1=%d n2=%d!\n", n1, n2);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x14,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Valor n1=%d n2=%d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @swap(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Valor n1=%d n2=%d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %1
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
__typeof__(strnlen(1, "")) test_strnlen_198(void) { return strnlen(1, ""); }


x86 assembly (clang, -O0):
<test_strnlen_198>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <strnlen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strnlen_198>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <strnlen@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_strnlen_198() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @strnlen to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_strnlen_198() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @strnlen to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int tgetflag(char *name) {
  if (name[0] == 'a' && name[1] == 'm')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<tgetflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jne    1135 <tgetflag+0x35>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6d,%eax
jne    1135 <tgetflag+0x35>
movl   $0x1,-0x4(%rbp)
jmp    113c <tgetflag+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgetflag>:
cmpb   $0x61,(%rdi)
jne    1110 <tgetflag+0x10>
mov    $0x1,%eax
cmpb   $0x6d,0x1(%rdi)
je     1112 <tgetflag+0x12>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tgetflag(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 97
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 109
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
int fadd(int x, int y) { return x + y; }


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

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

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

LLVM IR (-O2):
define i32 @fadd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
char *decode_yes_no(int x) { return (x == 0) ? "no" : "yes"; }


x86 assembly (clang, -O0):
<decode_yes_no>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef2(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_yes_no>:
test   %edi,%edi
lea    0xef7(%rip),%rcx
lea    0xef3(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
define i8* @decode_yes_no(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
define i8* @decode_yes_no(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
void tf1() {}


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

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

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

LLVM IR (-O2):
define void @tf1() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int au_encbswap(int, void *, size_t);
int au_encnswap(uint32_t enc, void *b, size_t size) {
  const uint32_t e = 1;
  return (((const char *)&e)[0] ? au_encbswap(enc, b, size) : 0);
}


x86 assembly (clang, -O0):
<au_encnswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movsbl -0x1c(%rbp),%eax
cmp    $0x0,%eax
je     114f <au_encnswap+0x3f>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <au_encbswap@plt>
mov    %eax,-0x20(%rbp)
jmp    1159 <au_encnswap+0x49>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    1159 <au_encnswap+0x49>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_encnswap>:
jmp    1030 <au_encbswap@plt>

LLVM IR (-O0):
define i32 @au_encnswap(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 1, i32* %7
%8 = bitcast i32* %7 to i8*
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @au_encbswap(i32 %14, i8* %15, i64 %16)
br label %19
18: ; preds = %3
br label %19
19: ; preds = %18, %13
%20 = phi i32 [ %17, %13 ], [ 0, %18 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @au_encnswap(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @au_encbswap(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RReleaseCache();
int /*<<< orphan*/ r_destroy_conversion_tables();
void RShutdown(void) {
  RReleaseCache();
  r_destroy_conversion_tables();
}


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

x86 assembly (clang, -O2):
<RShutdown>:
push   %rax
xor    %eax,%eax
call   1030 <RReleaseCache@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <r_destroy_conversion_tables@plt>

LLVM IR (-O0):
define void @RShutdown() {
%1 = call i32 (...) @RReleaseCache()
%2 = call i32 (...) @r_destroy_conversion_tables()
ret void
}

LLVM IR (-O2):
define void @RShutdown() {
%1 = tail call i32 (...) @RReleaseCache()
%2 = tail call i32 (...) @r_destroy_conversion_tables()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  printf("%d %d", 'a', 'A');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x61,%esi
mov    $0x41,%edx
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    $0x61,%esi
mov    $0x41,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 65)
ret i32 0
}
int test_imm_D4uint8_mem(unsigned char *val) {
  return ((*val) & (0xD4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D4uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xd4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D4uint8_mem>:
testb  $0xd4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -44
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}