xunge/DecIR huggingface dataset:
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, c;
  scanf("%d", &n);
  c = is_prime(n);
  printf("%d\n", c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int hash_plugin_hash_length(void) { return 64; }


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

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

LLVM IR (-O0):
define i32 @hash_plugin_hash_length() {
ret i32 64
}

LLVM IR (-O2):
define i32 @hash_plugin_hash_length() {
ret i32 64
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int function_one() {
  printf("This is function one\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"This is function one\0A\00"
define i32 @function_one() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"This is function one\00"
define i32 @function_one() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void org_trifort_threadfence() {}


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

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

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

LLVM IR (-O2):
define void @org_trifort_threadfence() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wa_abort();
void wa_signal_handler(int signum) { wa_abort(); }


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

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

LLVM IR (-O0):
define void @wa_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @wa_abort()
ret void
}

LLVM IR (-O2):
define void @wa_signal_handler(i32 %0) {
%2 = tail call i32 (...) @wa_abort()
ret void
}
int modulus(int num1, int num2) { return num1 % num2; }


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

x86 assembly (clang, -O2):
<modulus>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modulus(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @modulus(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int createFiles(int);
int main() {
  int result;
  result = createFiles(100);
  return (result != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1030 <createFiles@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <createFiles@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @createFiles(i32 100)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @createFiles(i32 100)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int isArm(int a) {
  int number = a;
  int remd;
  int result = 0;
  while (number != 0) {
    remd = number % 10;
    result += remd * remd * remd;
    number /= 10;
  }
  if (result == a)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<isArm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1150 <isArm+0x50>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <isArm+0x14>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1168 <isArm+0x68>
movl   $0x0,-0x4(%rbp)
jmp    116f <isArm+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isArm>:
xor    %r9d,%r9d
test   %edi,%edi
je     1146 <isArm+0x46>
mov    %edi,%eax
nopl   0x0(%rax)
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%r8d
mov    %edx,%ecx
sub    %r8d,%ecx
mov    %ecx,%esi
imul   %ecx,%esi
imul   %ecx,%esi
add    %esi,%r9d
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <isArm+0x10>
xor    %eax,%eax
cmp    %edi,%r9d
setne  %al
ret

LLVM IR (-O0):
define i32 @isArm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
%7 = load i32, i32* %3
store i32 %7, i32* %4
store i32 0, i32* %6
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32, i32* %4
%13 = srem i32 %12, 10
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %5
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, %18
store i32 %20, i32* %6
%21 = load i32, i32* %4
%22 = sdiv i32 %21, 10
store i32 %22, i32* %4
br label %8
23: ; preds = %8
%24 = load i32, i32* %6
%25 = load i32, i32* %3
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 0, i32* %2
br label %29
28: ; preds = %23
store i32 1, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @isArm(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %6, %6
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %8, %4
%10 = sdiv i32 %5, 10
%11 = add i32 %5, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %9, %3 ]
%15 = icmp ne i32 %14, %0
%16 = zext i1 %15 to i32
ret i32 %16
}
int test_imm_44uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x44 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_44uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x44,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_44uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 68
%7 = icmp ne i64 %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_44uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 292057776128
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void Reserved_Handler13(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Reserved_Handler13() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_SLAVE(unsigned int i) {
  return (REG_SPI_BASE(i) + 0x30);
}


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

x86 assembly (clang, -O2):
<SPI_SLAVE>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0x30,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @SPI_SLAVE(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void reset_all_irqs() {
  printf("************************************\n");
  printf("********** reset all irqs **********\n");
  printf("************************************\n");
  printf("interrupt_register 0x%X \n\n", *((unsigned char *)(0xfffc0003)));
}


x86 assembly (clang, -O0):
<reset_all_irqs>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0003,%eax
movzbl (%rax),%esi
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_all_irqs>:
push   %rbx
lea    0xf18(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xfffc0003,%eax
movzbl (%rax),%esi
lea    0xead(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"************************************\0A\00"
@.str.1 = [38 x i8] c"********** reset all irqs **********\0A\00"
@.str.2 = [27 x i8] c"interrupt_register 0x%X \0A\0A\00"
define void @reset_all_irqs() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* inttoptr (i64 4294705155 to i8*)
%5 = zext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str.2 = [27 x i8] c"interrupt_register 0x%X \0A\0A\00"
@str.3 = [37 x i8] c"********** reset all irqs **********\00"
@str.4 = [37 x i8] c"************************************\00"
define void @reset_all_irqs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
%4 = load i8, i8* inttoptr (i64 4294705155 to i8*)
%5 = zext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
void EVP_MD_CTX_md(void) {}


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

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

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

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

/* Variables and functions */
int PesPayloadOffset(const uint8_t *p) { return 9 + p[8]; }


x86 assembly (clang, -O0):
<PesPayloadOffset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
add    $0x9,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PesPayloadOffset>:
mov    0x20(%rdi),%eax
add    $0x9,%eax
ret

LLVM IR (-O0):
define i32 @PesPayloadOffset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
%6 = add nsw i32 9, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @PesPayloadOffset(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 9
ret i32 %4
}
int encode(char text[]) {
  int i = 0;
  int encoded[sizeof(text) / sizeof(text[0])];
  while (text[i]) {
    encoded[i] = text[i];
    i++;
  }
  return encoded;
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1143 <encode+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <encode+0xf>
lea    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
mov    (%rdi),%al
test   %al,%al
je     1124 <encode+0x24>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movsbl %al,%eax
mov    %eax,-0x28(%rsp,%rcx,4)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <encode+0x10>
lea    -0x28(%rsp),%rax
ret

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

LLVM IR (-O2):
define i32 @encode(i8* nocapture %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i64 [ %11, %6 ], [ 0, %1 ]
%8 = phi i8 [ %13, %6 ], [ %4, %1 ]
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %1
%16 = ptrtoint [8 x i32]* %2 to i64
%17 = trunc i64 %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ printf(char *, ...);
void trace_glFlush(void) {
  printf("%20s(", "glFlush");
  printf(");\n");
  glFlush();
}


x86 assembly (clang, -O0):
<trace_glFlush>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_glFlush>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [8 x i8] c"glFlush\00"
@.str.2 = [4 x i8] c");\0A\00"
define void @trace_glFlush() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [8 x i8] c"glFlush\00"
@str = [3 x i8] c");\00"
define void @trace_glFlush() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
scalar_t__ get_group_by_name(char *);
int system_has_audiogroup() {
  return get_group_by_name("audio") || get_group_by_name("jackuser");
}


x86 assembly (clang, -O0):
<system_has_audiogroup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <get_group_by_name@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    114c <system_has_audiogroup+0x3c>
lea    0xec9(%rip),%rdi
call   1030 <get_group_by_name@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_has_audiogroup>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <get_group_by_name@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112c <system_has_audiogroup+0x1c>
pop    %rcx
ret
lea    0xed3(%rip),%rdi
call   1030 <get_group_by_name@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"audio\00"
@.str.1 = [9 x i8] c"jackuser\00"
define i32 @system_has_audiogroup() {
%1 = call i64 @get_group_by_name(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 @get_group_by_name(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"audio\00"
@.str.1 = [9 x i8] c"jackuser\00"
define i32 @system_has_audiogroup() {
%1 = tail call i64 @get_group_by_name(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @get_group_by_name(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
long atomic_load_n_long(long *ptr, int memorder) {
  return __atomic_load_n(ptr, memorder);
}


x86 assembly (clang, -O0):
<atomic_load_n_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     114b <atomic_load_n_long+0x4b>
jmp    112a <atomic_load_n_long+0x2a>
mov    -0x1c(%rbp),%eax
sub    $0x5,%eax
je     115b <atomic_load_n_long+0x5b>
jmp    113b <atomic_load_n_long+0x3b>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1166 <atomic_load_n_long+0x66>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1166 <atomic_load_n_long+0x66>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_load_n_long>:
lea    -0x1(%rsi),%eax
cmp    $0x2,%eax
jb     110b <atomic_load_n_long+0xb>
cmp    $0x5,%esi
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @atomic_load_n_long(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i64*, i64** %3
%7 = load i32, i32* %4
switch i32 %7, label %8 [
i32 1, label %10
i32 2, label %10
i32 5, label %12
]
8: ; preds = %2
%9 = load atomic i64, i64* %6 monotonic
store i64 %9, i64* %5
br label %14
10: ; preds = %2, %2
%11 = load atomic i64, i64* %6 acquire
store i64 %11, i64* %5
br label %14
12: ; preds = %2
%13 = load atomic i64, i64* %6 seq_cst
store i64 %13, i64* %5
br label %14
14: ; preds = %12, %10, %8
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @atomic_load_n_long(i64* nocapture %0, i32 %1) {
switch i32 %1, label %3 [
i32 1, label %5
i32 2, label %5
i32 5, label %7
]
3: ; preds = %2
%4 = load atomic i64, i64* %0 monotonic
br label %9
5: ; preds = %2, %2
%6 = load atomic i64, i64* %0 acquire
br label %9
7: ; preds = %2
%8 = load atomic i64, i64* %0 seq_cst
br label %9
9: ; preds = %7, %5, %3
%10 = phi i64 [ %4, %3 ], [ %8, %7 ], [ %6, %5 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errStackTooBig(void) {
  error("Too big stack or too much data (or code)\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"Too big stack or too much data (or code)\0A\00"
define void @errStackTooBig() {
%1 = call i32 @error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Too big stack or too much data (or code)\0A\00"
define void @errStackTooBig() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int runCommand(int, char **);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc <= 1)
    usage();
  return runCommand(argc - 1, argv + 1);
}


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)
cmpl   $0x1,-0x8(%rbp)
jg     1147 <main+0x27>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <runCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x1,%edi
jg     1134 <main+0x14>
xor    %eax,%eax
call   1040 <usage@plt>
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <runCommand@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = call i32 @runCommand(i32 %12, i8** %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = add nsw i32 %0, -1
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = tail call i32 @runCommand(i32 %7, i8** %8)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ murmur3_final(int /*<<< orphan*/, int);
int /*<<< orphan*/ murmur3_update(int /*<<< orphan*/, int);
uint32_t murmur3_u64(uint32_t hash, uint64_t val) {
  hash = murmur3_update(hash, val);
  hash = murmur3_update(hash, val >> 32);
  return murmur3_final(hash, sizeof(val));
}


x86 assembly (clang, -O0):
<murmur3_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <murmur3_update@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <murmur3_update@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <murmur3_final@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<murmur3_u64>:
push   %rax
call   1030 <murmur3_update@plt>
mov    %eax,%edi
call   1030 <murmur3_update@plt>
mov    %eax,%edi
mov    $0x4,%esi
pop    %rax
jmp    1040 <murmur3_final@plt>

LLVM IR (-O0):
define i32 @murmur3_u64(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 @murmur3_update(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 32
%11 = call i32 @murmur3_update(i32 %8, i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @murmur3_final(i32 %12, i32 4)
ret i32 %13
}

LLVM IR (-O2):
define i32 @murmur3_u64(i32 %0, i32 %1) {
%3 = tail call i32 @murmur3_update(i32 %0, i32 %1)
%4 = tail call i32 @murmur3_update(i32 %3, i32 poison)
%5 = tail call i32 @murmur3_final(i32 %4, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(int);
int /*<<< orphan*/ perror(char *);
void *emalloc(int size) {
  void *ptr = malloc(size);
  if (!ptr) {
    perror("Out of memory");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <emalloc+0x38>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <emalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @emalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @emalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
void write_byte(unsigned char c) { (*((char *)0x04)) = c; }


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x4,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
mov    %dil,0x4
ret

LLVM IR (-O0):
define void @write_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store i8 %3, i8* inttoptr (i64 4 to i8*)
ret void
}

LLVM IR (-O2):
define void @write_byte(i8 zeroext %0) {
store i8 %0, i8* inttoptr (i64 4 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clnt_spcreateerror(char const *);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void clnt_pcreateerror(const char *msg) {
  (void)fputs(clnt_spcreateerror(msg), stderr);
}


x86 assembly (clang, -O0):
<clnt_pcreateerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clnt_spcreateerror@plt>
mov    %eax,%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clnt_pcreateerror>:
push   %rax
call   1040 <clnt_spcreateerror@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @clnt_pcreateerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @clnt_spcreateerror(i8* %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @clnt_pcreateerror(i8* %0) {
%2 = tail call i32 @clnt_spcreateerror(i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ postamble();
int /*<<< orphan*/ preamble();
int /*<<< orphan*/ walkpages();
void dvimain() {
  postamble();
  preamble();
  walkpages();
}


x86 assembly (clang, -O0):
<dvimain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <postamble@plt>
mov    $0x0,%al
call   1050 <preamble@plt>
mov    $0x0,%al
call   1030 <walkpages@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvimain>:
push   %rax
xor    %eax,%eax
call   1040 <postamble@plt>
xor    %eax,%eax
call   1050 <preamble@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <walkpages@plt>

LLVM IR (-O0):
define void @dvimain() {
%1 = call i32 (...) @postamble()
%2 = call i32 (...) @preamble()
%3 = call i32 (...) @walkpages()
ret void
}

LLVM IR (-O2):
define void @dvimain() {
%1 = tail call i32 (...) @postamble()
%2 = tail call i32 (...) @preamble()
%3 = tail call i32 (...) @walkpages()
ret void
}
double calc_veg_height(double displacement) {
  double value;
  value = displacement / 0.67;
  return (value);
}


x86 assembly (clang, -O0):
<calc_veg_height>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @calc_veg_height(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 6.700000e-01
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @calc_veg_height(double %0) {
%2 = fdiv double %0, 6.700000e-01
ret double %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int *ai1d(int X) {
  int *A = (int *)malloc(X * sizeof(int *));
  return A;
}


x86 assembly (clang, -O0):
<ai1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai1d>:
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @ai1d(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @ai1d(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ debug_msg(char *);
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
void pwd() {
  debug_msg("Executing pwd (builtin)");
  char *path = getenv("PWD");
  printf("%s\n", path);
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <debug_msg@plt>
lea    0xecd(%rip),%rdi
call   1040 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <debug_msg@plt>
lea    0xed4(%rip),%rdi
call   1040 <getenv@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Executing pwd (builtin)\00"
@.str.1 = [4 x i8] c"PWD\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @pwd() {
%1 = alloca i8*
%2 = call i32 @debug_msg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Executing pwd (builtin)\00"
@.str.1 = [4 x i8] c"PWD\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @pwd() {
%1 = tail call i32 @debug_msg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ common_log(int, char *, char *);
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
void *__common_allocate(size_t size, char *func_name) {
  void *temp = malloc(size);
  if (temp == NULL) {
    common_log(2, func_name, ": Out of memory");
    exit(1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<__common_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <__common_allocate+0x47>
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
lea    0xe98(%rip),%rdx
call   1030 <common_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__common_allocate>:
push   %rbx
mov    %rsi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <__common_allocate+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdx
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <common_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c": Out of memory\00"
define i8* @__common_allocate(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @common_log(i32 2, i8* %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [16 x i8] c": Out of memory\00"
define noalias i8* @__common_allocate(i64 %0, i8* %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @common_log(i32 2, i8* %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr,
          "Usage: odvr [options]\n"
          "-= Options =-\n"
          "  -h             : This help.\n"
          "  -v             : Print version.\n"
          "  -d <folder>    : Download all files in <folder>.\n"
          "  -e             : Download everything.\n"
          "  -l             : List all files.\n"
          "  -x <folder>    : Delete all recordings in <folder>.\n"
          "  -c             : Delete all recordings.\n"
          "  -y             : \"yes\" to all yes/no questions.\n"
          "  -r             : Reset the DVR. This may fix some sync issues.\n"
          "  -D             : Enable debug tracing.\n"
          "  -E             : Download everything in RAW format.\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [533 x i8] c"Usage: odvr [options]\0A-= Options =-\0A -h : This help.\0A -v : Print version.\0A -d <folder> : Download all files in <folder>.\0A -e : Download everything.\0A -l : List all files.\0A -x <folder> : Delete all recordings in <folder>.\0A -c : Delete all recordings.\0A -y : \22yes\22 to all yes/no questions.\0A -r : Reset the DVR. This may fix some sync issues.\0A -D : Enable debug tracing.\0A -E : Download everything in RAW format.\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([533 x i8], [533 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [533 x i8] c"Usage: odvr [options]\0A-= Options =-\0A -h : This help.\0A -v : Print version.\0A -d <folder> : Download all files in <folder>.\0A -e : Download everything.\0A -l : List all files.\0A -x <folder> : Delete all recordings in <folder>.\0A -c : Delete all recordings.\0A -y : \22yes\22 to all yes/no questions.\0A -r : Reset the DVR. This may fix some sync issues.\0A -D : Enable debug tracing.\0A -E : Download everything in RAW format.\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([533 x i8], [533 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ ft_isalnum(int);
scalar_t__ ft_strchr(char *, int);
int ft_isprint(int c) {
  if (c == '\0')
    return (0);
  if (ft_isalnum(c) || ft_strchr(" !\"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~", c))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <ft_isprint+0x21>
movl   $0x0,-0x4(%rbp)
jmp    117f <ft_isprint+0x5f>
mov    -0x8(%rbp),%edi
call   1030 <ft_isalnum@plt>
cmp    $0x0,%rax
jne    116c <ft_isprint+0x4c>
mov    -0x8(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1040 <ft_strchr@plt>
cmp    $0x0,%rax
je     1178 <ft_isprint+0x58>
movl   $0x1,-0x4(%rbp)
jmp    117f <ft_isprint+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
push   %rbx
test   %edi,%edi
je     113b <ft_isprint+0x1b>
mov    %edi,%ebx
call   1030 <ft_isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113f <ft_isprint+0x1f>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1040 <ft_strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c" !\22#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\00"
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @ft_isalnum(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = call i64 @ft_strchr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [34 x i8] c" !\22#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\00"
define i32 @ft_isprint(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @ft_isalnum(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @ft_strchr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
double mapRange(double a1, double a2, double b1, double b2, double s) {
  return b1 + (s - a1) * (b2 - b1) / (a2 - a1);
}


x86 assembly (clang, -O0):
<mapRange>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapRange>:
subsd  %xmm0,%xmm4
subsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @mapRange(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %8
%12 = load double, double* %10
%13 = load double, double* %6
%14 = fsub double %12, %13
%15 = load double, double* %9
%16 = load double, double* %8
%17 = fsub double %15, %16
%18 = fmul double %14, %17
%19 = load double, double* %7
%20 = load double, double* %6
%21 = fsub double %19, %20
%22 = fdiv double %18, %21
%23 = fadd double %11, %22
ret double %23
}

LLVM IR (-O2):
define double @mapRange(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %4, %0
%7 = fsub double %3, %2
%8 = fmul double %7, %6
%9 = fsub double %1, %0
%10 = fdiv double %8, %9
%11 = fadd double %10, %2
ret double %11
}
void tcp_sack_reply(struct host_info *tx_host, struct host_info *rx_host,
                    struct tcp_segment *segment) {}


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

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

LLVM IR (-O0):
%struct.host_info = type opaque
%struct.tcp_segment = type opaque
define void @tcp_sack_reply(%struct.host_info* %0, %struct.host_info* %1, %struct.tcp_segment* %2) {
%4 = alloca %struct.host_info*
%5 = alloca %struct.host_info*
%6 = alloca %struct.tcp_segment*
store %struct.host_info* %0, %struct.host_info** %4
store %struct.host_info* %1, %struct.host_info** %5
store %struct.tcp_segment* %2, %struct.tcp_segment** %6
ret void
}

LLVM IR (-O2):
%struct.host_info = type opaque
%struct.tcp_segment = type opaque
define void @tcp_sack_reply(%struct.host_info* nocapture %0, %struct.host_info* nocapture %1, %struct.tcp_segment* nocapture %2) {
ret void
}
int SDL_imageFilterMultDivby2MMX(unsigned char *Src1, unsigned char *Src2,
                                 unsigned char *Dest, unsigned int SrcLength) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterMultDivby2MMX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterMultDivby2MMX(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterMultDivby2MMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ match(char);
int /*<<< orphan*/ printf(char *, char);
int expected(char c) {
  if (match(c))
    return 1;
  printf("expected %c", c);
  return 0;
}


x86 assembly (clang, -O0):
<expected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <match@plt>
cmp    $0x0,%rax
je     114d <expected+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1164 <expected+0x44>
lea    0xeac(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expected>:
push   %rbx
mov    %edi,%ebx
call   1040 <match@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <expected+0x17>
pop    %rbx
ret
movsbl %bl,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"expected %c\00"
define i32 @expected(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @match(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
%9 = load i8, i8* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %9)
store i32 0, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"expected %c\00"
define i32 @expected(i8 signext %0) {
%2 = tail call i64 @match(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}