xunge/DecIR huggingface dataset:
/* Type definitions */
struct dh_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cleanup_ctx(struct dh_ctx *);
void dh_cleanup(struct dh_ctx *ctx) { cleanup_ctx(ctx); }


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

x86 assembly (clang, -O2):
<dh_cleanup>:
jmp    1030 <cleanup_ctx@plt>

LLVM IR (-O0):
%struct.dh_ctx = type { i32 }
define void @dh_cleanup(%struct.dh_ctx* %0) {
%2 = alloca %struct.dh_ctx*
store %struct.dh_ctx* %0, %struct.dh_ctx** %2
%3 = load %struct.dh_ctx*, %struct.dh_ctx** %2
%4 = call i32 @cleanup_ctx(%struct.dh_ctx* %3)
ret void
}

LLVM IR (-O2):
%struct.dh_ctx = type { i32 }
define void @dh_cleanup(%struct.dh_ctx* %0) {
%2 = tail call i32 @cleanup_ctx(%struct.dh_ctx* %0)
ret void
}
unsigned read_option_lowlevel(unsigned start, unsigned size, unsigned def) {
  return def;
}


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

x86 assembly (clang, -O2):
<read_option_lowlevel>:
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @read_option_lowlevel(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 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @read_option_lowlevel(i32 %0, i32 %1, i32 returned %2) {
ret i32 %2
}
void sbp_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @sbp_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get_file_content(char const *, char **, int /*<<< orphan*/);
int /*<<< orphan*/ parse_tldrpage(char *);
int print_localpage(char const *path) {
  char *output = NULL;
  if (!get_file_content(path, &output, 0)) {
    parse_tldrpage(output);
    free(output);
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_localpage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1050 <get_file_content@plt>
cmp    $0x0,%eax
jne    117a <print_localpage+0x4a>
mov    -0x18(%rbp),%rdi
call   1040 <parse_tldrpage@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1181 <print_localpage+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_localpage>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1050 <get_file_content@plt>
test   %eax,%eax
jne    1159 <print_localpage+0x29>
mov    (%rsp),%rdi
call   1040 <parse_tldrpage@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @print_localpage(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* null, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @get_file_content(i8* %5, i8** %4, i32 0)
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = call i32 @parse_tldrpage(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @print_localpage(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @get_file_content(i8* %0, i8** %2, i32 0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @parse_tldrpage(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %1, %6
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_hv48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv48_10_avx2() {
ret void
}
int utl_peg_vspace(const char *str) {
  int ret = 0;
  while (1) {
    switch (*str) {
    case '\r':
    case '\n':
    case '\v':
    case '\f':
    case '\b':
    case '\a':
    case ' ':
    case '\t':
    case '\xA0':
      ret++;
      str++;
      break;
    default:
      return ret;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<utl_peg_vspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0xffffffa0,%eax
je     114c <utl_peg_vspace+0x4c>
jmp    1127 <utl_peg_vspace+0x27>
mov    -0x10(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x7,%eax
jb     114c <utl_peg_vspace+0x4c>
jmp    113b <utl_peg_vspace+0x3b>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
jne    1166 <utl_peg_vspace+0x66>
jmp    114c <utl_peg_vspace+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116b <utl_peg_vspace+0x6b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    110f <utl_peg_vspace+0xf>

x86 assembly (clang, -O2):
<utl_peg_vspace>:
xor    %eax,%eax
jmp    1114 <utl_peg_vspace+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
movsbl (%rdi,%rax,1),%ecx
lea    -0x7(%rcx),%edx
cmp    $0x7,%edx
jb     1110 <utl_peg_vspace+0x10>
cmp    $0x20,%ecx
je     1110 <utl_peg_vspace+0x10>
cmp    $0xffffffa0,%ecx
je     1110 <utl_peg_vspace+0x10>
ret

LLVM IR (-O0):
define i32 @utl_peg_vspace(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %15
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %13 [
i32 13, label %8
i32 10, label %8
i32 11, label %8
i32 12, label %8
i32 8, label %8
i32 7, label %8
i32 32, label %8
i32 9, label %8
i32 -96, label %8
]
8: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %15
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
15: ; preds = %8
br label %4
}

LLVM IR (-O2):
define i32 @utl_peg_vspace(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i32 [ 0, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %10 [
i32 13, label %7
i32 10, label %7
i32 11, label %7
i32 12, label %7
i32 8, label %7
i32 7, label %7
i32 32, label %7
i32 9, label %7
i32 -96, label %7
]
7: ; preds = %2, %2, %2, %2, %2, %2, %2, %2, %2
%8 = add nuw nsw i32 %4, 1
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret i32 %4
}
int json_parser_on_uint(void *ctx, unsigned int i) { return -1; }


x86 assembly (clang, -O0):
<json_parser_on_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @json_parser_on_uint(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
int mither(int x) { return x * 8; }


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

x86 assembly (clang, -O2):
<mither>:
lea    0x0(,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @mither(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
ret i32 %4
}

LLVM IR (-O2):
define i32 @mither(i32 %0) {
%2 = shl nsw i32 %0, 3
ret i32 %2
}
int f(unsigned int x, int n) { return ((int)x) / (1 << n); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @f(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 = shl i32 1, %6
%8 = sdiv i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sdiv i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FixXY(int, int /*<<< orphan*/);
void BSx(void) { FixXY(-8, 0); }


x86 assembly (clang, -O0):
<BSx>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffff8,%edi
xor    %esi,%esi
call   1030 <FixXY@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSx>:
mov    $0xfffffff8,%edi
xor    %esi,%esi
jmp    1030 <FixXY@plt>

LLVM IR (-O0):
define void @BSx() {
%1 = call i32 @FixXY(i32 -8, i32 0)
ret void
}

LLVM IR (-O2):
define void @BSx() {
%1 = tail call i32 @FixXY(i32 -8, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_id(char *id) {
  write("json-task.json", "\"task-id\":\"%s\", ", id);
}


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

x86 assembly (clang, -O2):
<function_id>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [17 x i8] c"\22task-id\22:\22%s\22, \00"
define void @function_id(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [17 x i8] c"\22task-id\22:\22%s\22, \00"
define void @function_id(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insl(unsigned int, void *, unsigned long);
void nsp32_multi_read4(unsigned int base, unsigned int reg, void *buf,
                       unsigned long count) {
  insl(base + reg, buf, count);
}


x86 assembly (clang, -O0):
<nsp32_multi_read4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <insl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp32_multi_read4>:
add    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <insl@plt>

LLVM IR (-O0):
define void @nsp32_multi_read4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @insl(i32 %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @nsp32_multi_read4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = add i32 %1, %0
%6 = tail call i32 @insl(i32 %5, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ html(char *);
int /*<<< orphan*/ html_attr(char *);
void html_hidden(char *name, char *value) {
  html("<input type='hidden' name='");
  html_attr(name);
  html("' value='");
  html_attr(value);
  html("'/>");
}


x86 assembly (clang, -O0):
<html_hidden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <html@plt>
mov    -0x8(%rbp),%rdi
call   1040 <html_attr@plt>
lea    0xed0(%rip),%rdi
call   1030 <html@plt>
mov    -0x10(%rbp),%rdi
call   1040 <html_attr@plt>
lea    0xec5(%rip),%rdi
call   1030 <html@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_hidden>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <html@plt>
mov    %rbx,%rdi
call   1040 <html_attr@plt>
lea    0xed7(%rip),%rdi
call   1030 <html@plt>
mov    %r14,%rdi
call   1040 <html_attr@plt>
lea    0xecd(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <html@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"<input type='hidden' name='\00"
@.str.1 = [10 x i8] c"' value='\00"
@.str.2 = [4 x i8] c"'/>\00"
define void @html_hidden(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @html(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 @html_attr(i8* %6)
%8 = call i32 @html(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = call i32 @html_attr(i8* %9)
%11 = call i32 @html(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"<input type='hidden' name='\00"
@.str.1 = [10 x i8] c"' value='\00"
@.str.2 = [4 x i8] c"'/>\00"
define void @html_hidden(i8* %0, i8* %1) {
%3 = tail call i32 @html(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @html_attr(i8* %0)
%5 = tail call i32 @html(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @html_attr(i8* %1)
%7 = tail call i32 @html(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  x = __VERIFIER_nondet_int();
  while (x <= 10) {
    if (x > 6) {
      x = x + 2;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     114b <main+0x3b>
cmpl   $0x6,-0x8(%rbp)
jle    1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0xa,%eax
jg     1130 <main+0x20>
nopl   (%rax)
lea    0x2(%rax),%ecx
cmp    $0x7,%eax
cmovl  %eax,%ecx
mov    %ecx,%eax
cmp    $0xb,%ecx
jl     1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 11
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
%5 = icmp sgt i32 %4, 6
%6 = add nsw i32 %4, 2
%7 = select i1 %5, i32 %6, i32 %4
%8 = icmp slt i32 %7, 11
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void emit_popa() {
  assem_debug("popa\n");
  assert(0);
}


x86 assembly (clang, -O0):
<emit_popa>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
xor    %edi,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_popa>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"popa\0A\00"
define void @emit_popa() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"popa\0A\00"
define void @emit_popa() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
unsigned long get_XConfigureRequestEvent_window(void *_p) {
  return (unsigned long)((XConfigureRequestEvent *)_p)->window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XConfigureRequestEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XConfigureRequestEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
bool isvalidansi(char c) {
  if ('0' <= c && c <= '9')
    return true;
  return c == ';';
}


x86 assembly (clang, -O0):
<isvalidansi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1134 <isvalidansi+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1134 <isvalidansi+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1146 <isvalidansi+0x46>
movsbl -0x5(%rbp),%eax
cmp    $0x3b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvalidansi>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
cmp    $0x3b,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isvalidansi(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 sle i32 48, %5
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, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %17
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 59
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @isvalidansi(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = icmp eq i8 %0, 59
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char s[] = "abcd";
  printf("%s\n", s);
  reverse(s);
  printf("%s\n", s);
  reverse(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x9(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x9(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x9(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x9(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x64636261,(%rsp)
lea    0xece(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"abcd\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverse(i8* %6)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%11 = call i32 @reverse(i8* %10)
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [5 x i8] c"abcd\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void RTVfsLockReleaseReadSlow(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsLockReleaseReadSlow() {
ret void
}
/* Variables and functions */
int M_PI;
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int sin(int);
int /*<<< orphan*/ stdout;
int main() {
  int i, ch;
  for (i = 0; i < 256; i++) {
    ch = 127 * sin(i * M_PI * 2 / 256);
    fputc(ch & 255, stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    118d <main+0x6d>
mov    -0x8(%rbp),%eax
mov    0x2e9b(%rip),%rcx
imul   (%rcx),%eax
shl    $0x1,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <sin@plt>
imul   $0x7f,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
mov    0x2eba(%rip),%r14
mov    0x2ea3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14),%eax
imul   %ebx,%eax
lea    0x7f(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x7,%edi
call   1040 <sin@plt>
mov    %eax,%ecx
shl    $0x7,%ecx
sub    %eax,%ecx
movzbl %cl,%edi
mov    (%r15),%esi
call   1030 <fputc@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@M_PI = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* @M_PI
%10 = mul nsw i32 %8, %9
%11 = mul nsw i32 %10, 2
%12 = sdiv i32 %11, 256
%13 = call i32 @sin(i32 %12)
%14 = mul nsw i32 127, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = and i32 %15, 255
%17 = load i32, i32* @stdout
%18 = call i32 @fputc(i32 %16, i32 %17)
br label %19
19: ; preds = %7
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %4
22: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@M_PI = global i32 0
@stdout = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %11, %1 ]
%3 = load i32, i32* @M_PI
%4 = mul nsw i32 %3, %2
%5 = sdiv i32 %4, 128
%6 = tail call i32 @sin(i32 %5)
%7 = mul nsw i32 %6, 127
%8 = and i32 %7, 255
%9 = load i32, i32* @stdout
%10 = tail call i32 @fputc(i32 %8, i32 %9)
%11 = add nuw nsw i32 %2, 1
%12 = icmp eq i32 %11, 256
br i1 %12, label %13, label %1
13: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int foo(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[4];
  printf("a: %zu\n", sizeof(a));
  printf("foo(a): %zd\n", foo(a));
  printf("sizeof(int *): %zu\n", sizeof(int *));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
call   1040 <foo@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"a: %zu\0A\00"
@.str.1 = [13 x i8] c"foo(a): %zd\0A\00"
@.str.2 = [20 x i8] c"sizeof(int *): %zu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"a: %zu\0A\00"
@.str.1 = [13 x i8] c"foo(a): %zd\0A\00"
@.str.2 = [20 x i8] c"sizeof(int *): %zu\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ code;

/* Variables and functions */
int /*<<< orphan*/ __console_write(char const *, int);
void console_yellow() {
  static const char code[] = {0x1b, '[', '3', '3', ';', '0', '1', 'm'};
  __console_write(code, sizeof(code));
}


x86 assembly (clang, -O0):
<console_yellow>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
call   1030 <__console_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_yellow>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <__console_write@plt>

LLVM IR (-O0):
@console_yellow.code = internal constant [8 x i8] c"\1B[33;01m"
define void @console_yellow() {
%1 = call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_yellow.code, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@console_yellow.code = internal constant [8 x i8] c"\1B[33;01m"
define void @console_yellow() {
%1 = tail call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_yellow.code, i64 0, i64 0), i32 8)
ret void
}
int test_imm_7Cuint8_mem(unsigned char *val) {
  return ((*val) & (-0x7C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Cuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -124
%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_7Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -124
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int normaliza_num_entrada(int x) { return x - 1; }


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

x86 assembly (clang, -O2):
<normaliza_num_entrada>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @normaliza_num_entrada(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @normaliza_num_entrada(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Variables and functions */
void excl_dlfree(void *);
void free(void *ptr) { return excl_dlfree(ptr); }


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

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

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

LLVM IR (-O2):
define void @free(i8* %0) {
tail call void @excl_dlfree(i8* %0)
ret void
}
int greatest_digit(int n) {
  int max_digit = n % 10;
  while (n) {
    max_digit = (max_digit < n % 10) ? n % 10 : max_digit;
    n /= 10;
  }
  return max_digit;
}


x86 assembly (clang, -O0):
<greatest_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116d <greatest_digit+0x6d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
cmp    %edx,%eax
jge    114e <greatest_digit+0x4e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    1154 <greatest_digit+0x54>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1115 <greatest_digit+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greatest_digit>:
test   %edi,%edi
je     115f <greatest_digit+0x5f>
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%ecx
mov    %edi,%eax
sub    %ecx,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
cmp    %esi,%eax
cmovl  %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1130 <greatest_digit+0x30>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @greatest_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 10
store i32 %5, i32* %3
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* %2
%16 = srem i32 %15, 10
br label %19
17: ; preds = %9
%18 = load i32, i32* %3
br label %19
19: ; preds = %17, %14
%20 = phi i32 [ %16, %14 ], [ %18, %17 ]
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 10
store i32 %22, i32* %2
br label %6
23: ; preds = %6
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @greatest_digit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = srem i32 %0, 10
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %4, %3 ]
%7 = phi i32 [ %11, %5 ], [ %0, %3 ]
%8 = srem i32 %7, 10
%9 = icmp slt i32 %6, %8
%10 = select i1 %9, i32 %8, i32 %6
%11 = sdiv i32 %7, 10
%12 = add i32 %7, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %15
}
/* Variables and functions */
float M_PI;
float degrees(float radians) { return radians * (180.0f / M_PI); }


x86 assembly (clang, -O0):
<degrees>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mov    0x2ecb(%rip),%rax
divss  (%rax),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees>:
mov    0x2ee1(%rip),%rax
movss  0xef1(%rip),%xmm1
divss  (%rax),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @degrees(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fdiv float 1.800000e+02, %4
%6 = fmul float %3, %5
ret float %6
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @degrees(float %0) {
%2 = load float, float* @M_PI
%3 = fdiv float 1.800000e+02, %2
%4 = fmul float %3, %0
ret float %4
}
/* Variables and functions */
int rmdir(char const *);
int fu_Rmdir(const char *path) { return rmdir(path); }


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

x86 assembly (clang, -O2):
<fu_Rmdir>:
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define i32 @fu_Rmdir(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
ret i32 %2
}
void l1_concrete_overrun_Bad() {
  int a[10];
  a[10] = 0;
}


x86 assembly (clang, -O0):
<l1_concrete_overrun_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @l1_concrete_overrun_Bad() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
store i32 0, i32* %2
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @_cc3_set_cam_ddr_i2c_idle() {
ret void
}
void init_debug_table(volatile float *table) {
  int i;
  for (i = 0; i < 800; i++) {
    table[i] = 0;
  }
}


x86 assembly (clang, -O0):
<init_debug_table>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x320,-0xc(%rbp)
jge    113a <init_debug_table+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_debug_table+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_debug_table>:
mov    $0x7,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movl   $0x0,-0x1c(%rdi,%rax,4)
movl   $0x0,-0x18(%rdi,%rax,4)
movl   $0x0,-0x14(%rdi,%rax,4)
movl   $0x0,-0x10(%rdi,%rax,4)
movl   $0x0,-0xc(%rdi,%rax,4)
movl   $0x0,-0x8(%rdi,%rax,4)
movl   $0x0,-0x4(%rdi,%rax,4)
movl   $0x0,(%rdi,%rax,4)
add    $0x8,%rax
cmp    $0x327,%rax
jne    1110 <init_debug_table+0x10>
ret

LLVM IR (-O0):
define void @init_debug_table(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 800
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
store volatile float 0.000000e+00, float* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @init_debug_table(float* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %19, %2 ]
%4 = getelementptr inbounds float, float* %0, i64 %3
store volatile float 0.000000e+00, float* %4
%5 = or i64 %3, 1
%6 = getelementptr inbounds float, float* %0, i64 %5
store volatile float 0.000000e+00, float* %6
%7 = or i64 %3, 2
%8 = getelementptr inbounds float, float* %0, i64 %7
store volatile float 0.000000e+00, float* %8
%9 = or i64 %3, 3
%10 = getelementptr inbounds float, float* %0, i64 %9
store volatile float 0.000000e+00, float* %10
%11 = or i64 %3, 4
%12 = getelementptr inbounds float, float* %0, i64 %11
store volatile float 0.000000e+00, float* %12
%13 = or i64 %3, 5
%14 = getelementptr inbounds float, float* %0, i64 %13
store volatile float 0.000000e+00, float* %14
%15 = or i64 %3, 6
%16 = getelementptr inbounds float, float* %0, i64 %15
store volatile float 0.000000e+00, float* %16
%17 = or i64 %3, 7
%18 = getelementptr inbounds float, float* %0, i64 %17
store volatile float 0.000000e+00, float* %18
%19 = add nuw nsw i64 %3, 8
%20 = icmp eq i64 %19, 800
br i1 %20, label %21, label %2
21: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int /*<<< orphan*/ check_printf(char *, int /*<<< orphan*/, double);
int /*<<< orphan*/ d();
int /*<<< orphan*/ f(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/, int);
main(int argc) {
  int i = 5;
  check_printf("%d %.1f\n", f(a(), b(), c(), d(), i), 1.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    $0x0,%al
call   1070 <a@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <b@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <c@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <d@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
mov    -0xc(%rbp),%r8d
call   1050 <f@plt>
mov    %eax,%esi
lea    0xe4d(%rip),%rdi
movsd  0xe3d(%rip),%xmm0
call   1080 <check_printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <a@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <b@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <c@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <d@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
mov    $0x5,%r8d
call   1050 <f@plt>
lea    0xe66(%rip),%rdi
movsd  0xe56(%rip),%xmm0
mov    %eax,%esi
call   1080 <check_printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %.1f\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
store i32 5, i32* %4
%5 = call i32 (...) @a()
%6 = call i32 (...) @b()
%7 = call i32 (...) @c()
%8 = call i32 (...) @d()
%9 = load i32, i32* %4
%10 = call i32 @f(i32 %5, i32 %6, i32 %7, i32 %8, i32 %9)
%11 = call i32 @check_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, double 1.000000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %.1f\0A\00"
define i32 @main(i32 %0) {
%2 = tail call i32 (...) @a()
%3 = tail call i32 (...) @b()
%4 = tail call i32 (...) @c()
%5 = tail call i32 (...) @d()
%6 = tail call i32 @f(i32 %2, i32 %3, i32 %4, i32 %5, i32 5)
%7 = tail call i32 @check_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, double 1.000000e+00)
ret i32 0
}
void sbt(float vbuf[], float samp[]) {
  int i;
  vbuf += 1152;
  for (i = 0; i < 36; i++) {
    vbuf -= 32;
    window(vbuf);
    fidct(samp);
    samp += 64;
  }
}


x86 assembly (clang, -O0):
<sbt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1200,%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x24,-0x14(%rbp)
jge    118d <sbt+0x6d>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffff80,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <window@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <fidct@plt>
mov    -0x10(%rbp),%rax
add    $0x100,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <sbt+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbt>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x1180,%ebx
lea    (%r14,%rbx,1),%rdi
xor    %eax,%eax
call   1040 <window@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <fidct@plt>
add    $0x100,%r15
add    $0xffffffffffffff80,%rbx
cmp    $0xffffff80,%ebx
jne    1130 <sbt+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @sbt(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 1152
store float* %7, float** %3
store i32 0, i32* %5
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 36
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 -32
store float* %13, float** %3
%14 = load float*, float** %3
%15 = call i32 (float*, ...) bitcast (i32 (...)* @window to i32 (float*, ...)*)(float* %14)
%16 = load float*, float** %4
%17 = call i32 (float*, ...) bitcast (i32 (...)* @fidct to i32 (float*, ...)*)(float* %16)
%18 = load float*, float** %4
%19 = getelementptr inbounds float, float* %18, i64 64
store float* %19, float** %4
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @sbt(float* %0, float* %1) {
%3 = getelementptr inbounds float, float* %0, i64 1152
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %12, %4 ]
%6 = phi float* [ %1, %2 ], [ %11, %4 ]
%7 = phi float* [ %3, %2 ], [ %8, %4 ]
%8 = getelementptr inbounds float, float* %7, i64 -32
%9 = tail call i32 (float*, ...) bitcast (i32 (...)* @window to i32 (float*, ...)*)(float* %8)
%10 = tail call i32 (float*, ...) bitcast (i32 (...)* @fidct to i32 (float*, ...)*)(float* %6)
%11 = getelementptr inbounds float, float* %6, i64 64
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, 36
br i1 %13, label %14, label %4
14: ; preds = %4
ret void
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int wctomb(char *s, wchar_t wchar) {
  if (s)
    s[0] = wchar;
  return 1;
}


x86 assembly (clang, -O0):
<wctomb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <wctomb+0x22>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb>:
test   %rdi,%rdi
je     1108 <wctomb+0x8>
mov    %sil,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @wctomb(i8* writeonly %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i8 %1, i8* %0
br label %5
5: ; preds = %4, %2
ret i32 1
}
void RAND_seed(const void *buf, int num) {}


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

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

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

LLVM IR (-O2):
define void @RAND_seed(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int vfork();
int main() {
  int r = vfork();
  fprintf(stdout, "vfork():%d\n", r);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
call   1050 <vfork@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <vfork@plt>
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%edi
lea    0xeba(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"vfork():%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @vfork()
store i32 %3, i32* %2
%4 = load i32, i32* @stdout
%5 = load i32, i32* %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"vfork():%d\0A\00"
define i32 @main() {
%1 = call i32 @vfork()
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = call i32 @_exit(i32 0)
unreachable
}