xunge/DecIR huggingface dataset:
/* Variables and functions */
float saturate(float);
float GetScreenResolutionAdaptiveScaleFactor(float fCurrentWidth,
                                             float fCurrentHeight,
                                             float fMaxWidth,
                                             float fMaxHeight) {
  float fMaxArea = fMaxWidth * fMaxHeight;
  float fCurrentArea = fCurrentWidth * fCurrentHeight;
  float fScale = saturate(fCurrentArea / fMaxArea);
  return fScale;
}


x86 assembly (clang, -O0):
<GetScreenResolutionAdaptiveScaleFactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
call   1030 <saturate@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetScreenResolutionAdaptiveScaleFactor>:
mulss  %xmm3,%xmm2
mulss  %xmm1,%xmm0
divss  %xmm2,%xmm0
jmp    1030 <saturate@plt>

LLVM IR (-O0):
define float @GetScreenResolutionAdaptiveScaleFactor(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%12 = load float, float* %7
%13 = load float, float* %8
%14 = fmul float %12, %13
store float %14, float* %9
%15 = load float, float* %5
%16 = load float, float* %6
%17 = fmul float %15, %16
store float %17, float* %10
%18 = load float, float* %10
%19 = load float, float* %9
%20 = fdiv float %18, %19
%21 = call float @saturate(float %20)
store float %21, float* %11
%22 = load float, float* %11
ret float %22
}

LLVM IR (-O2):
define float @GetScreenResolutionAdaptiveScaleFactor(float %0, float %1, float %2, float %3) {
%5 = fmul float %2, %3
%6 = fmul float %0, %1
%7 = fdiv float %6, %5
%8 = tail call float @saturate(float %7)
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vprintf(char const *, int /*<<< orphan*/);
int my_vprintf(const char *fmt, va_list arg) { return vprintf(fmt, arg); }


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

x86 assembly (clang, -O2):
<my_vprintf>:
jmp    1030 <vprintf@plt>

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

LLVM IR (-O2):
define i32 @my_vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printingHiMake(void) {
  printf("hi MakeFile !\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hi MakeFile !\0A\00"
define void @printingHiMake() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hi MakeFile !\00"
define void @printingHiMake() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
unsigned hash_tstamp(time_t tstamp) { return (unsigned)(tstamp & 0xff); }


x86 assembly (clang, -O0):
<hash_tstamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_tstamp>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_tstamp(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ TIOCLINUX;
unsigned char TIOCL_GETFGCONSOLE;
scalar_t__ ioctl(int, int /*<<< orphan*/, unsigned char *);
bool is_vconsole(int fd) {
  unsigned char data[1];
  data[0] = TIOCL_GETFGCONSOLE;
  return ioctl(fd, TIOCLINUX, data) >= 0;
}


x86 assembly (clang, -O0):
<is_vconsole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    -0x5(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vconsole>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%al
mov    %al,0x7(%rsp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    0x7(%rsp),%rdx
call   1030 <ioctl@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCL_GETFGCONSOLE = global i8 0
@TIOCLINUX = global i32 0
define i32 @is_vconsole(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i8]
store i32 %0, i32* %2
%4 = load i8, i8* @TIOCL_GETFGCONSOLE
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 %4, i8* %5
%6 = load i32, i32* %2
%7 = load i32, i32* @TIOCLINUX
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%9 = call i64 @ioctl(i32 %6, i32 %7, i8* %8)
%10 = icmp sge i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@TIOCL_GETFGCONSOLE = global i8 0
@TIOCLINUX = global i32 0
define i32 @is_vconsole(i32 %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = load i8, i8* @TIOCL_GETFGCONSOLE
store i8 %4, i8* %3
%5 = load i32, i32* @TIOCLINUX
%6 = call i64 @ioctl(i32 %0, i32 %5, i8* %3)
%7 = lshr i64 %6, 63
%8 = trunc i64 %7 to i32
%9 = xor i32 %8, 1
ret i32 %9
}
void debug_rcu_head_unqueue(struct rcu_head *head) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_head = type opaque
define void @debug_rcu_head_unqueue(%struct.rcu_head* nocapture %0) {
ret void
}
void val_delete_relation(void *v) { (void)v; }


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

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

LLVM IR (-O0):
define void @val_delete_relation(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @val_delete_relation(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ Elf64_Word;
typedef int /*<<< orphan*/ Elf64_Sword;

/* Variables and functions */
int elfrw_read_Word(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int elfrw_read_Sword(FILE *fp, Elf64_Sword *in) {
  return elfrw_read_Word(fp, (Elf64_Word *)in);
}


x86 assembly (clang, -O0):
<elfrw_read_Sword>:
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 <elfrw_read_Word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elfrw_read_Sword>:
jmp    1030 <elfrw_read_Word@plt>

LLVM IR (-O0):
define i32 @elfrw_read_Sword(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 @elfrw_read_Word(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @elfrw_read_Sword(i32* %0, i32* %1) {
%3 = tail call i32 @elfrw_read_Word(i32* %0, i32* %1)
ret i32 %3
}
int many3(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @many3(i32 returned %0) {
ret i32 %0
}
void quick_sort_1(int *array, int low, int high) { return; }


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

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

LLVM IR (-O0):
define void @quick_sort_1(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @quick_sort_1(i32* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EPIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(ui32Base == 0x400D0000);
  ASSERT(ui32IntFlags < 17);
  (*((volatile uint32_t *)(ui32Base + 0x00000210))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<EPIIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x11,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x210,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400d0000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x11,%ebx
setl   %dil
call   1030 <ASSERT@plt>
not    %ebx
movslq %ebp,%rax
and    %ebx,0x210(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @EPIIntDisable(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 = icmp eq i32 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 17
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %4
%14 = xor i32 %13, -1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 528
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = and i32 %19, %14
store volatile i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @EPIIntDisable(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074593792
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp slt i32 %1, 17
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = xor i32 %1, -1
%10 = add nsw i32 %0, 528
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, %9
store volatile i32 %14, i32* %12
ret void
}
unsigned xrop3_146_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = D | T;
  stk3 = S & stk4;
  stk2 = T ^ stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_146_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_146_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
lea    (%rsi,%rax,1),%edx
or     $0xff,%eax
and    %ecx,%eax
xor    %edx,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_146_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %6
%28 = load i32, i32* %11
%29 = and i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %7
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %5
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
ret i32 %36
}

LLVM IR (-O2):
define i32 @xrop3_146_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = and i32 %8, %4
%10 = xor i32 %7, %9
%11 = xor i32 %10, 255
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ SSLeay_add_all_algorithms();
void util_openssl_init() {
  char *tbuf[64];
  SSLeay_add_all_algorithms();
  SSL_library_init();
  SSL_load_error_strings();
  ERR_load_crypto_strings();
}


x86 assembly (clang, -O0):
<util_openssl_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
mov    $0x0,%al
call   1030 <SSLeay_add_all_algorithms@plt>
mov    $0x0,%al
call   1040 <SSL_library_init@plt>
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1060 <ERR_load_crypto_strings@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_openssl_init>:
push   %rax
xor    %eax,%eax
call   1030 <SSLeay_add_all_algorithms@plt>
xor    %eax,%eax
call   1040 <SSL_library_init@plt>
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <ERR_load_crypto_strings@plt>

LLVM IR (-O0):
define void @util_openssl_init() {
%1 = alloca [64 x i8*]
%2 = call i32 (...) @SSLeay_add_all_algorithms()
%3 = call i32 (...) @SSL_library_init()
%4 = call i32 (...) @SSL_load_error_strings()
%5 = call i32 (...) @ERR_load_crypto_strings()
ret void
}

LLVM IR (-O2):
define void @util_openssl_init() {
%1 = tail call i32 (...) @SSLeay_add_all_algorithms()
%2 = tail call i32 (...) @SSL_library_init()
%3 = tail call i32 (...) @SSL_load_error_strings()
%4 = tail call i32 (...) @ERR_load_crypto_strings()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void dw_solver(double **val, int maxNodes, int8_t *Q) { return; }


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

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

LLVM IR (-O0):
define void @dw_solver(double** %0, i32 %1, i32* %2) {
%4 = alloca double**
%5 = alloca i32
%6 = alloca i32*
store double** %0, double*** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
define void @dw_solver(double** nocapture %0, i32 %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf26(int f, int n) { return (cbuf(f, n, 26)); }


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

x86 assembly (clang, -O2):
<cbuf26>:
mov    $0x1a,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf26(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 @cbuf(i32 %5, i32 %6, i32 26)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf26(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 26)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int isOnlyInstance();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main() {
  printf("%d\n", isOnlyInstance());
  fflush(stdout);
  sleep(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <isOnlyInstance@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <isOnlyInstance@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @isOnlyInstance()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @sleep(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_mcwd_file_name(char *);
int /*<<< orphan*/ unlink(char *);
void unlink_mcwd() {
  char file[1024 + 1];
  get_mcwd_file_name(file);
  unlink(file);
}


x86 assembly (clang, -O0):
<unlink_mcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x410(%rbp),%rdi
call   1040 <get_mcwd_file_name@plt>
lea    -0x410(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_mcwd>:
push   %rbx
sub    $0x410,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <get_mcwd_file_name@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @unlink_mcwd() {
%1 = alloca [1025 x i8]
%2 = getelementptr inbounds [1025 x i8], [1025 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_mcwd_file_name(i8* %2)
%4 = getelementptr inbounds [1025 x i8], [1025 x i8]* %1, i64 0, i64 0
%5 = call i32 @unlink(i8* %4)
ret void
}

LLVM IR (-O2):
define void @unlink_mcwd() {
%1 = alloca [1025 x i8]
%2 = getelementptr inbounds [1025 x i8], [1025 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_mcwd_file_name(i8* %2)
%4 = call i32 @unlink(i8* %2)
ret void
}
/* Variables and functions */
char *concatenate(char *, char *, int, char *, char const *);
int /*<<< orphan*/ free(char *);
char *get_user_directory(char const *, char const *);
char *get_user_subdirectory(const char *tt_root, const char *user,
                            const char *subdir) {
  char *user_dir = get_user_directory(tt_root, user);
  char *result = concatenate("%s/%s", "user subdir", 2, user_dir, subdir);
  free(user_dir);
  return result;
}


x86 assembly (clang, -O0):
<get_user_subdirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get_user_directory@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe9c(%rip),%rdi
lea    0xe9b(%rip),%rsi
mov    $0x2,%edx
call   1050 <concatenate@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_subdirectory>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1040 <get_user_directory@plt>
mov    %rax,%rbx
lea    0xeba(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x2,%edx
mov    %rax,%rcx
mov    %r14,%r8
call   1050 <concatenate@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [12 x i8] c"user subdir\00"
define i8* @get_user_subdirectory(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i8* @get_user_directory(i8* %9, i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %6
%14 = call i8* @concatenate(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %12, i8* %13)
store i8* %14, i8** %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %8
ret i8* %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [12 x i8] c"user subdir\00"
define i8* @get_user_subdirectory(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @get_user_directory(i8* %0, i8* %1)
%5 = tail call i8* @concatenate(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %4, i8* %2)
%6 = tail call i32 @free(i8* %4)
ret i8* %5
}
int numLimbs(const int *pLen) {
  int nbrLimbs = *pLen;
  if (nbrLimbs < 0) {
    nbrLimbs = -nbrLimbs;
  }
  return nbrLimbs;
}


x86 assembly (clang, -O0):
<numLimbs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1123 <numLimbs+0x23>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numLimbs>:
mov    (%rdi),%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numLimbs(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @llvm.abs.i32(i32 %2, i1 true)
ret i32 %3
}
int iperf_udp_init(struct iperf_test *test) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iperf_test = type opaque
define i32 @iperf_udp_init(%struct.iperf_test* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Set32(int, int);
void do_sys_reboot() {
  Set32(0x20100024, 0x5A000000 | 1);
  Set32(0x2010001c, 0x5A000000 | 0x00000020);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<do_sys_reboot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20100024,%edi
mov    $0x5a000001,%esi
call   1030 <Set32@plt>
mov    $0x2010001c,%edi
mov    $0x5a000020,%esi
call   1030 <Set32@plt>
jmp    1132 <do_sys_reboot+0x22>

x86 assembly (clang, -O2):
<do_sys_reboot>:
push   %rax
mov    $0x20100024,%edi
mov    $0x5a000001,%esi
call   1030 <Set32@plt>
mov    $0x2010001c,%edi
mov    $0x5a000020,%esi
call   1030 <Set32@plt>
nop
jmp    1130 <do_sys_reboot+0x20>

LLVM IR (-O0):
define void @do_sys_reboot() {
%1 = call i32 @Set32(i32 537919524, i32 1509949441)
%2 = call i32 @Set32(i32 537919516, i32 1509949472)
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define void @do_sys_reboot() {
%1 = tail call i32 @Set32(i32 537919524, i32 1509949441)
%2 = tail call i32 @Set32(i32 537919516, i32 1509949472)
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int is_memregion_null(void *addr, size_t size) {
  size_t i = size - 1;
  unsigned char *ptr = (unsigned char *)addr;
  while (!ptr[i] && i) {
    i--;
  }
  return i;
}


x86 assembly (clang, -O0):
<is_memregion_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
cmpb   $0x0,(%rcx,%rdx,1)
mov    %al,-0x21(%rbp)
jne    1142 <is_memregion_null+0x42>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1152 <is_memregion_null+0x52>
jmp    1163 <is_memregion_null+0x63>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <is_memregion_null+0x20>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_memregion_null>:
lea    -0x1(%rsi),%rax
cmpb   $0x0,-0x1(%rdi,%rsi,1)
jne    1114 <is_memregion_null+0x14>
cmp    $0x1,%rsi
mov    %rax,%rsi
jne    1100 <is_memregion_null>
ret

LLVM IR (-O0):
define i32 @is_memregion_null(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = sub i64 %7, 1
store i64 %8, i64* %5
%9 = load i8*, i8** %3
store i8* %9, i8** %6
br label %10
10: ; preds = %21, %2
%11 = load i8*, i8** %6
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %16, %10
%20 = phi i1 [ false, %10 ], [ %18, %16 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i64, i64* %5
%23 = add i64 %22, -1
store i64 %23, i64* %5
br label %10
24: ; preds = %19
%25 = load i64, i64* %5
%26 = trunc i64 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_memregion_null(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %1, %2 ], [ %5, %3 ]
%5 = add i64 %4, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = icmp ne i64 %5, 0
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = trunc i64 %5 to i32
ret i32 %12
}
void mempool_free_slab(void *element, void *pool_data) { return; }


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

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

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

LLVM IR (-O2):
define void @mempool_free_slab(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void prnt() {
  asm volatile("movq $0x8, %%rdi\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r15, %%rsp\n\t"
               "callq *%%r12\n\t"
               "movq %%rsp, %%r15\n\t"
               "movq %%r13, %%rsp\n\t"
               "addq $0x8, %%rsp\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<prnt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prnt>:
mov    $0x8,%rdi
mov    %rsp,%r13
mov    %r15,%rsp
call   *%r12
mov    %rsp,%r15
mov    %r13,%rsp
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @prnt() {
tail call void asm sideeffect "movq $$0x8, %rdi\0A\09movq %rsp, %r13\0A\09movq %r15, %rsp\0A\09callq *%r12\0A\09movq %rsp, %r15\0A\09movq %r13, %rsp\0A\09addq $$0x8, %rsp\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void __attribute__((weak)) dma1_channel4_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dma1_channel4_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma1_channel4_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma1_channel4_isr = [18 x i8] c"dma1_channel4_isr\00"
define weak void @dma1_channel4_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.dma1_channel4_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma1_channel4_isr = [18 x i8] c"dma1_channel4_isr\00"
define weak void @dma1_channel4_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.dma1_channel4_isr, i64 0, i64 0))
ret void
}
double Rad2Km(const double rad) { return rad * 6371; }


x86 assembly (clang, -O0):
<Rad2Km>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @Rad2Km(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 6.371000e+03
ret double %4
}

LLVM IR (-O2):
define double @Rad2Km(double %0) {
%2 = fmul double %0, 6.371000e+03
ret double %2
}
void fdd_init() {}


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

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

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

LLVM IR (-O2):
define void @fdd_init() {
ret void
}
void XtErrorMsg() {}


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

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

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

LLVM IR (-O2):
define void @XtErrorMsg() {
ret void
}
unsigned int rtcDisable(void) {
  while ((*((volatile unsigned int *const)((0x40010000 + 0) + 0x48))))
    ;
  ;
  (*((volatile unsigned int *const)(0x40010a00 + 0x04))) = (0x7fff << 16);
  return 0;
}


x86 assembly (clang, -O0):
<rtcDisable>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <rtcDisable+0x9>
mov    $0x40010048,%eax
mov    (%rax),%eax
cmp    $0x0,%eax
je     111e <rtcDisable+0x1e>
jmp    1109 <rtcDisable+0x9>
mov    $0x40010a04,%eax
movl   $0x7fff0000,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcDisable>:
cmpl   $0x0,0x40010048
jne    1100 <rtcDisable>
movl   $0x7fff0000,0x40010a04
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rtcDisable() {
br label %1
1: ; preds = %4, %0
%2 = load volatile i32, i32* inttoptr (i64 1073807432 to i32*)
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
store volatile i32 2147418112, i32* inttoptr (i64 1073809924 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @rtcDisable() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1073807432 to i32*)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
store volatile i32 2147418112, i32* inttoptr (i64 1073809924 to i32*)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
scalar_t__ memcpy(void *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *s) {
  size_t len = strlen(s) + 1;
  void *new = malloc(len);
  if (new == NULL)
    return NULL;
  return (char *)memcpy(new, s, len);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    1188 <strdup+0x58>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <strdup+0x2f>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
jmp    1161 <strdup+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %1
store i8* null, i8** %2
br label %21
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = load i64, i64* %4
%19 = call i64 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %2
br label %21
21: ; preds = %15, %14
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i64 @memcpy(i8* %5, i8* %0, i64 %4)
%9 = inttoptr i64 %8 to i8*
br label %10
10: ; preds = %1, %7
%11 = phi i8* [ %9, %7 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
bool is_passable(int x, int y) {
  int type_index;
  if (x < 0 || x >= 40 || y < 0 || y >= 20) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<is_passable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1132 <is_passable+0x32>
cmpl   $0x28,-0x8(%rbp)
jge    1132 <is_passable+0x32>
cmpl   $0x0,-0xc(%rbp)
jl     1132 <is_passable+0x32>
cmpl   $0x14,-0xc(%rbp)
jl     113e <is_passable+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <is_passable+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_passable>:
cmp    $0x28,%edi
setb   %al
cmp    $0x14,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_passable(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 40
%4 = icmp ult i32 %1, 20
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char const *version_get_version();
const char *plugin_api_info_version_cb(void *data, const char *info_name,
                                       const char *arguments) {
  (void)data;
  (void)info_name;
  (void)arguments;
  return version_get_version();
}


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

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

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

LLVM IR (-O2):
define i8* @plugin_api_info_version_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* (...) @version_get_version()
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, int);
void foo(int *ptr) {
  int val = 10;
  ptr = &val;
  *ptr = 30;
  printf("Address of 'ptr' inside foo(): %p: %d\n", (void *)ptr, *ptr);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1e,(%rax)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
movl   $0x1e,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1e,%edx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Address of 'ptr' inside foo(): %p: %d\0A\00"
define void @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 10, i32* %3
store i32* %3, i32** %2
%4 = load i32*, i32** %2
store i32 30, i32* %4
%5 = load i32*, i32** %2
%6 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Address of 'ptr' inside foo(): %p: %d\0A\00"
define void @foo(i32* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 30, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3, i32 30)
ret void
}
int toku_fs_unmount(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @toku_fs_unmount() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int manglerFunction(int, int);
uint64_t computeEncryptionRound(int round_num, uint64_t input, uint64_t key) {
  uint32_t R = input;
  uint32_t L = (uint64_t)(input >> 32);
  uint64_t output = (uint64_t)(R) << 32;
  uint32_t mangle = manglerFunction(key, R);
  output = output | (mangle ^ L);
  return output;
}


x86 assembly (clang, -O0):
<computeEncryptionRound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <manglerFunction@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
xor    -0x14(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeEncryptionRound>:
mov    %edx,%edi
jmp    1030 <manglerFunction@plt>

LLVM IR (-O0):
define i32 @computeEncryptionRound(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %5
store i32 %11, i32* %7
%12 = load i32, i32* %5
%13 = ashr i32 %12, 32
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = shl i32 %14, 32
store i32 %15, i32* %9
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @manglerFunction(i32 %16, i32 %17)
store i32 %18, i32* %10
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = load i32, i32* %8
%22 = xor i32 %20, %21
%23 = or i32 %19, %22
store i32 %23, i32* %9
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @computeEncryptionRound(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @manglerFunction(i32 %2, i32 %1)
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t pgm_read_byte(const void *ptr) { return *((const uint8_t *)ptr); }


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

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

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

LLVM IR (-O2):
define i32 @pgm_read_byte(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x9e() {
  Assert_real((isodigit(158) == 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_isodigit.c",
              795, ("isodigit should be 0 for 0x9e"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x9e>:
push   %rax
mov    $0x9e,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x31b,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9e\00"
define void @t_isodigit_0x9e() {
%1 = call i64 @isodigit(i32 158)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 795, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9e\00"
define void @t_isodigit_0x9e() {
%1 = tail call i64 @isodigit(i32 158)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 795, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void glGetTexEnvxv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetTexEnvxv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ testNPN();
void _M2_npn_init(__attribute__((unused)) int argc,
                  __attribute__((unused)) char *argv[]) {
  init();
  testNPN();
}


x86 assembly (clang, -O0):
<_M2_npn_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <init@plt>
mov    $0x0,%al
call   1040 <testNPN@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_M2_npn_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @init()
%6 = call i32 (...) @testNPN()
ret void
}

LLVM IR (-O2):
define void @_M2_npn_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @testNPN()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int);
int /*<<< orphan*/ usleep(int);
void write_sync(void) {
  gpio_set(27, 1);
  usleep((4 * 80));
  gpio_set(27, 0);
  usleep(31 * (4 * 80));
}


x86 assembly (clang, -O0):
<write_sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x26c0,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sync>:
push   %rax
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x26c0,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @write_sync() {
%1 = call i32 @gpio_set(i32 27, i32 1)
%2 = call i32 @usleep(i32 320)
%3 = call i32 @gpio_set(i32 27, i32 0)
%4 = call i32 @usleep(i32 9920)
ret void
}

LLVM IR (-O2):
define void @write_sync() {
%1 = tail call i32 @gpio_set(i32 27, i32 1)
%2 = tail call i32 @usleep(i32 320)
%3 = tail call i32 @gpio_set(i32 27, i32 0)
%4 = tail call i32 @usleep(i32 9920)
ret void
}
void touch_uint(unsigned int *x) {}


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

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

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

LLVM IR (-O2):
define void @touch_uint(i32* nocapture %0) {
ret void
}