xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ to_point(int /*<<< orphan*/, int);
int /*<<< orphan*/ turn_player(int /*<<< orphan*/);
int turn_down() {
  turn_player(to_point(0, -1));
  return 1;
}


x86 assembly (clang, -O0):
<turn_down>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn_player@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_down>:
push   %rax
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn_player@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @turn_down() {
%1 = call i32 @to_point(i32 0, i32 -1)
%2 = call i32 @turn_player(i32 %1)
ret i32 1
}

LLVM IR (-O2):
define i32 @turn_down() {
%1 = tail call i32 @to_point(i32 0, i32 -1)
%2 = tail call i32 @turn_player(i32 %1)
ret i32 1
}
void rop3_216_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S ^ T;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_216_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_216_1_0>:
mov    %edx,%eax
xor    %sil,%al
mov    (%rdi),%cl
and    %cl,%al
xor    %dl,%al
xor    %al,%cl
and    %sil,%cl
xor    %al,%cl
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_216_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %5, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int scompare(char **s, char **t) { return strcmp(*s, *t); }


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

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

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

LLVM IR (-O2):
define i32 @scompare(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ *curscr;
WINDOW *returncur(void) { return (curscr); }


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

x86 assembly (clang, -O2):
<returncur>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@curscr = global i32* null
define i32* @returncur() {
%1 = load i32*, i32** @curscr
ret i32* %1
}

LLVM IR (-O2):
@curscr = global i32* null
define i32* @returncur() {
%1 = load i32*, i32** @curscr
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ mystrcpy(char *, char const *);
size_t mystrlen(char *);
char *mystrcat(char *s1, const char *s2) {
  mystrcpy(&s1[mystrlen(s1)], s2);
  return s1;
}


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

x86 assembly (clang, -O2):
<mystrcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <mystrlen@plt>
lea    (%rax,%rbx,1),%rdi
mov    %r14,%rsi
call   1040 <mystrcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mystrcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @mystrlen(i8* %6)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8*, i8** %4
%10 = call i32 @mystrcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @mystrcat(i8* returned %0, i8* %1) {
%3 = tail call i64 @mystrlen(i8* %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @mystrcpy(i8* %4, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void fun13(int *data) {
  printf("data[0] %d data[1] %d data[2] %d\n", data[0], data[1], data[2]);
}


x86 assembly (clang, -O0):
<fun13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun13>:
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [34 x i8] c"data[0] %d data[1] %d data[2] %d\0A\00"
define void @fun13(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6)
ret void
}
int hash_compare_u_int(void *a, void *b) { return (a == b) ? 0 : -1; }


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

x86 assembly (clang, -O2):
<hash_compare_u_int>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @hash_compare_u_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash_compare_u_int(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
void hisfc350_get_best_clock(unsigned int *clock) {
  int ix;
  int clk_reg;
  unsigned int sysclk[] = {
      (((24) + 1) >> 1),
      (0 << 2),
      (((74) + 1) >> 1),
      ((0 << 3) | (1 << 2)),
      (((112) + 1) >> 1),
      ((1 << 3) | (1 << 2)),
      0,
      0,
  };
  clk_reg = (0 << 2);
  for (ix = 0; sysclk[ix]; ix += 2) {
    if (*clock < sysclk[ix])
      break;
    clk_reg = sysclk[ix + 1];
  }
  *clock = clk_reg;
}


x86 assembly (clang, -O0):
<hisfc350_get_best_clock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0xef1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
je     1187 <hisfc350_get_best_clock+0x87>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jae    116a <hisfc350_get_best_clock+0x6a>
jmp    1187 <hisfc350_get_best_clock+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <hisfc350_get_best_clock+0x42>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hisfc350_get_best_clock>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    $0x38,%eax
setae  %cl
xor    %edx,%edx
cmp    $0x25,%eax
lea    0x4(,%rcx,8),%eax
cmovb  %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
@__const.hisfc350_get_best_clock.sysclk = [8 x i32] [i32 12, i32 0, i32 37, i32 4, i32 56, i32 12, i32 0, i32 0]
define void @hisfc350_get_best_clock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x i32]
store i32* %0, i32** %2
%6 = bitcast [8 x i32]* %5 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %28, %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %7
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp ult i32 %15, %19
br i1 %20, label %21, label %22
21: ; preds = %13
br label %31
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %4
br label %28
28: ; preds = %22
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 2
store i32 %30, i32* %3
br label %7
31: ; preds = %21, %7
%32 = load i32, i32* %4
%33 = load i32*, i32** %2
store i32 %32, i32* %33
ret void
}

LLVM IR (-O2):
define void @hisfc350_get_best_clock(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ult i32 %2, 37
%4 = icmp ult i32 %2, 56
%5 = select i1 %4, i32 4, i32 12
%6 = select i1 %3, i32 0, i32 %5
store i32 %6, i32* %0
ret void
}
void gpt_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @gpt_iomux_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a;
  unsigned long iptr = (unsigned long)&a;
  int *p = (int *)iptr;
  *p = 8;
  test_assert(a == 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
cmpl   $0x8,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int slk_touch();
int wrap_slk_touch(void) { return slk_touch(); }


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

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

LLVM IR (-O0):
define i32 @wrap_slk_touch() {
%1 = call i32 (...) @slk_touch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_slk_touch() {
%1 = tail call i32 (...) @slk_touch()
ret i32 %1
}
/* Variables and functions */
int s2qwc();
int s2qwc_() { return s2qwc(); }


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

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

LLVM IR (-O0):
define i32 @s2qwc_() {
%1 = call i32 (...) @s2qwc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @s2qwc_() {
%1 = tail call i32 (...) @s2qwc()
ret i32 %1
}
int decimal5_opt(int *x) {
  int val = 0;
  int *xend = x + 4;
  do {
    val = (10 * val) + *x;
    x++;
  } while (x <= xend);
  return val;
}


x86 assembly (clang, -O0):
<decimal5_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    111b <decimal5_opt+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal5_opt>:
mov    (%rdi),%eax
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    0x4(%rdi),%eax
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    0x8(%rdi),%eax
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    0xc(%rdi),%eax
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    0x10(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @decimal5_opt(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = mul nsw i32 %2, 10
%5 = load i32, i32* %3
%6 = add nsw i32 %5, %4
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = mul nsw i32 %6, 10
%9 = load i32, i32* %7
%10 = add nsw i32 %9, %8
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = mul nsw i32 %10, 10
%13 = load i32, i32* %11
%14 = add nsw i32 %13, %12
%15 = getelementptr inbounds i32, i32* %0, i64 4
%16 = mul nsw i32 %14, 10
%17 = load i32, i32* %15
%18 = add nsw i32 %17, %16
ret i32 %18
}
long double floorl(long double x) { return __builtin_floorl(x); }


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

x86 assembly (clang, -O2):
<floorl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <floorl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @floorl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.floor.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @floorl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.floor.f80(x86_fp80 %0)
ret x86_fp80 %2
}
int minInt(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<minInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <minInt+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <minInt+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minInt>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @minInt(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @minInt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ buffer_extendby(struct buffer *, size_t);
int errno;
int buffer_reserve(struct buffer *buf, size_t reserve) {
  if (buffer_extendby(buf, reserve) < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<buffer_reserve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <buffer_extendby@plt>
cmp    $0x0,%rax
jge    114a <buffer_reserve+0x3a>
xor    %eax,%eax
mov    0x2ea0(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <buffer_reserve+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_reserve>:
push   %rax
call   1030 <buffer_extendby@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
sar    $0x3f,%rax
and    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
@errno = global i32 0
define i32 @buffer_reserve(%struct.buffer* %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.buffer*
%5 = alloca i64
store %struct.buffer* %0, %struct.buffer** %4
store i64 %1, i64* %5
%6 = load %struct.buffer*, %struct.buffer** %4
%7 = load i64, i64* %5
%8 = call i64 @buffer_extendby(%struct.buffer* %6, i64 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = sub nsw i32 0, %11
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
@errno = global i32 0
define i32 @buffer_reserve(%struct.buffer* %0, i64 %1) {
%3 = tail call i64 @buffer_extendby(%struct.buffer* %0, i64 %1)
%4 = icmp slt i64 %3, 0
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int scanf(char *, float *);
int /*<<< orphan*/ stdin;
void readFloat1(float *variableAddress) {
  bool ret;
  do {
    ret = scanf("%f", variableAddress);
    __fpurge(stdin);
  } while (ret != true);
}


x86 assembly (clang, -O0):
<readFloat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cmpl   $0x1,-0xc(%rbp)
jne    112c <readFloat1+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFloat1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xecf(%rip),%r14
mov    0x2eb0(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %eax,%ebp
mov    (%r15),%edi
call   1030 <__fpurge@plt>
cmp    $0x1,%ebp
jne    1140 <readFloat1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@stdin = global i32 0
define void @readFloat1(float* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %0)
%4 = load i32, i32* @stdin
%5 = tail call i32 @__fpurge(i32 %4)
%6 = icmp eq i32 %3, 1
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void btff_perror(const char *s) {
  for (; *s; s++)
    write(2, s, 1);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<btff_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <btff_perror+0x3d>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <btff_perror+0xc>
mov    $0x1,%edx
lea    0xea7(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btff_perror>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <btff_perror+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <btff_perror+0x10>
lea    0xebd(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @btff_perror(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @write(i32 2, i8* %5, i32 1)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jwArr_raw(char *);
void jwArr_bool(int oneOrZero) { jwArr_raw((oneOrZero) ? "true" : "false"); }


x86 assembly (clang, -O0):
<jwArr_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee0(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <jwArr_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jwArr_bool>:
test   %edi,%edi
lea    0xeec(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <jwArr_raw@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define void @jwArr_bool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%7 = call i32 @jwArr_raw(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define void @jwArr_bool(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @jwArr_raw(i8* %3)
ret void
}
int isUpperAlpha(char c) {
  if ((c >= 'A') && (c <= 'Z'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isUpperAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <isUpperAlpha+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <isUpperAlpha+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isUpperAlpha+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUpperAlpha>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isUpperAlpha(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isUpperAlpha(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int intcmp(void *context, const void *first, const void *second) {
  return *(const int *)first - *(const int *)second;
}


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

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

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

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %2 to i32*
%7 = load i32, i32* %6
%8 = sub nsw i32 %5, %7
ret i32 %8
}
/* Type definitions */
struct pico_mqtt_serializer {
  int dummy;
};

/* Variables and functions */
int serialize_sudirribtion(struct pico_mqtt_serializer *, int);
int serialize_sudirribe(struct pico_mqtt_serializer *serializer) {
  do {
  } while (0);
  return serialize_sudirribtion(serializer, 1);
}


x86 assembly (clang, -O0):
<serialize_sudirribe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <serialize_sudirribe+0x11>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <serialize_sudirribtion@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_sudirribe>:
mov    $0x1,%esi
jmp    1030 <serialize_sudirribtion@plt>

LLVM IR (-O0):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_sudirribe(%struct.pico_mqtt_serializer* %0) {
%2 = alloca %struct.pico_mqtt_serializer*
store %struct.pico_mqtt_serializer* %0, %struct.pico_mqtt_serializer** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load %struct.pico_mqtt_serializer*, %struct.pico_mqtt_serializer** %2
%6 = call i32 @serialize_sudirribtion(%struct.pico_mqtt_serializer* %5, i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_sudirribe(%struct.pico_mqtt_serializer* %0) {
%2 = tail call i32 @serialize_sudirribtion(%struct.pico_mqtt_serializer* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
void crError(char *, char *, char *, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void crMemZero(void *ptr, unsigned int bytes) {
  ((ptr) ? (void)0
         : crError("Assertion failed: %s, file %s, line %d", "ptr",
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/alown/chromium/refs/"
                   "heads/cmake-fixing/util/mem.c",
                   129));
  memset(ptr, 0, bytes);
}


x86 assembly (clang, -O0):
<crMemZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <crMemZero+0x1f>
jmp    115e <crMemZero+0x3e>
lea    0xeba(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xed7(%rip),%rdx
mov    $0x81,%ecx
call   1030 <crError@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crMemZero>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rdi,%rdi
jne    114c <crMemZero+0x2c>
lea    0xecc(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xee9(%rip),%rdx
mov    $0x81,%ecx
call   1030 <crError@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memset@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Assertion failed: %s, file %s, line %d\00"
@.str.1 = [4 x i8] c"ptr\00"
@.str.2 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alown/chromium/refs/heads/cmake-fixing/util/mem.c\00"
define void @crMemZero(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %9
8: ; preds = %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @memset(i8* %10, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Assertion failed: %s, file %s, line %d\00"
@.str.1 = [4 x i8] c"ptr\00"
@.str.2 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alown/chromium/refs/heads/cmake-fixing/util/mem.c\00"
define void @crMemZero(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @crError(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i32 129)
br label %5
5: ; preds = %2, %4
%6 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ st7036_cursor_position(int, int);
void lcd_cursor_pos(int col, int row) {
  int c, r;
  c = col % 16;
  r = r % 3;
  st7036_cursor_position(c, r);
}


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

x86 assembly (clang, -O2):
<lcd_cursor_pos>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
sub    %eax,%edi
xor    %esi,%esi
jmp    1030 <st7036_cursor_position@plt>

LLVM IR (-O0):
define void @lcd_cursor_pos(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = srem i32 %7, 16
store i32 %8, i32* %5
%9 = load i32, i32* %6
%10 = srem i32 %9, 3
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @st7036_cursor_position(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @lcd_cursor_pos(i32 %0, i32 %1) {
%3 = srem i32 %0, 16
%4 = tail call i32 @st7036_cursor_position(i32 %3, i32 0)
ret void
}
int main(int argc, char **argv) {
  int x;
  float r = argc;
  if (0 >= r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x18(%rbp),%xmm0
jb     1135 <main+0x35>
movl   $0x7,-0x14(%rbp)
jmp    113c <main+0x3c>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x7,%ecx
mov    $0x2a,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
store float %9, float* %7
%10 = load float, float* %7
%11 = fcmp oge float 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 7, i32 42
ret i32 %4
}
void init_cfs(void) { return; }


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

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

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

LLVM IR (-O2):
define void @init_cfs() {
ret void
}
int shmatch(p, s, cs) const char *p;
const char *s;
int cs;
{ return recmatch(p, s, cs) == 1; }


x86 assembly (clang, -O0):
<shmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <recmatch@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmatch>:
push   %rax
xor    %eax,%eax
call   1030 <recmatch@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @shmatch(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @recmatch to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _bad_stack_set(int);
void stack_odd_address(void) { _bad_stack_set(0x87654321); }


x86 assembly (clang, -O0):
<stack_odd_address>:
push   %rbp
mov    %rsp,%rbp
mov    $0x87654321,%edi
call   1030 <_bad_stack_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_odd_address>:
mov    $0x87654321,%edi
jmp    1030 <_bad_stack_set@plt>

LLVM IR (-O0):
define void @stack_odd_address() {
%1 = call i32 @_bad_stack_set(i32 -2023406815)
ret void
}

LLVM IR (-O2):
define void @stack_odd_address() {
%1 = tail call i32 @_bad_stack_set(i32 -2023406815)
ret void
}
int test_imm_1Aint8_mem(signed char *val) {
  return ((*val) & (-0x1A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Aint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffe6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_1Aint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -26
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_1Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -26
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned lcg(unsigned seed, unsigned max) {
  return (seed * 1103515245 + 12345) % max;
}


x86 assembly (clang, -O0):
<lcg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x41c64e6d,-0x4(%rbp),%eax
add    $0x3039,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg>:
imul   $0x41c64e6d,%edi,%eax
add    $0x3039,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @lcg(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 = mul i32 %5, 1103515245
%7 = add i32 %6, 12345
%8 = load i32, i32* %4
%9 = urem i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @lcg(i32 %0, i32 %1) {
%3 = mul i32 %0, 1103515245
%4 = add i32 %3, 12345
%5 = urem i32 %4, %1
ret i32 %5
}
int test_imm_E9uint8_reg(unsigned char val) {
  return ((val) & (-0xE9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E9uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff17,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E9uint8_reg>:
test   $0x17,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E9uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -233
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_E9uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 23
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int pd(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", pd(NULL));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @pd(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int atoi(const char *s) {
  int val = 0;
  while (*s >= '0' && *s <= '9') {
    val *= 10;
    val += *s++ - '0';
  }
  return val;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <atoi+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <atoi+0x44>
jmp    116b <atoi+0x6b>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
int __PHYSFS_platformDeinit(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @__PHYSFS_platformDeinit() {
ret i32 1
}

LLVM IR (-O2):
define i32 @__PHYSFS_platformDeinit() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_rx_rmpa();
void rmpa(int *multiplicand, int *multiplier, int num) { __builtin_rx_rmpa(); }


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

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

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

LLVM IR (-O2):
define void @rmpa(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (...) @__builtin_rx_rmpa()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct udphdr {
  int /*<<< orphan*/ uh_sum;
};

/* Variables and functions */
uint16_t *udphdr_uh_sum(struct udphdr *udp) { return &udp->uh_sum; }


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

x86 assembly (clang, -O2):
<udphdr_uh_sum>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.udphdr = type { i32 }
define i32* @udphdr_uh_sum(%struct.udphdr* readnone %0) {
%2 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %0, i64 0, i32 0
ret i32* %2
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ readData(int, long, char *, long);
int /*<<< orphan*/ strrev(char *);
int /*<<< orphan*/ writeData(int, long, char *, long);
void modifyString(int pid, long addr, long len) {
  char *str;
  str = (char *)calloc(sizeof(char) * (len + 1), 1);
  readData(pid, addr, str, len);
  strrev(str);
  writeData(pid, addr, str, len);
}


x86 assembly (clang, -O0):
<modifyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <readData@plt>
mov    -0x20(%rbp),%rdi
call   1050 <strrev@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1060 <writeData@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modifyString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%r15d
lea    0x1(%rdx),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbp
mov    %r15d,%edi
mov    %r14,%rsi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1030 <readData@plt>
mov    %rbp,%rdi
call   1050 <strrev@plt>
mov    %r15d,%edi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <writeData@plt>

LLVM IR (-O0):
define void @modifyString(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = add nsw i64 %8, 1
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @calloc(i32 %11, i32 1)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %7
%14 = load i32, i32* %4
%15 = load i64, i64* %5
%16 = load i8*, i8** %7
%17 = load i64, i64* %6
%18 = call i32 @readData(i32 %14, i64 %15, i8* %16, i64 %17)
%19 = load i8*, i8** %7
%20 = call i32 @strrev(i8* %19)
%21 = load i32, i32* %4
%22 = load i64, i64* %5
%23 = load i8*, i8** %7
%24 = load i64, i64* %6
%25 = call i32 @writeData(i32 %21, i64 %22, i8* %23, i64 %24)
ret void
}

LLVM IR (-O2):
define void @modifyString(i32 %0, i64 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = add i32 %4, 1
%6 = tail call i64 @calloc(i32 %5, i32 1)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @readData(i32 %0, i64 %1, i8* %7, i64 %2)
%9 = tail call i32 @strrev(i8* %7)
%10 = tail call i32 @writeData(i32 %0, i64 %1, i8* %7, i64 %2)
ret void
}
void RTMemCacheCreate(void) {}


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

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

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

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