xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void defineVariable() {
  extern int static_b;
  printf("%d", static_b);
  int local_a = 33;
  static int local_static_a;
  register int register_a = 33;
}


x86 assembly (clang, -O0):
<defineVariable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x21,-0x4(%rbp)
movl   $0x21,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defineVariable>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@static_b = external global i32
@defineVariable.local_static_a = internal global i32 0
define void @defineVariable() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @static_b
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 33, i32* %1
store i32 33, i32* %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@static_b = external global i32
define void @defineVariable() {
%1 = load i32, i32* @static_b
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int StringComparisonOrEqualCommon(char *, int, char *, int, int, int);
int StringIsGreaterOrEqual(char *first, int length1, char *second, int length2,
                           int isNumOrAlpha) {
  return StringComparisonOrEqualCommon(first, length1, second, length2,
                                       isNumOrAlpha, 1);
}


x86 assembly (clang, -O0):
<StringIsGreaterOrEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <StringComparisonOrEqualCommon@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringIsGreaterOrEqual>:
mov    $0x1,%r9d
jmp    1030 <StringComparisonOrEqualCommon@plt>

LLVM IR (-O0):
define i32 @StringIsGreaterOrEqual(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @StringComparisonOrEqualCommon(i8* %11, i32 %12, i8* %13, i32 %14, i32 %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
define i32 @StringIsGreaterOrEqual(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @StringComparisonOrEqualCommon(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 1)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_word_data(int /*<<< orphan*/, int, int /*<<< orphan*/);
void invert_bus(uint8_t address, uint16_t polarity) {
  write_word_data(address, 0x02, polarity);
}


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

x86 assembly (clang, -O2):
<invert_bus>:
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <write_word_data@plt>

LLVM IR (-O0):
define void @invert_bus(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 @write_word_data(i32 %5, i32 2, i32 %6)
ret void
}

LLVM IR (-O2):
define void @invert_bus(i32 %0, i32 %1) {
%3 = tail call i32 @write_word_data(i32 %0, i32 2, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int);
void unroll() {
  for (int i = 0; i < 2; i++)
    baz(i);
}


x86 assembly (clang, -O0):
<unroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    113f <unroll+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <baz@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <unroll+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unroll>:
push   %rax
xor    %edi,%edi
call   1030 <baz@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
define void @unroll() {
%1 = tail call i32 @baz(i32 0)
%2 = tail call i32 @baz(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
enter_string(char str[]) { gets(str); }


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

x86 assembly (clang, -O2):
<enter_string>:
jmp    1030 <gets@plt>

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

LLVM IR (-O2):
define i32 @enter_string(i8* %0) {
%2 = tail call i32 @gets(i8* %0)
ret i32 undef
}
/* Variables and functions */
int rand();
int randomTile(int lowerLim, int upperLim) {
  return rand() % (upperLim - lowerLim + 1) + lowerLim;
}


x86 assembly (clang, -O0):
<randomTile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomTile>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomTile(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randomTile(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void outportb(unsigned short port, unsigned char value) {
  __asm__("outb %b0,%w1" ::"a"(value), "d"(port));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_add_overflow_p(int /*<<< orphan*/,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/);
uint32_t __hsail_carry_u32(uint32_t a, uint32_t b) {
  return __builtin_add_overflow_p(a, b, a);
}


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

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

LLVM IR (-O0):
define i32 @__hsail_carry_u32(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 = load i32, i32* %3
%8 = call i32 @__builtin_add_overflow_p(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @__hsail_carry_u32(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_add_overflow_p(i32 %0, i32 %1, i32 %0)
ret i32 %3
}
unsigned long native_save_fl(void) {
  unsigned long flags;
  asm volatile("# __raw_save_flags\n\t"
               "pushf ; pop %0"
               : "=r"(flags)
               :
               : "memory");
  return flags;
}


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

x86 assembly (clang, -O2):
<native_save_fl>:
pushf
pop    %rax
ret

LLVM IR (-O0):
define i64 @native_save_fl() {
%1 = alloca i64
%2 = call i64 asm sideeffect "# __raw_save_flags\0A\09pushf ; pop $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @native_save_fl() {
%1 = tail call i64 asm sideeffect "# __raw_save_flags\0A\09pushf ; pop $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
void *hilo1() {
  printf("Yo soy el hilo 1 \n");
  sleep(2);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<hilo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hilo1>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Yo soy el hilo 1 \0A\00"
define i8* @hilo1() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 2)
%4 = call i32 @pthread_exit(i32* null)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@str = [18 x i8] c"Yo soy el hilo 1 \00"
define noalias i8* @hilo1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 2)
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ test_shortest_path();
int main() {
  test_shortest_path();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_shortest_path()
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int _command_sort(const void *arg_a, const void *arg_b) {
  int ret = 0;
  const char *command_a = (const char *)(*((const char **)arg_a));
  const char *command_b = (const char *)(*((const char **)arg_b));
  ret = strcmp(command_a, command_b);
  return ret;
}


x86 assembly (clang, -O0):
<_command_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_command_sort>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @_command_sort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i8**
%13 = load i8*, i8** %12
store i8* %13, i8** %7
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = call i32 @strcmp(i8* %14, i8* %15)
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @_command_sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef union hash_state {
  int dummy;
} hash_state;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ keccak1600(int /*<<< orphan*/ const *, size_t,
                              int /*<<< orphan*/ *);
void hash_process(union hash_state *state, const uint8_t *buf, size_t count) {
  keccak1600(buf, count, (uint8_t *)state);
}


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

x86 assembly (clang, -O2):
<hash_process>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <keccak1600@plt>

LLVM IR (-O0):
%union.hash_state = type { i32 }
define void @hash_process(%union.hash_state* %0, i32* %1, i64 %2) {
%4 = alloca %union.hash_state*
%5 = alloca i32*
%6 = alloca i64
store %union.hash_state* %0, %union.hash_state** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %5
%8 = load i64, i64* %6
%9 = load %union.hash_state*, %union.hash_state** %4
%10 = bitcast %union.hash_state* %9 to i32*
%11 = call i32 @keccak1600(i32* %7, i64 %8, i32* %10)
ret void
}

LLVM IR (-O2):
%union.hash_state = type { i32 }
define void @hash_process(%union.hash_state* %0, i32* %1, i64 %2) {
%4 = getelementptr %union.hash_state, %union.hash_state* %0, i64 0, i32 0
%5 = tail call i32 @keccak1600(i32* %1, i64 %2, i32* %4)
ret void
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  scalar_t__ tv_nsec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t audio_utils_ns_from_timespec(const struct timespec *ts) {
  return ts->tv_sec * 1000000000LL + ts->tv_nsec;
}


x86 assembly (clang, -O0):
<audio_utils_ns_from_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,(%rax),%rax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_utils_ns_from_timespec>:
imul   $0x3b9aca00,(%rdi),%rax
add    0x8(%rdi),%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @audio_utils_ns_from_timespec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @audio_utils_ns_from_timespec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ send_msg(int, char *);
int main(void) {
  send_msg(1, "hello from send");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <send_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"hello from send\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @send_msg(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"hello from send\00"
define i32 @main() {
%1 = tail call i32 @send_msg(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main(void) {
  assert(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void zero_fill(void **ptr, int size) { memset(*ptr, 0, size); }


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

x86 assembly (clang, -O2):
<zero_fill>:
mov    %esi,%edx
mov    (%rdi),%rdi
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @zero_fill(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @memset(i8* %3, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (strcmp(argv[1], "my_license_key") == 0)
    printf("You win!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1160 <main+0x40>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
lea    0xed4(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1142 <main+0x22>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"my_license_key\00"
@.str.1 = [10 x i8] c"You win!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"my_license_key\00"
@str = [9 x i8] c"You win!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i32 0
}
int verify_int_map_hdr(struct int_map_hdr *imap_hdr, int maxgroupnode,
                       int maxrnodeblock) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.int_map_hdr = type opaque
define i32 @verify_int_map_hdr(%struct.int_map_hdr* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_strerror();
int /*<<< orphan*/ test_strlen();
int main(void) {
  test_strlen();
  test_strerror();
  printf("Success\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_strlen()
%3 = call i32 (...) @test_strerror()
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (...) @test_strlen()
%2 = tail call i32 (...) @test_strerror()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *program_name) {
  printf("USAGE: %s <dut-asm-source-file> <mockables-list-file>\n",
         program_name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"USAGE: %s <dut-asm-source-file> <mockables-list-file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"USAGE: %s <dut-asm-source-file> <mockables-list-file>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xe7() {
  Assert_real((isupper(231) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1160, ("isupper should be 0 for 0xe7"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe7\00"
define void @t_isupper_0xe7() {
%1 = tail call i64 @isupper(i32 231)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void local_addr_noalias_bad(int *p) {
  int *q = 0;
  int x = 1;
  if (&x != p) {
    *q = 42;
  }
}


x86 assembly (clang, -O0):
<local_addr_noalias_bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     112f <local_addr_noalias_bad+0x2f>
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @local_addr_noalias_bad(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %2
store i32* null, i32** %3
store i32 1, i32* %4
%5 = load i32*, i32** %2
%6 = icmp ne i32* %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32*, i32** %3
store i32 42, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free1(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<free1>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free1(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int f3(unsigned int a, int b) { return a - (a & b); }


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

x86 assembly (clang, -O2):
<f3>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f3(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* %3
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = sub i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
int test3(char x) { return x / 100 < 3; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test3(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp slt i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test3(i8 signext %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGE_SIZE;
scalar_t__ sysconf(int /*<<< orphan*/);
unsigned long bytes_per_page(void) {
  return (unsigned long)sysconf(_SC_PAGE_SIZE);
}


x86 assembly (clang, -O0):
<bytes_per_page>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_per_page>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_PAGE_SIZE = global i32 0
define i64 @bytes_per_page() {
%1 = load i32, i32* @_SC_PAGE_SIZE
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_PAGE_SIZE = global i32 0
define i64 @bytes_per_page() {
%1 = load i32, i32* @_SC_PAGE_SIZE
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help_rlogin(int argc, char **argv) {
  printf("\n\033[1mrlogin [<ip>] <port>\033[0m\n"
         "  Telnet to <port> at <ip> (def 127.0.0.1) relative to HOST PC. \n"
         "  To attach to the console of a virtual router running on port 2000 "
         "of this\n"
         "  host PC, use \033[1mrlogin 2000\033[0m\n"
         "  To telnet to the port 2004 of a remote host 10.1.1.1, use\n"
         "  \033[1mrlogin 10.1.1.1 2004\033[0m\n");
  return 1;
}


x86 assembly (clang, -O0):
<help_rlogin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [298 x i8] c"\0A\1B[1mrlogin [<ip>] <port>\1B[0m\0A Telnet to <port> at <ip> (def 127.0.0.1) relative to HOST PC. \0A To attach to the console of a virtual router running on port 2000 of this\0A host PC, use \1B[1mrlogin 2000\1B[0m\0A To telnet to the port 2004 of a remote host 10.1.1.1, use\0A \1B[1mrlogin 10.1.1.1 2004\1B[0m\0A\00"
define i32 @help_rlogin(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([298 x i8], [298 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [297 x i8] c"\0A\1B[1mrlogin [<ip>] <port>\1B[0m\0A Telnet to <port> at <ip> (def 127.0.0.1) relative to HOST PC. \0A To attach to the console of a virtual router running on port 2000 of this\0A host PC, use \1B[1mrlogin 2000\1B[0m\0A To telnet to the port 2004 of a remote host 10.1.1.1, use\0A \1B[1mrlogin 10.1.1.1 2004\1B[0m\00"
define i32 @help_rlogin(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([297 x i8], [297 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int foo(int *c) {
  int i;
  int j = 10;
  for (i = 0; i < 5; i++) {
    for (j = 10;; j--) {
      if (j == 0)
        break;
      *(c + j) = *(c + j) - 1;
    }
  }
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1170 <foo+0x70>
movl   $0xa,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1136 <foo+0x36>
jmp    115d <foo+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
sub    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <foo+0x27>
jmp    1162 <foo+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <foo+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movdqu 0x4(%rdi),%xmm0
movdqu 0x14(%rdi),%xmm1
addl   $0xfffffffb,0x28(%rdi)
addl   $0xfffffffb,0x24(%rdi)
movdqa 0xee6(%rip),%xmm2
paddd  %xmm2,%xmm1
movdqu %xmm1,0x14(%rdi)
paddd  %xmm2,%xmm0
movdqu %xmm0,0x4(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 10
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 9
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 5
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = bitcast i32* %9 to <4 x i32>*
%11 = load <4 x i32>, <4 x i32>* %10
%12 = add nsw i32 %3, -5
store i32 %12, i32* %2
%13 = add nsw i32 %5, -5
store i32 %13, i32* %4
%14 = add nsw <4 x i32> %8, <i32 -5, i32 -5, i32 -5, i32 -5>
%15 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %14, <4 x i32>* %15
%16 = add nsw <4 x i32> %11, <i32 -5, i32 -5, i32 -5, i32 -5>
%17 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> %16, <4 x i32>* %17
ret i32 0
}
/* Variables and functions */
int Section3First(int *);
int Section3Fourth(int *);
int Section3Second(int *);
int Section3Third(int *);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int Section3(int number) {
  printf("\n3.- | %d | %d | %d | %d |", Section3First(&number),
         Section3Second(&number), Section3Third(&number),
         Section3Fourth(&number));
  return 0;
}


x86 assembly (clang, -O0):
<Section3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <Section3First@plt>
mov    %eax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <Section3Second@plt>
mov    %eax,-0xc(%rbp)
lea    -0x4(%rbp),%rdi
call   1070 <Section3Third@plt>
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <Section3Fourth@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %eax,%r8d
lea    0xe65(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <Section3First@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1050 <Section3Second@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1070 <Section3Third@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <Section3Fourth@plt>
lea    0xe71(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0A3.- | %d | %d | %d | %d |\00"
define i32 @Section3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Section3First(i32* %2)
%4 = call i32 @Section3Second(i32* %2)
%5 = call i32 @Section3Third(i32* %2)
%6 = call i32 @Section3Fourth(i32* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A3.- | %d | %d | %d | %d |\00"
define i32 @Section3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Section3First(i32* %2)
%4 = call i32 @Section3Second(i32* %2)
%5 = call i32 @Section3Third(i32* %2)
%6 = call i32 @Section3Fourth(i32* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_os_tss(int, int /*<<< orphan*/, int /*<<< orphan*/);
int task_new(char *);
int /*<<< orphan*/ task_run(int);
int create_root_task(void) {
  int pid = task_new("root");
  set_os_tss(pid, 0, 0);
  task_run(pid);
  return pid;
}


x86 assembly (clang, -O0):
<create_root_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <task_new@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <set_os_tss@plt>
mov    -0x4(%rbp),%edi
call   1050 <task_run@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_root_task>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <task_new@plt>
mov    %eax,%ebx
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <set_os_tss@plt>
mov    %ebx,%edi
call   1050 <task_run@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"root\00"
define i32 @create_root_task() {
%1 = alloca i32
%2 = call i32 @task_new(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @set_os_tss(i32 %3, i32 0, i32 0)
%5 = load i32, i32* %1
%6 = call i32 @task_run(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"root\00"
define i32 @create_root_task() {
%1 = tail call i32 @task_new(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @set_os_tss(i32 %1, i32 0, i32 0)
%3 = tail call i32 @task_run(i32 %1)
ret i32 %1
}
int CalculatePitch(int line) { return line + 3 & ~3; }


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

x86 assembly (clang, -O2):
<CalculatePitch>:
lea    0x3(%rdi),%eax
and    $0xfffffffc,%eax
ret

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

LLVM IR (-O2):
define i32 @CalculatePitch(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = and i32 %2, -4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dispSum();
int /*<<< orphan*/ getBritish();
int /*<<< orphan*/ getMetric();
int main() {
  getMetric();
  getBritish();
  dispSum();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getMetric()
%2 = tail call i32 (...) @getBritish()
%3 = tail call i32 (...) @dispSum()
ret i32 0
}
void XSetIOErrorHandler() {}


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

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

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

LLVM IR (-O2):
define void @XSetIOErrorHandler() {
ret void
}
int hash_cached_include(int type, const char *filename) {
  const unsigned char *s;
  unsigned int h;
  h = 1;
  h = ((h)*263 + (type));
  s = filename;
  while (*s) {
    h = ((h)*263 + (*s));
    s++;
  }
  h &= (512 - 1);
  return h;
}


x86 assembly (clang, -O0):
<hash_cached_include>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
imul   $0x107,-0x1c(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <hash_cached_include+0x58>
imul   $0x107,-0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <hash_cached_include+0x27>
mov    -0x1c(%rbp),%eax
and    $0x1ff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_cached_include>:
mov    %edi,%eax
add    $0x107,%eax
mov    (%rsi),%cl
test   %cl,%cl
je     1136 <hash_cached_include+0x36>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   $0x107,%eax,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <hash_cached_include+0x20>
and    $0x1ff,%eax
ret

LLVM IR (-O0):
define i32 @hash_cached_include(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = mul i32 %7, 263
%9 = load i32, i32* %3
%10 = add i32 %8, %9
store i32 %10, i32* %6
%11 = load i8*, i8** %4
store i8* %11, i8** %5
br label %12
12: ; preds = %16, %2
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = load i32, i32* %6
%18 = mul i32 %17, 263
%19 = load i8*, i8** %5
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = add i32 %18, %21
store i32 %22, i32* %6
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
br label %12
25: ; preds = %12
%26 = load i32, i32* %6
%27 = and i32 %26, 511
store i32 %27, i32* %6
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @hash_cached_include(i32 %0, i8* nocapture %1) {
%3 = add i32 %0, 263
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %14, %6 ], [ %4, %2 ]
%8 = phi i32 [ %12, %6 ], [ %3, %2 ]
%9 = phi i8* [ %13, %6 ], [ %1, %2 ]
%10 = mul i32 %8, 263
%11 = zext i8 %7 to i32
%12 = add i32 %10, %11
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ %3, %2 ], [ %12, %6 ]
%18 = and i32 %17, 511
ret i32 %18
}
/* Variables and functions */
unsigned long get_pbb_clk_rate();
unsigned long get_mci_clk_rate(void) { return get_pbb_clk_rate(); }


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

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

LLVM IR (-O0):
define i64 @get_mci_clk_rate() {
%1 = call i64 (...) @get_pbb_clk_rate()
ret i64 %1
}

LLVM IR (-O2):
define i64 @get_mci_clk_rate() {
%1 = tail call i64 (...) @get_pbb_clk_rate()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ print_c(int);
print_n(int n) {
  n += '0';
  print_c(n);
}


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

x86 assembly (clang, -O2):
<print_n>:
add    $0x30,%edi
jmp    1030 <print_c@plt>

LLVM IR (-O0):
define i32 @print_n(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 48
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @print_c(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @print_n(i32 %0) {
%2 = add nsw i32 %0, 48
%3 = tail call i32 @print_c(i32 %2)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
int getcode(const char *response) {
  char buffer[4];
  strncpy(buffer, response, sizeof(buffer) - 1);
  buffer[3] = '\0';
  return atoi(buffer);
}


x86 assembly (clang, -O0):
<getcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x9(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getcode(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 3)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 0, i8* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = call i32 @atoi(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @getcode(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 0, i8* %5
%6 = call i32 @atoi(i8* %3)
ret i32 %6
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double atanl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<atanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
float atan2f(float, float);
float intr_wrap_020(float p1, float p2) { return atan2f(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_020>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_020>:
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @intr_wrap_020(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @intr_wrap_020(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}