xunge/DecIR huggingface dataset:
void dropBigger(int *a, int *b) {
  int tmp;
  if (*a >= *b) {
    tmp = *a;
    *a = *b;
    *b = tmp;
  }
}


x86 assembly (clang, -O0):
<dropBigger>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jl     113c <dropBigger+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropBigger>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
jl     110c <dropBigger+0xc>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @dropBigger(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %2
store i32 %4, i32* %0
store i32 %3, i32* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
int get_multiplier(int, int);
long find_multiple(int suffix, int divisor) {
  int mult = get_multiplier(suffix, divisor);
  return (long)mult * divisor;
}


x86 assembly (clang, -O0):
<find_multiple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <get_multiplier@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_multiple>:
push   %rbx
mov    %esi,%ebx
call   1030 <get_multiplier@plt>
movslq %eax,%rcx
movslq %ebx,%rax
imul   %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @find_multiple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @get_multiplier(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = mul nsw i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @find_multiple(i32 %0, i32 %1) {
%3 = tail call i32 @get_multiplier(i32 %0, i32 %1)
%4 = sext i32 %3 to i64
%5 = sext i32 %1 to i64
%6 = mul nsw i64 %4, %5
ret i64 %6
}
struct s30 {
  char a;
  char b : 4;
} f30(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define i16 @f30() {
br label %1
1: ; preds = %0, %1
br label %1
}
void vtime_user_enter(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @vtime_user_enter(%struct.task_struct* nocapture %0) {
ret void
}
signed char signedchar_ignoring_signedlonglongint(signed char x,
                                                  signed long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_signedlonglongint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @signedchar_ignoring_signedlonglongint(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_signedlonglongint(i8 returned signext %0, i64 %1) {
ret i8 %0
}
int match_by_pos(int pos, void *value, void *user_data) {
  return pos == (int)(long)user_data;
}


x86 assembly (clang, -O0):
<match_by_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_by_pos>:
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @match_by_pos(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %6
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @match_by_pos(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf(char *);
int stress_set_memthrash_method(const char *name) {
  (void)name;
  (void)pr_inf("warning: --memthrash-method not available on this system\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"warning: --memthrash-method not available on this system\0A\00"
define i32 @stress_set_memthrash_method(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"warning: --memthrash-method not available on this system\0A\00"
define i32 @stress_set_memthrash_method(i8* nocapture readnone %0) {
%2 = tail call i32 @pr_inf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float);
int /*<<< orphan*/ stderr;
void dummy_set_speed_factor(void *user, float f) {
  fprintf(stderr, "GCodeParser: set_speed_factor(%.1f)\n", f);
}


x86 assembly (clang, -O0):
<dummy_set_speed_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
movss  -0xc(%rbp),%xmm0
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"GCodeParser: set_speed_factor(%.1f)\0A\00"
define void @dummy_set_speed_factor(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i32, i32* @stderr
%6 = load float, float* %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), float %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"GCodeParser: set_speed_factor(%.1f)\0A\00"
define void @dummy_set_speed_factor(i8* nocapture readnone %0, float %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), float %1)
ret void
}
const char *crypto_stream_chacha20_primitive(void) { return "chacha20"; }


x86 assembly (clang, -O0):
<crypto_stream_chacha20_primitive>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_stream_chacha20_primitive>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"chacha20\00"
define i8* @crypto_stream_chacha20_primitive() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"chacha20\00"
define i8* @crypto_stream_chacha20_primitive() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
extern const char *_mesa_lookup_enum_by_nr(int nr) { return ""; }


x86 assembly (clang, -O0):
<_mesa_lookup_enum_by_nr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mesa_lookup_enum_by_nr>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @_mesa_lookup_enum_by_nr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @_mesa_lookup_enum_by_nr(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void foo_2_1_1_2_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test() {
  printf("Hello World\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int f_blg_mr2(float *a1, float a2) {
  return !(__builtin_islessgreater(*a1, a2));
}


x86 assembly (clang, -O0):
<f_blg_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blg_mr2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @f_blg_mr2(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* %5
%7 = load float, float* %4
%8 = fcmp one float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_blg_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ueq float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct cheat_test_suite {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cheat_test_assert(struct cheat_test_suite *, int, char *,
                                     char *, int);
void test_maths_still_work(struct cheat_test_suite *suite) {
  cheat_test_assert(
      suite, 4 == 2 + 2, "4 == 2+2",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/.travistest.c",
      26);
}


x86 assembly (clang, -O0):
<test_maths_still_work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    0xed4(%rip),%rdx
lea    0xed6(%rip),%rcx
mov    $0x1a,%r8d
call   1030 <cheat_test_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_maths_still_work>:
lea    0xee9(%rip),%rdx
lea    0xeeb(%rip),%rcx
mov    $0x1,%esi
mov    $0x1a,%r8d
jmp    1030 <cheat_test_assert@plt>

LLVM IR (-O0):
%struct.cheat_test_suite = type { i32 }
@.str = [9 x i8] c"4 == 2+2\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/.travistest.c\00"
define void @test_maths_still_work(%struct.cheat_test_suite* %0) {
%2 = alloca %struct.cheat_test_suite*
store %struct.cheat_test_suite* %0, %struct.cheat_test_suite** %2
%3 = load %struct.cheat_test_suite*, %struct.cheat_test_suite** %2
%4 = call i32 @cheat_test_assert(%struct.cheat_test_suite* %3, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 26)
ret void
}

LLVM IR (-O2):
%struct.cheat_test_suite = type { i32 }
@.str = [9 x i8] c"4 == 2+2\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Tordek/cheat/refs/heads/master/.travistest.c\00"
define void @test_maths_still_work(%struct.cheat_test_suite* %0) {
%2 = tail call i32 @cheat_test_assert(%struct.cheat_test_suite* %0, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 26)
ret void
}
/* Variables and functions */
double fromRep64(int);
double makeQNaN64(void) { return fromRep64(0x7ff8000000000000UL); }


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

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

LLVM IR (-O0):
define double @makeQNaN64() {
%1 = call double @fromRep64(i32 0)
ret double %1
}

LLVM IR (-O2):
define double @makeQNaN64() {
%1 = tail call double @fromRep64(i32 0)
ret double %1
}
RCU_DEF_INIT_FUNC(user_f2_init, param) {}


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

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

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

LLVM IR (-O2):
define i32 @RCU_DEF_INIT_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
const char *ls_costN_nm7_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_costN_nm7_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <ls_costN_nm7_name_in+0x27>
jmp    1117 <ls_costN_nm7_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <ls_costN_nm7_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm7_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm7_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @ls_costN_nm7_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
void fred$(struct fred *this) { printf("~fred()\n"); }


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

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

LLVM IR (-O0):
%struct.fred = type opaque
@.str = [9 x i8] c"~fred()\0A\00"
define void @"fred$"(%struct.fred* %0) {
%2 = alloca %struct.fred*
store %struct.fred* %0, %struct.fred** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.fred = type opaque
@str = [8 x i8] c"~fred()\00"
define void @"fred$"(%struct.fred* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __isblank_impl(int);
int isblank(int c) { return __isblank_impl(c); }


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

x86 assembly (clang, -O2):
<isblank>:
jmp    1030 <__isblank_impl@plt>

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = tail call i32 @__isblank_impl(i32 %0)
ret i32 %2
}
void send_do(int n, unsigned char val) {}


x86 assembly (clang, -O0):
<send_do>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @send_do(i32 %0, i8 zeroext %1) {
ret void
}
void r_tele_kill() {}


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

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

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

LLVM IR (-O2):
define void @r_tele_kill() {
ret void
}
/* Variables and functions */
int BBM_TUNER_SET_FREQ(void *, unsigned int);
int mtv_set_channel(void *hDevice, unsigned int freq) {
  int res = 1;
  res = BBM_TUNER_SET_FREQ(hDevice, freq);
  return res;
}


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

x86 assembly (clang, -O2):
<mtv_set_channel>:
jmp    1030 <BBM_TUNER_SET_FREQ@plt>

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

LLVM IR (-O2):
define i32 @mtv_set_channel(i8* %0, i32 %1) {
%3 = tail call i32 @BBM_TUNER_SET_FREQ(i8* %0, i32 %1)
ret i32 %3
}
void gets(char *input) { int i; }


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

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

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

LLVM IR (-O2):
define void @gets(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_nlink;
};
typedef int /*<<< orphan*/ nlink_t;

/* Variables and functions */
nlink_t posix_stat_st_nlink(const struct stat *st) { return st->st_nlink; }


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_nlink(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_nlink(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
void ARGBComputeCumulativeSum() {}


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

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

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

LLVM IR (-O2):
define void @ARGBComputeCumulativeSum() {
ret void
}
int main(void) {
  int a = 5, c = 1;
  switch (a) {
  case 1:
    while (c > 3) {
    case 3:
      ++c;
    }
  }
  return 7;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113e <main+0x3e>
jmp    112d <main+0x2d>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     1152 <main+0x52>
jmp    1165 <main+0x65>
jmp    1143 <main+0x43>
cmpl   $0x3,-0xc(%rbp)
jle    1160 <main+0x60>
jmp    1152 <main+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <main+0x43>
jmp    1165 <main+0x65>
mov    $0x7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %14 [
i32 1, label %5
i32 3, label %10
]
5: ; preds = %0
br label %6
6: ; preds = %10, %5
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 3
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %0, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %6
13: ; preds = %6
br label %14
14: ; preds = %13, %0
ret i32 7
}

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

/* Variables and functions */
char _get_digit(uint64_t *fr, int *digit_count) {
  int rval;
  if (*digit_count > 0) {
    *digit_count -= 1;
    *fr = *fr * 10;
    rval = ((*fr >> 60) & 0xF) + '0';
    *fr &= 0x0FFFFFFFFFFFFFFFull;
  } else
    rval = '0';
  return (char)(rval);
}


x86 assembly (clang, -O0):
<_get_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1162 <_get_digit+0x62>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
imul   $0xa,(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x3c,%ecx
sar    %cl,%eax
and    $0xf,%eax
add    $0x30,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
movabs $0xfffffffffffffff,%rdx
ff ff 0f
and    %rdx,%rcx
mov    %ecx,(%rax)
jmp    1169 <_get_digit+0x69>
movl   $0x30,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_digit>:
mov    (%rsi),%eax
test   %eax,%eax
jle    1114 <_get_digit+0x14>
add    $0xffffffff,%eax
mov    %eax,(%rsi)
mov    (%rdi),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,(%rdi)
mov    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @_get_digit(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %27
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, 10
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = ashr i32 %18, 60
%20 = and i32 %19, 15
%21 = add nsw i32 %20, 48
store i32 %21, i32* %5
%22 = load i32*, i32** %3
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = and i64 %24, 1152921504606846975
%26 = trunc i64 %25 to i32
store i32 %26, i32* %22
br label %28
27: ; preds = %2
store i32 48, i32* %5
br label %28
28: ; preds = %27, %9
%29 = load i32, i32* %5
%30 = trunc i32 %29 to i8
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @_get_digit(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = add nsw i32 %3, -1
store i32 %6, i32* %1
%7 = load i32, i32* %0
%8 = mul nsw i32 %7, 10
store i32 %8, i32* %0
br label %9
9: ; preds = %2, %5
ret i8 48
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_send_mqtt_short_command(struct mg_connection *, int,
                                              int /*<<< orphan*/);
void mg_mqtt_pubcomp(struct mg_connection *nc, uint16_t message_id) {
  mg_send_mqtt_short_command(nc, 7, message_id);
}


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

x86 assembly (clang, -O2):
<mg_mqtt_pubcomp>:
mov    %esi,%edx
mov    $0x7,%esi
jmp    1030 <mg_send_mqtt_short_command@plt>

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_pubcomp(%struct.mg_connection* %0, i32 %1) {
%3 = alloca %struct.mg_connection*
%4 = alloca i32
store %struct.mg_connection* %0, %struct.mg_connection** %3
store i32 %1, i32* %4
%5 = load %struct.mg_connection*, %struct.mg_connection** %3
%6 = load i32, i32* %4
%7 = call i32 @mg_send_mqtt_short_command(%struct.mg_connection* %5, i32 7, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_pubcomp(%struct.mg_connection* %0, i32 %1) {
%3 = tail call i32 @mg_send_mqtt_short_command(%struct.mg_connection* %0, i32 7, i32 %1)
ret void
}
/* Variables and functions */
void *SC68alloc(unsigned int);
void *SC68calloc(unsigned int n) {
  void *buffer = SC68alloc(n);
  if (buffer) {
    char *b = buffer;
    while (n--) {
      *b++ = 0;
    }
  }
  return buffer;
}


x86 assembly (clang, -O0):
<SC68calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <SC68alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <SC68calloc+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1165 <SC68calloc+0x55>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    113a <SC68calloc+0x2a>
jmp    116a <SC68calloc+0x5a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC68calloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <SC68alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1142 <SC68calloc+0x22>
test   %ebp,%ebp
je     1142 <SC68calloc+0x22>
mov    %ebp,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @SC68calloc(i32 %0) {
%2 = tail call i8* @SC68alloc(i32 %0)
%3 = icmp eq i8* %2, null
%4 = icmp eq i32 %0, 0
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ func(double);
int main() {
  func((double)1.00);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @func(double 1.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(double 1.000000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, char **);
int main(int argn, char **argv, char **envp) {
  argv[0] = "/usr/lib/cgi-bin/cricket/mini-graph-real.cgi";
  execve("/usr/lib/cgi-bin/cricket/mini-graph-real.cgi", argv, envp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec0(%rip),%rdi
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"/usr/lib/cgi-bin/cricket/mini-graph-real.cgi\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = call i32 @execve(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8** %9, i8** %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"/usr/lib/cgi-bin/cricket/mini-graph-real.cgi\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = tail call i32 @execve(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %2)
ret i32 0
}
/* Type definitions */
typedef void FILE;

/* Variables and functions */
extern FILE *runprog_open(char const *command) { return ((void *)0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @runprog_open(i8* nocapture readnone %0) {
ret i8* null
}
unsigned long b_disk_read(unsigned long start, unsigned long num,
                          unsigned long disknum, void *dest) {
  unsigned long tlong;
  asm volatile("call *0x00100070"
               : "=c"(tlong)
               : "a"(start), "c"(num), "d"(disknum), "D"(dest));
  return tlong;
}


x86 assembly (clang, -O0):
<b_disk_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rdi
call   *0x100070
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_disk_read>:
mov    %rcx,%r8
mov    %rsi,%rcx
mov    %rdi,%rax
mov    %r8,%rdi
call   *0x100070
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_disk_read(i64 %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = call i64 asm sideeffect "call *0x00100070", "={cx},{ax},{cx},{dx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i8* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @b_disk_read(i64 %0, i64 %1, i64 %2, i8* %3) {
%5 = tail call i64 asm sideeffect "call *0x00100070", "={cx},{ax},{cx},{dx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i8* %3)
ret i64 %5
}
int compare_ints(const void *addr1, const void *addr2) {
  int num1 = *(int *)addr1;
  int num2 = *(int *)addr2;
  return num1 - num2;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned char sum(unsigned char x, unsigned char y) { return x ^ y; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @sum(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @sum(i8 zeroext %0, i8 zeroext %1) {
%3 = xor i8 %1, %0
ret i8 %3
}
/* Variables and functions */
size_t strlen(char *);
void stripnl(char *str) {
  if (*str != '\0') {
    size_t len = strlen(str);
    if (str[len - 1] == '\n') {
      str[len - 1] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<stripnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <stripnl+0x57>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1162 <stripnl+0x52>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1167 <stripnl+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripnl>:
push   %rbx
cmpb   $0x0,(%rdi)
je     112a <stripnl+0x1a>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    112a <stripnl+0x1a>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @stripnl(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %3
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %23
18: ; preds = %8
%19 = load i8*, i8** %2
%20 = load i64, i64* %3
%21 = sub i64 %20, 1
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 0, i8* %22
br label %23
23: ; preds = %18, %8
br label %24
24: ; preds = %23, %1
ret void
}

LLVM IR (-O2):
define void @stripnl(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* %0)
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %4, %10, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int comparator_no_ops(void *data1, void *data2) {
  return (uint32_t)data1 - (uint32_t)data2;
}


x86 assembly (clang, -O0):
<comparator_no_ops>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator_no_ops>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @comparator_no_ops(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @comparator_no_ops(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test_parser();
void test_messages() { test_parser(); }


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

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

LLVM IR (-O0):
define void @test_messages() {
%1 = call i32 (...) @test_parser()
ret void
}

LLVM IR (-O2):
define void @test_messages() {
%1 = tail call i32 (...) @test_parser()
ret void
}
char pop_paren() {
  extern int paren_stack_top;
  extern char paren_stack[];
  if (paren_stack_top == 0) {
    return ' ';
  } else {
    return paren_stack[--paren_stack_top];
  }
}


x86 assembly (clang, -O0):
<pop_paren>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
cmpl   $0x0,(%rax)
jne    111d <pop_paren+0x1d>
movb   $0x20,-0x1(%rbp)
jmp    1142 <pop_paren+0x42>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
add    $0xffffffff,%eax
mov    0x2ea8(%rip),%rcx
mov    %eax,(%rcx)
movslq %eax,%rcx
mov    0x2eb4(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_paren>:
mov    0x2ed1(%rip),%rcx
movslq (%rcx),%rax
test   %rax,%rax
je     1121 <pop_paren+0x21>
lea    -0x1(%rax),%rdx
mov    %edx,(%rcx)
mov    0x2ed4(%rip),%rcx
mov    -0x1(%rcx,%rax,1),%al
ret
mov    $0x20,%al
ret

LLVM IR (-O0):
@paren_stack_top = external global i32
@paren_stack = external global [0 x i8]
define signext i8 @pop_paren() {
%1 = alloca i8
%2 = load i32, i32* @paren_stack_top
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8 32, i8* %1
br label %11
5: ; preds = %0
%6 = load i32, i32* @paren_stack_top
%7 = add nsw i32 %6, -1
store i32 %7, i32* @paren_stack_top
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [0 x i8], [0 x i8]* @paren_stack, i64 0, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %1
br label %11
11: ; preds = %5, %4
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
@paren_stack_top = external global i32
@paren_stack = external global [0 x i8]
define signext i8 @pop_paren() {
%1 = load i32, i32* @paren_stack_top
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = add nsw i32 %1, -1
store i32 %4, i32* @paren_stack_top
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @paren_stack, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %0, %3
%9 = phi i8 [ %7, %3 ], [ 32, %0 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ GPIOPinWrite(int, int, int);
void stopB() {
  GPIOPinWrite(0x40007000, 0x00000020, 0x00);
  GPIOPinWrite(0x40007000, 0x00000010, 0xff);
  GPIOPinWrite(0x40007000, 0x00000020, 0xff);
  GPIOPinWrite(0x40007000, 0x00000010, 0x00);
}


x86 assembly (clang, -O0):
<stopB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40007000,%edi
mov    $0x20,%esi
xor    %edx,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x20,%esi
mov    $0xff,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1030 <GPIOPinWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopB>:
push   %rax
mov    $0x40007000,%edi
mov    $0x20,%esi
xor    %edx,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x20,%esi
mov    $0xff,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <GPIOPinWrite@plt>

LLVM IR (-O0):
define void @stopB() {
%1 = call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 0)
%2 = call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%3 = call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 255)
%4 = call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
ret void
}

LLVM IR (-O2):
define void @stopB() {
%1 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 0)
%2 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%3 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 255)
%4 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
ret void
}
/* Variables and functions */
int atoi(char *);
int fact(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int x, ret;
  x = atoi(argv[1]);
  ret = fact(x);
  printf("ret = %d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <fact@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"ret = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @fact(i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"ret = %d\0A\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 i32 @atoi(i8* %4)
%6 = tail call i32 @fact(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_less_than(void) {
  gen_pop();
  gen_call("_lt");
}


x86 assembly (clang, -O0):
<gen_less_than>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_less_than>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"_lt\00"
define void @gen_less_than() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"_lt\00"
define void @gen_less_than() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t result = 0;
  while (string[result])
    ++result;
  return result;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ rPsort2(double *, int, int, int);
void rPsort(double *x, int n, int k) { rPsort2(x, (int)0, (int)(n - 1), k); }


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

x86 assembly (clang, -O2):
<rPsort>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <rPsort2@plt>

LLVM IR (-O0):
define void @rPsort(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @rPsort2(double* %7, i32 0, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @rPsort(double* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @rPsort2(double* %0, i32 0, i32 %4, i32 %2)
ret void
}