xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t smpte_hbrmt_get_timestamp(const uint8_t *p_hbrmt) {
  return (p_hbrmt[8] << 24) | (p_hbrmt[9] << 16) | (p_hbrmt[10] << 8) |
         p_hbrmt[11];
}


x86 assembly (clang, -O0):
<smpte_hbrmt_get_timestamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x24(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x2c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_hbrmt_get_timestamp>:
mov    0x20(%rdi),%eax
mov    0x24(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x28(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x2c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @smpte_hbrmt_get_timestamp(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 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 9
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 10
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 11
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @smpte_hbrmt_get_timestamp(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 9
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 10
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 11
%14 = load i32, i32* %13
%15 = or i32 %12, %14
ret i32 %15
}
void BN_usub(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_usub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
__attribute__((noreturn)) void memory_exhausted(void) {
  fputs("memory exhausted", stderr);
  abort();
}


x86 assembly (clang, -O0):
<memory_exhausted>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<memory_exhausted>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"memory exhausted\00"
@stderr = global i32 0
define void @memory_exhausted() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"memory exhausted\00"
@stderr = global i32 0
define void @memory_exhausted() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int tolower(int const);
int asciitolower(const int c) { return c < 0x80 ? tolower(c) : c; }


x86 assembly (clang, -O0):
<asciitolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1138 <asciitolower+0x28>
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
jmp    113e <asciitolower+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asciitolower>:
cmp    $0x7f,%edi
jg     111a <asciitolower+0xa>
jmp    1030 <tolower@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @asciitolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 128
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @tolower(i32 %6)
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @asciitolower(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @tolower(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ %0, %1 ]
ret i32 %6
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
long int timeval_to_usec(struct timeval temp) {
  return temp.tv_sec * 1000000L + temp.tv_usec;
}


x86 assembly (clang, -O0):
<timeval_to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_usec>:
imul   $0xf4240,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @timeval_to_usec(i64 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @timeval_to_usec(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 1000000
%4 = add nsw i64 %3, %1
ret i64 %4
}
/* Variables and functions */
long lswap4(long);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
void write_len2blk(unsigned char *datablk, long len) {
  len = lswap4(len);
  memmove(datablk + 7, (unsigned char *)&len, sizeof(long));
}


x86 assembly (clang, -O0):
<write_len2blk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lswap4@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memmove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_len2blk>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <lswap4@plt>
mov    %rax,0x8(%rsp)
add    $0x7,%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memmove@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @write_len2blk(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @lswap4(i64 %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 7
%9 = bitcast i64* %4 to i8*
%10 = call i32 @memmove(i8* %8, i8* %9, i32 8)
ret void
}

LLVM IR (-O2):
define void @write_len2blk(i8* %0, i64 %1) {
%3 = alloca i64
%4 = tail call i64 @lswap4(i64 %1)
store i64 %4, i64* %3
%5 = getelementptr inbounds i8, i8* %0, i64 7
%6 = bitcast i64* %3 to i8*
%7 = call i32 @memmove(i8* %5, i8* %6, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
void *echo(void *data) {
  const char *message = data;
  puts(message);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @echo(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @puts(i8* %5)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @echo(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_program();
int main() {
  create_letter_distribution_program();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @create_letter_distribution_program()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  void *(*)(void *), void *);
void tkBeginThread(void *(*pa_thread)(void *), void *pa_else) {
  pthread_t id;
  pthread_create(&id, 0, pa_thread, pa_else);
}


x86 assembly (clang, -O0):
<tkBeginThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
call   1030 <pthread_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tkBeginThread>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <pthread_create@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @tkBeginThread(i8* (i8*)* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @pthread_create(i32* %3, i32 0, i8* (i8*)* %0, i8* %1)
ret void
}
int initialize_barometer_sensor(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @initialize_barometer_sensor(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
void array_heap_cleanup(void *s) { return; }


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

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

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

LLVM IR (-O2):
define void @array_heap_cleanup(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_mul_521(uint64_t c[18], uint64_t a[9], uint64_t b[9]) {
  c[0] = a[1] + b[2];
  return 0;
}


x86 assembly (clang, -O0):
<mp_mul_521>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rax
add    0x10(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_521>:
mov    0x10(%rdx),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_mul_521(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %5
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = load i64*, i64** %6
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = add nsw i64 %9, %12
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 0
store i64 %13, i64* %15
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_mul_521(i64* nocapture writeonly %0, i64* nocapture %1, i64* nocapture %2) {
%4 = getelementptr inbounds i64, i64* %1, i64 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds i64, i64* %2, i64 2
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
store i64 %8, i64* %0
ret i64 0
}
void handleSimpleCycle(unsigned long long int *possibleEquivalentOneSets,
                       unsigned long long int *edgesInCycle,
                       int *negativeEdgesInCycle) {
  if ((*negativeEdgesInCycle) % 2 == 0) {
    *possibleEquivalentOneSets &= ~(*edgesInCycle);
  }
}


x86 assembly (clang, -O0):
<handleSimpleCycle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113c <handleSimpleCycle+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x8(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleSimpleCycle>:
testb  $0x1,(%rdx)
jne    110e <handleSimpleCycle+0xe>
mov    (%rsi),%rax
not    %rax
and    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @handleSimpleCycle(i64* nocapture %0, i64* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i64, i64* %1
%9 = xor i64 %8, -1
%10 = load i64, i64* %0
%11 = and i64 %10, %9
store i64 %11, i64* %0
br label %12
12: ; preds = %7, %3
ret void
}
void __attribute__((weak)) dma1_channel7_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dma1_channel7_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_channel7_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @fun() {
ret void
}
int test_imm_DCuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xDC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DCuint64_midword_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, 16
%6 = and i64 %5, 220
%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_DCuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14417920
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: -[d|i|g] <file >file\n");
  exit(33);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x21,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x21,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"usage: -[d|i|g] <file >file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 33)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"usage: -[d|i|g] <file >file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 33)
unreachable
}
/* Variables and functions */
int g(int);
__attribute((always_)) f(int i) { return 1 + g(i); }


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

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @g(i32 %3)
%5 = add nsw i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @g(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int /*<<< orphan*/ g(int *);
void solution01(void) {
  int num = 100;
  int *arg = &num;
  int **arg2 = &arg;
  f(arg);
  g(*arg2);
}


x86 assembly (clang, -O0):
<solution01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x64,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <f@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <g@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solution01>:
push   %rbx
sub    $0x10,%rsp
movl   $0x64,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <g@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @solution01() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
store i32 100, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%4 = load i32*, i32** %2
%5 = call i32 @f(i32* %4)
%6 = load i32**, i32*** %3
%7 = load i32*, i32** %6
%8 = call i32 @g(i32* %7)
ret void
}

LLVM IR (-O2):
define void @solution01() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%3 = call i32 @f(i32* %1)
%4 = call i32 @g(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
bool fileExists(const char *filename) { return access(filename, F_OK) != -1; }


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

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @fileExists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @fileExists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello, world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pprint(char *);
void describe_audio_state_1(void) { pprint("audio stubbed out"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"audio stubbed out\00"
define void @describe_audio_state_1() {
%1 = call i32 @pprint(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"audio stubbed out\00"
define void @describe_audio_state_1() {
%1 = tail call i32 @pprint(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int convert_3d_indices_to_linear_index_inline(int, int, int, int, int, int);
int convert_3d_indices_to_linear_index(int *index_vector, int *nx_ny_nz) {
  return convert_3d_indices_to_linear_index_inline(
      index_vector[0], index_vector[1], index_vector[2], nx_ny_nz[0],
      nx_ny_nz[1], nx_ny_nz[2]);
}


x86 assembly (clang, -O0):
<convert_3d_indices_to_linear_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r9d
call   1030 <convert_3d_indices_to_linear_index_inline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_3d_indices_to_linear_index>:
mov    (%rdi),%eax
mov    0x4(%rdi),%r10d
mov    0x8(%rdi),%edx
mov    (%rsi),%ecx
mov    0x4(%rsi),%r8d
mov    0x8(%rsi),%r9d
mov    %eax,%edi
mov    %r10d,%esi
jmp    1030 <convert_3d_indices_to_linear_index_inline@plt>

LLVM IR (-O0):
define i32 @convert_3d_indices_to_linear_index(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = call i32 @convert_3d_indices_to_linear_index_inline(i32 %7, i32 %10, i32 %13, i32 %16, i32 %19, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @convert_3d_indices_to_linear_index(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = load i32, i32* %1
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = tail call i32 @convert_3d_indices_to_linear_index_inline(i32 %3, i32 %5, i32 %7, i32 %8, i32 %10, i32 %12)
ret i32 %13
}
extern int os_init(int mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @os_init(i32 %0) {
ret i32 0
}
int getTam_lista(int *l) {
  int z = 0;
  int cont = 0;
  while (l[z] != '\0') {
    cont++;
    z++;
  }
  return cont;
}


x86 assembly (clang, -O0):
<getTam_lista>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113f <getTam_lista+0x3f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <getTam_lista+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTam_lista>:
cmpl   $0x0,(%rdi)
je     111c <getTam_lista+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x4(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <getTam_lista+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getTam_lista(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("usage: sha256sum [-hvb]\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"usage: sha256sum [-hvb]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
void txt_keysig(sf, mi) {
  prtime();
  printf("Key signature, sharp/flats=%d  minor=%d\n", sf, mi);
}


x86 assembly (clang, -O0):
<txt_keysig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_keysig>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xecb(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Key signature, sharp/flats=%d minor=%d\0A\00"
define void @txt_keysig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @prtime()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Key signature, sharp/flats=%d minor=%d\0A\00"
define void @txt_keysig(i32 %0, i32 %1) {
%3 = tail call i32 (...) @prtime()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ gen_bound(int /*<<< orphan*/ *, char *, int, int);
int /*<<< orphan*/ gen_lohi(int /*<<< orphan*/ *, int);
void gen_set_bound(FILE *outfile, char *regname, int dim, int lohi) {
  gen_bound(outfile, regname, dim, lohi);
  fprintf(outfile, " = ");
  gen_lohi(outfile, lohi);
  fprintf(outfile, ";\n");
}


x86 assembly (clang, -O0):
<gen_set_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <gen_bound@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1050 <gen_lohi@plt>
mov    -0x8(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_set_bound>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdi,%rbx
call   1030 <gen_bound@plt>
lea    0xebc(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <gen_lohi@plt>
lea    0xe9d(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" = \00"
@.str.1 = [3 x i8] c";\0A\00"
define void @gen_set_bound(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @gen_bound(i32* %9, i8* %10, i32 %11, i32 %12)
%14 = load i32*, i32** %5
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%16 = load i32*, i32** %5
%17 = load i32, i32* %8
%18 = call i32 @gen_lohi(i32* %16, i32 %17)
%19 = load i32*, i32** %5
%20 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" = \00"
@.str.1 = [3 x i8] c";\0A\00"
define void @gen_set_bound(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @gen_bound(i32* %0, i8* %1, i32 %2, i32 %3)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
%7 = tail call i32 @gen_lohi(i32* %0, i32 %3)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
int ifAll9s(int *num, int n) {
  int i;
  for (i = 0; i < n; ++i)
    if (num[i] != 9)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<ifAll9s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <ifAll9s+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x9,(%rax,%rcx,4)
je     113c <ifAll9s+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1156 <ifAll9s+0x56>
jmp    1141 <ifAll9s+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <ifAll9s+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifAll9s>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <ifAll9s+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpl   $0x9,(%rdi,%rdx,4)
jne    1120 <ifAll9s+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <ifAll9s+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ifAll9s(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
store i32 0, i32* %6
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 9
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 0, i32* %3
br label %24
19: ; preds = %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %7
23: ; preds = %7
store i32 1, i32* %3
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @ifAll9s(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 9
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(const char *progname) {
  printf("USAGE: pi [digits]\n");
  printf("compute pi to any specified digits, using continue fraction "
         "algorithm.\n");
  printf("-- xie zhigang, 2017-06-09\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"USAGE: pi [digits]\0A\00"
@.str.1 = [72 x i8] c"compute pi to any specified digits, using continue fraction algorithm.\0A\00"
@.str.2 = [28 x i8] c"-- xie zhigang, 2017-06-09\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"USAGE: pi [digits]\00"
@str.3 = [71 x i8] c"compute pi to any specified digits, using continue fraction algorithm.\00"
@str.4 = [27 x i8] c"-- xie zhigang, 2017-06-09\00"
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ saa7114_read_reg(int, unsigned char *);
char saa7114_get_decoder_hue(void) {
  unsigned char hue = 0;
  saa7114_read_reg(0x0D, &hue);
  return ((char)hue);
}


x86 assembly (clang, -O0):
<saa7114_get_decoder_hue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0xd,%edi
lea    -0x1(%rbp),%rsi
call   1030 <saa7114_read_reg@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saa7114_get_decoder_hue>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0xd,%edi
call   1030 <saa7114_read_reg@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @saa7114_get_decoder_hue() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @saa7114_read_reg(i32 13, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @saa7114_get_decoder_hue() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @saa7114_read_reg(i32 13, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
void fork3() {
  printf("L0\n");
  fork();
  printf("L1\n");
  fork();
  printf("L2\n");
  fork();
  printf("Bye\n");
}


x86 assembly (clang, -O0):
<fork3>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork3>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xea8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"L0\0A\00"
@.str.1 = [4 x i8] c"L1\0A\00"
@.str.2 = [4 x i8] c"L2\0A\00"
@.str.3 = [5 x i8] c"Bye\0A\00"
define void @fork3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @fork()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @fork()
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @fork()
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"L0\00"
@str.4 = [3 x i8] c"L1\00"
@str.5 = [3 x i8] c"L2\00"
@str.6 = [4 x i8] c"Bye\00"
define void @fork3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 (...) @fork()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 (...) @fork()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0))
ret void
}
__attribute__((always_)) void numa_policy_init(void) {}


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

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

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

LLVM IR (-O2):
define void @numa_policy_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ins(int /*<<< orphan*/);
void op_ins() { ins(0); }


x86 assembly (clang, -O0):
<op_ins>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <ins@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ins>:
xor    %edi,%edi
jmp    1030 <ins@plt>

LLVM IR (-O0):
define void @op_ins() {
%1 = call i32 @ins(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_ins() {
%1 = tail call i32 @ins(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_tun(int tun_fd) {
  if (tun_fd >= 0)
    close(tun_fd);
}


x86 assembly (clang, -O0):
<close_tun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <close_tun+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_tun>:
test   %edi,%edi
js     1119 <close_tun+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @close_tun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @close_tun(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int agbnp3_vmemalloc(void **, size_t const);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t const);
int agbnp3_vcalloc(void **memptr, const size_t size) {
  int retcode;
  void *mem;
  retcode = agbnp3_vmemalloc(&mem, size);
  if (retcode == 0 && mem) {
    memset(mem, 0, size);
  }
  *memptr = mem;
  return retcode;
}


x86 assembly (clang, -O0):
<agbnp3_vcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdi
call   1030 <agbnp3_vmemalloc@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1164 <agbnp3_vcalloc+0x44>
cmpq   $0x0,-0x20(%rbp)
je     1164 <agbnp3_vcalloc+0x44>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agbnp3_vcalloc>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x8(%rsp),%rdi
call   1030 <agbnp3_vmemalloc@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rdi
test   %eax,%eax
jne    1157 <agbnp3_vcalloc+0x37>
test   %rdi,%rdi
je     1157 <agbnp3_vcalloc+0x37>
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    0x8(%rsp),%rdi
mov    %rdi,(%r14)
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @agbnp3_vcalloc(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i8** %0, i8*** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @agbnp3_vmemalloc(i8** %6, i64 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i8*, i8** %6
%16 = load i64, i64* %4
%17 = call i32 @memset(i8* %15, i32 0, i64 %16)
br label %18
18: ; preds = %14, %11, %2
%19 = load i8*, i8** %6
%20 = load i8**, i8*** %3
store i8* %19, i8** %20
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @agbnp3_vcalloc(i8** nocapture writeonly %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @agbnp3_vmemalloc(i8** %3, i64 %1)
%6 = icmp eq i32 %5, 0
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @memset(i8* %7, i32 0, i64 %1)
%12 = load i8*, i8** %3
br label %13
13: ; preds = %10, %2
%14 = phi i8* [ %12, %10 ], [ %7, %2 ]
store i8* %14, i8** %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *dup;
  dup = strdup(s);
  if (!dup)
    abort();
  return (dup);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1040 <strdup@plt>
test   %rax,%rax
je     112d <xstrdup+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ccnl_do_ageing(void *, void *);
int /*<<< orphan*/ ccnl_set_timer(int, void (*)(void *, void *), void *,
                                  int /*<<< orphan*/);
void ccnl_minimalrelay_ageing(void *relay, void *aux) {
  ccnl_do_ageing(relay, aux);
  ccnl_set_timer(1000000, ccnl_minimalrelay_ageing, relay, 0);
}


x86 assembly (clang, -O0):
<ccnl_minimalrelay_ageing>:
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   1040 <ccnl_do_ageing@plt>
mov    -0x8(%rbp),%rdx
mov    $0xf4240,%edi
mov    0x2e9b(%rip),%rsi
xor    %ecx,%ecx
call   1030 <ccnl_set_timer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnl_minimalrelay_ageing>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ccnl_do_ageing@plt>
mov    0x2eb8(%rip),%rsi
mov    $0xf4240,%edi
mov    %rbx,%rdx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <ccnl_set_timer@plt>

LLVM IR (-O0):
define void @ccnl_minimalrelay_ageing(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @ccnl_do_ageing(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @ccnl_set_timer(i32 1000000, void (i8*, i8*)* @ccnl_minimalrelay_ageing, i8* %8, i32 0)
ret void
}

LLVM IR (-O2):
define void @ccnl_minimalrelay_ageing(i8* %0, i8* %1) {
%3 = tail call i32 @ccnl_do_ageing(i8* %0, i8* %1)
%4 = tail call i32 @ccnl_set_timer(i32 1000000, void (i8*, i8*)* @ccnl_minimalrelay_ageing, i8* %0, i32 0)
ret void
}
int cmd_block(int fd, int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cmd_block(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}