xunge/DecIR huggingface dataset:
int function(void) {
  static int i, state = 0;
  switch (state) {
  case 0:
    goto LABEL0;
  case 1:
    goto LABEL1;
  }
LABEL0:
  for (i = 0; i < 10; ++i) {
    state = 1;
    return i;
  LABEL1:;
  }
  return -1;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112b <function+0x2b>
jmp    111a <function+0x1a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1130 <function+0x30>
jmp    1135 <function+0x35>
jmp    113a <function+0x3a>
jmp    1169 <function+0x69>
jmp    113a <function+0x3a>
movl   $0x0,0x2ee0(%rip)
cmpl   $0xa,0x2ed9(%rip)
jge    1182 <function+0x82>
movl   $0x1,0x2ecd(%rip)
mov    0x2ec3(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <function+0x89>
jmp    116e <function+0x6e>
mov    0x2eb0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ea7(%rip)
jmp    1144 <function+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmpb   $0x0,0x2f16(%rip)
cmovne %eax,%ecx
mov    %ecx,0x2f09(%rip)
mov    $0xffffffff,%eax
cmp    $0x9,%ecx
jg     112e <function+0x2e>
movb   $0x1,0x2efc(%rip)
mov    %ecx,%eax
ret

LLVM IR (-O0):
@function.i = internal global i32 0
@function.state = internal global i32 0
define i32 @function() {
%1 = alloca i32
%2 = load i32, i32* @function.state
switch i32 %2, label %5 [
i32 0, label %3
i32 1, label %4
]
3: ; preds = %0
br label %6
4: ; preds = %0
br label %12
5: ; preds = %0
br label %6
6: ; preds = %5, %3
store i32 0, i32* @function.i
br label %7
7: ; preds = %13, %6
%8 = load i32, i32* @function.i
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %16
10: ; preds = %7
store i32 1, i32* @function.state
%11 = load i32, i32* @function.i
store i32 %11, i32* %1
br label %17
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* @function.i
%15 = add nsw i32 %14, 1
store i32 %15, i32* @function.i
br label %7
16: ; preds = %7
store i32 -1, i32* %1
br label %17
17: ; preds = %16, %10
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@function.i = internal unnamed_addr global i32 0
@function.state = internal unnamed_addr global i1 false
define i32 @function() {
%1 = load i1, i1* @function.state
%2 = load i32, i32* @function.i
%3 = add nsw i32 %2, 1
%4 = select i1 %1, i32 %3, i32 0
store i32 %4, i32* @function.i
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %0
store i1 true, i1* @function.state
br label %7
7: ; preds = %0, %6
%8 = phi i32 [ %4, %6 ], [ -1, %0 ]
ret i32 %8
}
__attribute__((constructor)) void fb_ctor__symbzproc(void) {
label$0:;
label$1:;
}


x86 assembly (clang, -O0):
<fb_ctor__symbzproc>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fb_ctor__symbzproc+0x9>
jmp    110e <fb_ctor__symbzproc+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fb_ctor__symbzproc, i8* null }]
define void @fb_ctor__symbzproc() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @fb_ctor__symbzproc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: truncate <filename> <truncate-position>\n");
  exit(2);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: truncate <filename> <truncate-position>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
const char *message(void) { return "left"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"left\00"
define i8* @message() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void allocbuffers(void) {}


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

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

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

LLVM IR (-O2):
define void @allocbuffers() {
ret void
}
long mobicore_log_setup(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @mobicore_log_setup() {
ret i64 0
}

LLVM IR (-O2):
define i64 @mobicore_log_setup() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ XSUM_log(char *);
int /*<<< orphan*/ XSUM_usage(char const *);
int XSUM_badusage(const char *exename) {
  XSUM_log("Wrong parameters\n\n");
  XSUM_usage(exename);
  return 1;
}


x86 assembly (clang, -O0):
<XSUM_badusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <XSUM_log@plt>
mov    -0x8(%rbp),%rdi
call   1030 <XSUM_usage@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XSUM_badusage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <XSUM_log@plt>
mov    %rbx,%rdi
call   1030 <XSUM_usage@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Wrong parameters\0A\0A\00"
define i32 @XSUM_badusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @XSUM_log(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @XSUM_usage(i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [19 x i8] c"Wrong parameters\0A\0A\00"
define i32 @XSUM_badusage(i8* %0) {
%2 = tail call i32 @XSUM_log(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @XSUM_usage(i8* %0)
ret i32 1
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *val = getenv("HOME");
  printf("%s\n", val);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
float cos(float);
float sin(float);
float tan(float fInput) { return sin(fInput) / cos(fInput); }


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

x86 assembly (clang, -O2):
<tan>:
push   %rax
movss  %xmm0,(%rsp)
call   1030 <sin@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1040 <cos@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sin(float %3)
%5 = load float, float* %2
%6 = call float @cos(float %5)
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @tan(float %0) {
%2 = tail call float @sin(float %0)
%3 = tail call float @cos(float %0)
%4 = fdiv float %2, %3
ret float %4
}
int subtraktion(int a, int b) { return a - b; }


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

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

LLVM IR (-O0):
define i32 @subtraktion(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subtraktion(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int b() {
  a();
  ;
  write(1, "b\n", strlen("b\n"));
  ;
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <a@plt>
lea    0xeba(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xea7(%rip),%rsi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rbx
xor    %eax,%eax
call   1050 <a@plt>
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"b\0A\00"
define i32 @b() {
%1 = alloca i32
%2 = call i32 (...) @a()
%3 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [3 x i8] c"b\0A\00"
define i32 @b() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int threadFunction(void *argument) {
  printf("thread filho executada !\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"thread filho executada !\0A\00"
define i32 @threadFunction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"thread filho executada !\00"
define i32 @threadFunction(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy_test_2(int);
int /*<<< orphan*/ mempcpy_test_2(int);
int /*<<< orphan*/ memset_test_2(int);
void test_stringops_2(int len) {
  memcpy_test_2(len);
  mempcpy_test_2(len);
  memset_test_2(len);
}


x86 assembly (clang, -O0):
<test_stringops_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <memcpy_test_2@plt>
mov    -0x4(%rbp),%edi
call   1050 <mempcpy_test_2@plt>
mov    -0x4(%rbp),%edi
call   1030 <memset_test_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stringops_2>:
push   %rbx
mov    %edi,%ebx
call   1040 <memcpy_test_2@plt>
mov    %ebx,%edi
call   1050 <mempcpy_test_2@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <memset_test_2@plt>

LLVM IR (-O0):
define void @test_stringops_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @memcpy_test_2(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @mempcpy_test_2(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @memset_test_2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @test_stringops_2(i32 %0) {
%2 = tail call i32 @memcpy_test_2(i32 %0)
%3 = tail call i32 @mempcpy_test_2(i32 %0)
%4 = tail call i32 @memset_test_2(i32 %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_quaddobl_target_system_without_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(873, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_quaddobl_target_system_without_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x369,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_quaddobl_target_system_without_solutions>:
mov    $0x369,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @read_quaddobl_target_system_without_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 873, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_quaddobl_target_system_without_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 873, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void LK_LED1_on(void) {}


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

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

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

LLVM IR (-O2):
define void @LK_LED1_on() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void bzero(void *dst, unsigned count) { memset(dst, 0, count); }


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

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

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

LLVM IR (-O2):
define void @bzero(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
int null_indexer(const void *vp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @null_indexer(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quit(int);
int read(int /*<<< orphan*/, char *, int);
char r(void) {
  char ch;
  if (read(0, &ch, 1) != 1)
    quit(1);
  return ch;
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
je     114b <r+0x2b>
mov    $0x1,%edi
call   1030 <quit@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
je     1141 <r+0x21>
mov    $0x1,%edi
call   1030 <quit@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @r() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @quit(i32 1)
br label %6
6: ; preds = %4, %0
%7 = load i8, i8* %1
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @r() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @quit(i32 1)
br label %6
6: ; preds = %4, %0
%7 = load i8, i8* %1
ret i8 %7
}
void destroy(obj) int obj;
{
  move(obj, 0);
  return;
}


x86 assembly (clang, -O0):
<destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <move@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <move@plt>

LLVM IR (-O0):
define void @destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %3, i32 0)
ret void
}

LLVM IR (-O2):
define void @destroy(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void f() { fprintf(stderr, "f\n"); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"f\0A\00"
define void @f() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"f\0A\00"
define void @f() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo_2_1_2_1_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_1_2_2_2_2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_mem(int);
int /*<<< orphan*/ id_to_ram_save_size(int /*<<< orphan*/);
uint8_t get_ram_save_size() { return id_to_ram_save_size(get_mem(0x0149)); }


x86 assembly (clang, -O0):
<get_ram_save_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x149,%edi
call   1030 <get_mem@plt>
mov    %eax,%edi
call   1040 <id_to_ram_save_size@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ram_save_size>:
push   %rax
mov    $0x149,%edi
call   1030 <get_mem@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <id_to_ram_save_size@plt>

LLVM IR (-O0):
define i32 @get_ram_save_size() {
%1 = call i32 @get_mem(i32 329)
%2 = call i32 @id_to_ram_save_size(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_ram_save_size() {
%1 = tail call i32 @get_mem(i32 329)
%2 = tail call i32 @id_to_ram_save_size(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t I2CMasterErr(uint32_t ui32Base) {
  uint32_t ui32Err;
  ;
  ui32Err = (*((volatile uint32_t *)(ui32Base + 0x00000004)));
  if (ui32Err & 0x00000001) {
    return (0);
  }
  if (ui32Err & (0x00000002 | 0x00000010)) {
    return (ui32Err & (0x00000010 | 0x00000008 | 0x00000004));
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<I2CMasterErr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112f <I2CMasterErr+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1153 <I2CMasterErr+0x53>
mov    -0xc(%rbp),%eax
and    $0x12,%eax
cmp    $0x0,%eax
je     114c <I2CMasterErr+0x4c>
mov    -0xc(%rbp),%eax
and    $0x1c,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <I2CMasterErr+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterErr>:
movslq %edi,%rax
mov    0x4(%rax),%ecx
mov    %ecx,%eax
and    $0x12,%eax
mov    %ecx,%edx
and    $0x1c,%edx
test   %eax,%eax
cmove  %eax,%edx
xor    %eax,%eax
test   $0x1,%cl
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterErr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %2
br label %22
14: ; preds = %1
%15 = load i32, i32* %4
%16 = and i32 %15, 18
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %4
%20 = and i32 %19, 28
store i32 %20, i32* %2
br label %22
21: ; preds = %14
store i32 0, i32* %2
br label %22
22: ; preds = %21, %18, %13
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @I2CMasterErr(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
%8 = and i32 %5, 18
%9 = icmp eq i32 %8, 0
%10 = or i1 %7, %9
%11 = and i32 %5, 28
%12 = select i1 %10, i32 0, i32 %11
ret i32 %12
}
char fn1(void) { return 'A'; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @fn1() {
ret i8 65
}

LLVM IR (-O2):
define signext i8 @fn1() {
ret i8 65
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEifeq(int, int /*<<< orphan*/ *);
void code_ifeq(int label) { appendCODE(makeCODEifeq(label, NULL)); }


x86 assembly (clang, -O0):
<code_ifeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <makeCODEifeq@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_ifeq>:
push   %rax
xor    %esi,%esi
call   1040 <makeCODEifeq@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

LLVM IR (-O0):
define void @code_ifeq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @makeCODEifeq(i32 %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_ifeq(i32 %0) {
%2 = tail call i32 @makeCODEifeq(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x1c() {
  Assert_real((isalpha(28) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              145, ("isalpha should be 0 for 0x1c"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1c\00"
define void @t_isalpha_0x1c() {
%1 = tail call i64 @isalpha(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int numa_pagesize(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @numa_pagesize() {
ret i32 0
}

LLVM IR (-O2):
define i32 @numa_pagesize() {
ret i32 0
}
/* Variables and functions */
size_t const SIZE_MAX;
int size_mul_check(const size_t x, const size_t y) {
  return ((x <= (((size_t)SIZE_MAX) >> (sizeof(size_t) * 8 / 2)) &&
           y <= (((size_t)SIZE_MAX) >> (sizeof(size_t) * 8 / 2))) ||
          y == 0 || x <= SIZE_MAX / y);
}


x86 assembly (clang, -O0):
<size_mul_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%rcx
shr    $0x20,%rcx
cmp    %rcx,%rax
ja     1147 <size_mul_check+0x47>
mov    -0x10(%rbp),%rcx
mov    0x2ea6(%rip),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
mov    $0x1,%al
cmp    %rdx,%rcx
mov    %al,-0x11(%rbp)
jbe    1181 <size_mul_check+0x81>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1181 <size_mul_check+0x81>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setbe  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_mul_check>:
test   %rdi,%rdi
sete   %al
test   %rsi,%rsi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@SIZE_MAX = constant i64 0
define i32 @size_mul_check(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* @SIZE_MAX
%7 = lshr i64 %6, 32
%8 = icmp ule i64 %5, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %4
%11 = load i64, i64* @SIZE_MAX
%12 = lshr i64 %11, 32
%13 = icmp ule i64 %10, %12
br i1 %13, label %23, label %14
14: ; preds = %9, %2
%15 = load i64, i64* %4
%16 = icmp eq i64 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i64, i64* %3
%19 = load i64, i64* @SIZE_MAX
%20 = load i64, i64* %4
%21 = udiv i64 %19, %20
%22 = icmp ule i64 %18, %21
br label %23
23: ; preds = %17, %14, %9
%24 = phi i1 [ true, %14 ], [ true, %9 ], [ %22, %17 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
@SIZE_MAX = constant i64 0
define i32 @size_mul_check(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void callee(void **p) {
  int x;
  *p = &x;
}


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

x86 assembly (clang, -O2):
<callee>:
lea    -0x4(%rsp),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @callee(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = bitcast i32* %3 to i8*
%5 = load i8**, i8*** %2
store i8* %4, i8** %5
ret void
}

LLVM IR (-O2):
define void @callee(i8** nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = bitcast i8** %0 to i32**
store i32* %2, i32** %4
ret void
}
const char *DELEGATE_srcsign() {
  return "\n{SRCSIGN=9.9.13:20141031194217+0900:6fdc87e522763a5e:Author@"
         "DeleGate.ORG:hPtX79eyOAnj9pjzcHNLBa2+1uhqjZszJ1UM7y4wXOikCGaUA4aQmK+"
         "kuq0QC/"
         "hng7lskzc9\r\naIjEgOpDo5KF1odrli0RsQJI8nkGIWAW3uYxIFD70pwSAGNteRViGCm"
         "bIdO95QJfTjgTfKhp\r\nTQV3AYSDfyHF4li8dewmsd+oRrA=\r\n}\n" +
         10;
}


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

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

LLVM IR (-O0):
@.str = [255 x i8] c"\0A{SRCSIGN=9.9.13:20141031194217+0900:6fdc87e522763a5e:Author@DeleGate.ORG:hPtX79eyOAnj9pjzcHNLBa2+1uhqjZszJ1UM7y4wXOikCGaUA4aQmK+kuq0QC/hng7lskzc9\0D\0AaIjEgOpDo5KF1odrli0RsQJI8nkGIWAW3uYxIFD70pwSAGNteRViGCmbIdO95QJfTjgTfKhp\0D\0ATQV3AYSDfyHF4li8dewmsd+oRrA=\0D\0A}\0A\00"
define i8* @DELEGATE_srcsign() {
ret i8* getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 10)
}

LLVM IR (-O2):
@.str = [255 x i8] c"\0A{SRCSIGN=9.9.13:20141031194217+0900:6fdc87e522763a5e:Author@DeleGate.ORG:hPtX79eyOAnj9pjzcHNLBa2+1uhqjZszJ1UM7y4wXOikCGaUA4aQmK+kuq0QC/hng7lskzc9\0D\0AaIjEgOpDo5KF1odrli0RsQJI8nkGIWAW3uYxIFD70pwSAGNteRViGCmbIdO95QJfTjgTfKhp\0D\0ATQV3AYSDfyHF4li8dewmsd+oRrA=\0D\0A}\0A\00"
define i8* @DELEGATE_srcsign() {
ret i8* getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 10)
}
/* Variables and functions */
int write(int, char *, size_t);
int _write_bytes(int fd, char *buf, size_t len) {
  if (-1 == fd)
    return 0;
  return write(fd, buf, len);
}


x86 assembly (clang, -O0):
<_write_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
cmp    -0x8(%rbp),%eax
jne    113d <_write_bytes+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1150 <_write_bytes+0x40>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_bytes>:
cmp    $0xffffffff,%edi
je     111a <_write_bytes+0xa>
jmp    1030 <write@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_write_bytes(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i32 %0, -1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
void pci_create_firmware_label_files(struct pci_dev *pdev) { return; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_create_firmware_label_files(%struct.pci_dev* nocapture %0) {
ret void
}
void dummy_sysquotas_c(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dummy_sysquotas_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 5;
  printf("XOR (n^n) = %d\n", x ^ x);
  printf("XOR (n^0) = %d\n", x ^ 0);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"XOR (n^n) = %d\0A\00"
@.str.1 = [16 x i8] c"XOR (n^0) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 %3, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = xor i32 %7, 0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"XOR (n^n) = %d\0A\00"
@.str.1 = [16 x i8] c"XOR (n^0) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ testit(int);
void otest(int flag) { testit(flag); }


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

x86 assembly (clang, -O2):
<otest>:
jmp    1030 <testit@plt>

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

LLVM IR (-O2):
define void @otest(i32 %0) {
%2 = tail call i32 @testit(i32 %0)
ret void
}
int test_imm_39uint8_mem(unsigned char *val) {
  return ((*val) & (0x39 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_39uint8_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, 57
%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_39uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 57
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int inverte(int n) {
  if (n <= 1)
    return 1;
  else {
    printf("%d", (n % 10));
  }
  return inverte((int)(n / 10));
}


x86 assembly (clang, -O0):
<inverte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1141 <inverte+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116f <inverte+0x4f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <inverte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverte>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1153 <inverte+0x43>
mov    %edi,%ebp
lea    0xedb(%rip),%r14
mov    $0xcccccccd,%r15d
nopl   0x0(%rax,%rax,1)
mov    %ebp,%ebx
imul   %r15,%rbx
shr    $0x23,%rbx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ebp,%esi
sub    %eax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
cmp    $0x13,%ebp
mov    %ebx,%ebp
ja     1130 <inverte+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @inverte(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = urem i32 %4, 10
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = udiv i32 %4, 10
%8 = icmp ult i32 %4, 20
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret i32 1
}
void chacha20_preallocate(void) {}


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

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

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

LLVM IR (-O2):
define void @chacha20_preallocate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void case_utils_min() {
  assert(((1) < (3) ? (1) : (3)) == 1);
  assert(((1) < (-3) ? (1) : (-3)) == -3);
}


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

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

LLVM IR (-O0):
define void @case_utils_min() {
%1 = call i32 @assert(i32 1)
%2 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @case_utils_min() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int SK_connect(char *, int, int);
int /*<<< orphan*/ log_to_file(char *, int, char *);
int /*<<< orphan*/ sleep(int);
int try_connect(char *hostname, int port) {
  int sock;
  for (;;) {
    sock = SK_connect(hostname, port, 30);
    if (sock < 0) {
      log_to_file(hostname, port, "connect timeout");
      sleep(3);
      continue;
    }
    return sock;
  }
}


x86 assembly (clang, -O0):
<try_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1e,%edx
call   1030 <SK_connect@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    117f <try_connect+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xe95(%rip),%rdx
call   1040 <log_to_file@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
jmp    113f <try_connect+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_connect>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1e,%edx
call   1030 <SK_connect@plt>
test   %eax,%eax
jns    117a <try_connect+0x4a>
lea    0xeb2(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <log_to_file@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1e,%edx
call   1030 <SK_connect@plt>
test   %eax,%eax
js     1150 <try_connect+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"connect timeout\00"
define i32 @try_connect(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %12, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @SK_connect(i8* %7, i32 %8, i32 30)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @log_to_file(i8* %13, i32 %14, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @sleep(i32 3)
br label %6
17: ; preds = %6
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@.str = [16 x i8] c"connect timeout\00"
define i32 @try_connect(i8* %0, i32 %1) {
%3 = tail call i32 @SK_connect(i8* %0, i32 %1, i32 30)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = tail call i32 @log_to_file(i8* %0, i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 3)
%8 = tail call i32 @SK_connect(i8* %0, i32 %1, i32 30)
%9 = icmp slt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %2
%11 = phi i32 [ %3, %2 ], [ %8, %5 ]
ret i32 %11
}
long call_with_0_arg(int (*func)(), int argc, char **argv) {
  long ret;
  __asm__ __volatile__("xor %%rax, %%rax\n\t"
                       "call *%1\n\t"
                       "movq %%rax, %0"
                       : "=r"(ret)
                       : "r"(func)
                       : "rax");
  return ret;
}


x86 assembly (clang, -O0):
<call_with_0_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %rax,%rax
call   *%rcx
mov    %rax,%rcx
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_with_0_arg>:
xor    %rax,%rax
call   *%rdi
mov    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @call_with_0_arg(i32 (...)* %0, i32 %1, i8** %2) {
%4 = alloca i32 (...)*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i64
store i32 (...)* %0, i32 (...)** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i32 (...)*, i32 (...)** %4
%9 = call i64 asm sideeffect "xor %rax, %rax\0A\09call *$1\0A\09movq %rax, $0", "=r,r,~{rax},~{dirflag},~{fpsr},~{flags}"(i32 (...)* %8)
store i64 %9, i64* %7
%10 = load i64, i64* %7
ret i64 %10
}

LLVM IR (-O2):
define i64 @call_with_0_arg(i32 (...)* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i64 asm sideeffect "xor %rax, %rax\0A\09call *$1\0A\09movq %rax, $0", "=r,r,~{rax},~{dirflag},~{fpsr},~{flags}"(i32 (...)* %0)
ret i64 %4
}
double jac_chain_nm5_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<jac_chain_nm5_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm5_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @jac_chain_nm5_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @jac_chain_nm5_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int f1(int val) {
  int *p;
  if (val == 0) {
    int val = 4;
    p = &val;
  }
  return (*p + 1);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1120 <f1+0x20>
movl   $0x4,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
ret i32 5
}
int get_temp_nr(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_temp_nr() {
ret i32 0
}

LLVM IR (-O2):
define i32 @get_temp_nr() {
ret i32 0
}
int foo(int i, int b) {
  int j = 1;
  if (b)
    j = i;
  return j - i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <foo+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%ecx
sub    %edi,%ecx
xor    %eax,%eax
test   %esi,%esi
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = sub i32 1, %0
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ msg_format(char *, char *, char *);
void do_cmd_version(void) {
  msg_format("You are playing %s %s.  Type '?' for more info.", "Unangband",
             "0.7.0-pre1");
}


x86 assembly (clang, -O0):
<do_cmd_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0e(%rip),%rsi
lea    0xf11(%rip),%rdx
call   1030 <msg_format@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_version>:
lea    0xee9(%rip),%rdi
lea    0xf12(%rip),%rsi
lea    0xf15(%rip),%rdx
jmp    1030 <msg_format@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"You are playing %s %s. Type '?' for more info.\00"
@.str.1 = [10 x i8] c"Unangband\00"
@.str.2 = [11 x i8] c"0.7.0-pre1\00"
define void @do_cmd_version() {
%1 = call i32 @msg_format(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"You are playing %s %s. Type '?' for more info.\00"
@.str.1 = [10 x i8] c"Unangband\00"
@.str.2 = [11 x i8] c"0.7.0-pre1\00"
define void @do_cmd_version() {
%1 = tail call i32 @msg_format(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}