xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
__attribute__((__weak__, __always___)) clock_t softboundmpx_clock(void) {
  return clock();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundmpx_clock() {
%1 = call i32 (...) @clock()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundmpx_clock() {
%1 = tail call i32 (...) @clock()
ret i32 %1
}
/* Variables and functions */
char *malloc(size_t);
char *memcpy(char *, char const *, size_t);
char *str_duplicate(const char *src) {
  size_t len;
  char *dst;
  for (len = 0; src[len] != '\0'; len++)
    ;
  dst = malloc(len + 1);
  dst[len] = '\0';
  return memcpy(dst, src, len);
}


x86 assembly (clang, -O0):
<str_duplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <str_duplicate+0x3f>
jmp    114e <str_duplicate+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <str_duplicate+0x14>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_duplicate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
cmpb   $0x0,(%r14,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1130 <str_duplicate+0x10>
mov    %rbx,%rdi
call   1040 <malloc@plt>
movb   $0x0,-0x1(%rax,%rbx,1)
add    $0xffffffffffffffff,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define noalias i8* @str_duplicate(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = tail call i8* @malloc(i64 %7)
%10 = getelementptr inbounds i8, i8* %9, i64 %3
store i8 0, i8* %10
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %9, i8* align 1 %0, i64 %3, i1 false)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ my_strcpy(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  char buff[16];
  int a = 1;
  printf("hello world,a=%d\n", a);
  my_strcpy(buff, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <my_strcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xed6(%rip),%rsi
mov    %rsp,%rdi
call   1030 <my_strcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"hello world,a=%d\0A\00"
@.str.1 = [41 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%11 = call i32 @my_strcpy(i8* %10, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"hello world,a=%d\0A\00"
@.str.1 = [41 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @my_strcpy(i8* %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STRLTRIM(char *, char *);
int /*<<< orphan*/ STRRTRIM(char *, int /*<<< orphan*/);
int /*<<< orphan*/ UPCASE_STRING(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void FIX_STRING(char *S) {
  char STR1[256], STR2[256], STR3[256];
  strcpy(S, UPCASE_STRING(STR1, STRRTRIM(STR2, STRLTRIM(STR3, S))));
}


x86 assembly (clang, -O0):
<FIX_STRING>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x318(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x320(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x328(%rbp)
lea    -0x310(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <STRLTRIM@plt>
mov    -0x328(%rbp),%rdi
mov    %eax,%esi
call   1050 <STRRTRIM@plt>
mov    -0x320(%rbp),%rdi
mov    %eax,%esi
call   1060 <UPCASE_STRING@plt>
mov    -0x318(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
add    $0x330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIX_STRING>:
push   %rbx
sub    $0x300,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <STRLTRIM@plt>
lea    0x100(%rsp),%rdi
mov    %eax,%esi
call   1050 <STRRTRIM@plt>
lea    0x200(%rsp),%rdi
mov    %eax,%esi
call   1060 <UPCASE_STRING@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
add    $0x300,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @FIX_STRING(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i32 @STRLTRIM(i8* %9, i8* %10)
%12 = call i32 @STRRTRIM(i8* %8, i32 %11)
%13 = call i32 @UPCASE_STRING(i8* %7, i32 %12)
%14 = call i32 @strcpy(i8* %6, i32 %13)
ret void
}

LLVM IR (-O2):
define void @FIX_STRING(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = call i32 @STRLTRIM(i8* %7, i8* %0)
%9 = call i32 @STRRTRIM(i8* %6, i32 %8)
%10 = call i32 @UPCASE_STRING(i8* %5, i32 %9)
%11 = call i32 @strcpy(i8* %0, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_io_client(int /*<<< orphan*/ *);
void *dummy_handle_io_client(void *dummy) {
  handle_io_client(NULL);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @dummy_handle_io_client(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @handle_io_client(i32* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dummy_handle_io_client(i8* nocapture readnone %0) {
%2 = tail call i32 @handle_io_client(i32* null)
ret i8* null
}
char *langDbgDevIdeSviRs() { return "SVI-328 RS IDE"; }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"SVI-328 RS IDE\00"
define i8* @langDbgDevIdeSviRs() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"SVI-328 RS IDE\00"
define i8* @langDbgDevIdeSviRs() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
float ZeroPaddedExtension(const float *Src, int Stride, int N, int n) {
  return (0 <= n && n < N) ? Src[Stride * n] : 0;
}


x86 assembly (clang, -O0):
<ZeroPaddedExtension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jg     1145 <ZeroPaddedExtension+0x45>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1145 <ZeroPaddedExtension+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1152 <ZeroPaddedExtension+0x52>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1152 <ZeroPaddedExtension+0x52>
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZeroPaddedExtension>:
xorps  %xmm0,%xmm0
test   %ecx,%ecx
js     1116 <ZeroPaddedExtension+0x16>
cmp    %edx,%ecx
jge    1116 <ZeroPaddedExtension+0x16>
imul   %esi,%ecx
movslq %ecx,%rax
movss  (%rdi,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @ZeroPaddedExtension(float* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store float* %0, float** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sle i32 0, %9
br i1 %10, label %11, label %23
11: ; preds = %4
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load float*, float** %5
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = mul nsw i32 %17, %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %16, i64 %20
%22 = load float, float* %21
br label %24
23: ; preds = %11, %4
br label %24
24: ; preds = %23, %15
%25 = phi float [ %22, %15 ], [ 0.000000e+00, %23 ]
ret float %25
}

LLVM IR (-O2):
define float @ZeroPaddedExtension(float* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, -1
%6 = icmp slt i32 %3, %2
%7 = and i1 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = mul nsw i32 %3, %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %0, i64 %10
%12 = load float, float* %11
br label %13
13: ; preds = %4, %8
%14 = phi float [ %12, %8 ], [ 0.000000e+00, %4 ]
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_hex();
int /*<<< orphan*/ test_named();
int /*<<< orphan*/ test_rgb();
int /*<<< orphan*/ test_rgba();
int /*<<< orphan*/ test_to_string();
int main(int argc, char **argv) {
  test_named();
  test_rgb();
  test_rgba();
  test_hex();
  test_to_string();
  printf("\n  \e[32m\u2713 \e[90mok\e[0m\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_named@plt>
mov    $0x0,%al
call   1080 <test_rgb@plt>
mov    $0x0,%al
call   1060 <test_rgba@plt>
mov    $0x0,%al
call   1070 <test_hex@plt>
mov    $0x0,%al
call   1040 <test_to_string@plt>
lea    0xe60(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_named@plt>
xor    %eax,%eax
call   1080 <test_rgb@plt>
xor    %eax,%eax
call   1060 <test_rgba@plt>
xor    %eax,%eax
call   1070 <test_hex@plt>
xor    %eax,%eax
call   1050 <test_to_string@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0A \1B[32m\E2\9C\93 \1B[90mok\1B[0m\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_named()
%7 = call i32 (...) @test_rgb()
%8 = call i32 (...) @test_rgba()
%9 = call i32 (...) @test_hex()
%10 = call i32 (...) @test_to_string()
%11 = 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"\0A \1B[32m\E2\9C\93 \1B[90mok\1B[0m\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_named()
%4 = tail call i32 (...) @test_rgb()
%5 = tail call i32 (...) @test_rgba()
%6 = tail call i32 (...) @test_hex()
%7 = tail call i32 (...) @test_to_string()
%8 = 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*/ abort();
assert(_Bool b) {
  if (!b)
    abort();
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
testb  $0x1,-0x5(%rbp)
jne    1131 <assert+0x21>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @assert(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = zext i1 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = trunc i8 %5 to i1
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @assert(i1 zeroext %0) {
br i1 %0, label %4, label %2
2: ; preds = %1
%3 = tail call i32 (...) @abort()
unreachable
4: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int f1(int /*<<< orphan*/);
int main() { return f1(0); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 0)
ret i32 %1
}
/* Variables and functions */
char *__replace_symbols2(char *);
char *services_escape_to_xml(char *str) {
  if (str == NULL)
    return NULL;
  return __replace_symbols2(str);
}


x86 assembly (clang, -O0):
<services_escape_to_xml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <services_escape_to_xml+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <services_escape_to_xml+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <__replace_symbols2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<services_escape_to_xml>:
test   %rdi,%rdi
je     111a <services_escape_to_xml+0xa>
jmp    1030 <__replace_symbols2@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @services_escape_to_xml(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @__replace_symbols2(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *os_open_script_file(void) { return NULL; }


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

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

LLVM IR (-O0):
define i32* @os_open_script_file() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @os_open_script_file() {
ret i32* null
}
void xmpc_traverse_init() {}


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

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

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

LLVM IR (-O2):
define void @xmpc_traverse_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void MemError(void) {
  perror("Error allocating memory:");
  exit(-1);
}


x86 assembly (clang, -O0):
<MemError>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<MemError>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Error allocating memory:\00"
define void @MemError() {
%1 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Error allocating memory:\00"
define void @MemError() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
void *my_aligned_alloc(int, int);
void *t2_immediate2() { return my_aligned_alloc(320, 64); }


x86 assembly (clang, -O0):
<t2_immediate2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x140,%edi
mov    $0x40,%esi
call   1030 <my_aligned_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2_immediate2>:
mov    $0x140,%edi
mov    $0x40,%esi
jmp    1030 <my_aligned_alloc@plt>

LLVM IR (-O0):
define i8* @t2_immediate2() {
%1 = call i8* @my_aligned_alloc(i32 320, i32 64)
ret i8* %1
}

LLVM IR (-O2):
define i8* @t2_immediate2() {
%1 = tail call i8* @my_aligned_alloc(i32 320, i32 64)
ret i8* %1
}
void malloc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @malloc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
int is_totally_blank(char *str) {
  while (*str) {
    if (!isspace((int)*str)) {
      return 0;
    } else {
      str++;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_totally_blank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <is_totally_blank+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114a <is_totally_blank+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_totally_blank+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_totally_blank+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_totally_blank>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_totally_blank+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <is_totally_blank+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_totally_blank+0x20>
jmp    114b <is_totally_blank+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_totally_blank(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = tail call i32 @isspace(i32 %10)
%12 = icmp eq i32 %11, 0
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %14, label %4
14: ; preds = %7, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ calc_max_value();
int /*<<< orphan*/ find_all_avoid();
int /*<<< orphan*/ find_avoid_area();
int /*<<< orphan*/ find_corner();
int /*<<< orphan*/ find_wall_cap();
int /*<<< orphan*/ get_goal_p();
preprocess() {
  find_corner();
  find_avoid_area();
  find_wall_cap();
  get_goal_p();
  calc_max_value();
  find_all_avoid();
}


x86 assembly (clang, -O0):
<preprocess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <find_corner@plt>
mov    $0x0,%al
call   1030 <find_avoid_area@plt>
mov    $0x0,%al
call   1040 <find_wall_cap@plt>
mov    $0x0,%al
call   1070 <get_goal_p@plt>
mov    $0x0,%al
call   1080 <calc_max_value@plt>
mov    $0x0,%al
call   1060 <find_all_avoid@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preprocess>:
push   %rax
xor    %eax,%eax
call   1050 <find_corner@plt>
xor    %eax,%eax
call   1030 <find_avoid_area@plt>
xor    %eax,%eax
call   1040 <find_wall_cap@plt>
xor    %eax,%eax
call   1070 <get_goal_p@plt>
xor    %eax,%eax
call   1080 <calc_max_value@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <find_all_avoid@plt>

LLVM IR (-O0):
define i32 @preprocess() {
%1 = alloca i32
%2 = call i32 (...) @find_corner()
%3 = call i32 (...) @find_avoid_area()
%4 = call i32 (...) @find_wall_cap()
%5 = call i32 (...) @get_goal_p()
%6 = call i32 (...) @calc_max_value()
%7 = call i32 (...) @find_all_avoid()
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @preprocess() {
%1 = tail call i32 (...) @find_corner()
%2 = tail call i32 (...) @find_avoid_area()
%3 = tail call i32 (...) @find_wall_cap()
%4 = tail call i32 (...) @get_goal_p()
%5 = tail call i32 (...) @calc_max_value()
%6 = tail call i32 (...) @find_all_avoid()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
unsigned long Get_Byte();
int /*<<< orphan*/ Send_Byte(int);
unsigned long Jedec_ID_Read() {
  unsigned long temp;
  temp = 0;
  CE_Low();
  Send_Byte(0x9F);
  temp = (temp | Get_Byte()) << 8;
  temp = (temp | Get_Byte()) << 8;
  temp = (temp | Get_Byte());
  CE_High();
  return temp;
}


x86 assembly (clang, -O0):
<Jedec_ID_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <CE_Low@plt>
mov    $0x9f,%edi
call   1040 <Send_Byte@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
or     %rcx,%rax
shl    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
or     %rcx,%rax
shl    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <CE_High@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jedec_ID_Read>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <CE_Low@plt>
mov    $0x9f,%edi
call   1040 <Send_Byte@plt>
xor    %eax,%eax
call   1030 <Get_Byte@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <Get_Byte@plt>
mov    %rax,%rbx
shl    $0x10,%r14
shl    $0x8,%rbx
or     %r14,%rbx
xor    %eax,%eax
call   1030 <Get_Byte@plt>
mov    %rax,%r14
or     %rbx,%r14
xor    %eax,%eax
call   1050 <CE_High@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @Jedec_ID_Read() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i32 (...) @CE_Low()
%3 = call i32 @Send_Byte(i32 159)
%4 = load i64, i64* %1
%5 = call i64 (...) @Get_Byte()
%6 = or i64 %4, %5
%7 = shl i64 %6, 8
store i64 %7, i64* %1
%8 = load i64, i64* %1
%9 = call i64 (...) @Get_Byte()
%10 = or i64 %8, %9
%11 = shl i64 %10, 8
store i64 %11, i64* %1
%12 = load i64, i64* %1
%13 = call i64 (...) @Get_Byte()
%14 = or i64 %12, %13
store i64 %14, i64* %1
%15 = call i32 (...) @CE_High()
%16 = load i64, i64* %1
ret i64 %16
}

LLVM IR (-O2):
define i64 @Jedec_ID_Read() {
%1 = tail call i32 (...) @CE_Low()
%2 = tail call i32 @Send_Byte(i32 159)
%3 = tail call i64 (...) @Get_Byte()
%4 = tail call i64 (...) @Get_Byte()
%5 = shl i64 %3, 16
%6 = shl i64 %4, 8
%7 = or i64 %6, %5
%8 = tail call i64 (...) @Get_Byte()
%9 = or i64 %7, %8
%10 = tail call i32 (...) @CE_High()
ret i64 %9
}
outch(c) { putchar(c); }


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

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

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

LLVM IR (-O2):
define i32 @outch(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void C2Mod2Function1() { printf("Expected message: C2Mod2Function1.\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Expected message: C2Mod2Function1.\0A\00"
define void @C2Mod2Function1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Expected message: C2Mod2Function1.\00"
define void @C2Mod2Function1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
int length(char s[]) {
  int count = 0, i;
  for (i = 0; s[i] != '\n'; i++) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1142 <length+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <length+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
xor    %eax,%eax
cmpb   $0xa,(%rdi)
je     111b <length+0x1b>
xor    %eax,%eax
nopl   0x0(%rax)
cmpb   $0xa,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int check_backtranslation_with_mode(char const *, char const *, char const *,
                                    char const *, int /*<<< orphan*/);
int check_backtranslation(const char *tableList, const char *str,
                          const char *typeform, const char *expected) {
  return check_backtranslation_with_mode(tableList, str, typeform, expected, 0);
}


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

x86 assembly (clang, -O2):
<check_backtranslation>:
xor    %r8d,%r8d
jmp    1030 <check_backtranslation_with_mode@plt>

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

LLVM IR (-O2):
define i32 @check_backtranslation(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @check_backtranslation_with_mode(i8* %0, i8* %1, i8* %2, i8* %3, i32 0)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t le32_to_h(const void *src) {
  const uint8_t *b = src;
  return ((b[3] << 24) | (b[2] << 16) | (b[1] << 8) | (b[0] << 0));
}


x86 assembly (clang, -O0):
<le32_to_h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32_to_h>:
mov    0xc(%rdi),%ecx
shl    $0x18,%ecx
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @le32_to_h(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 3
%8 = load i32, i32* %7
%9 = shl i32 %8, 24
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = shl i32 %17, 8
%19 = or i32 %14, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 0
%22 = load i32, i32* %21
%23 = shl i32 %22, 0
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @le32_to_h(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = getelementptr inbounds i8, i8* %0, i64 12
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %10, %6
%12 = getelementptr inbounds i8, i8* %0, i64 4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32, i32* %2
%18 = or i32 %16, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ COLS;
int /*<<< orphan*/ LINES;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void main() {
  initscr();
  printw("ROW is: %d\nCOL is: %d\n", LINES, COLS);
  getch();
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
lea    0xe9c(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
lea    0xe9f(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"ROW is: %d\0ACOL is: %d\0A\00"
@LINES = global i32 0
@COLS = global i32 0
define void @main() {
%1 = call i32 (...) @initscr()
%2 = load i32, i32* @LINES
%3 = load i32, i32* @COLS
%4 = call i32 @printw(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = call i32 (...) @getch()
%6 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"ROW is: %d\0ACOL is: %d\0A\00"
@LINES = global i32 0
@COLS = global i32 0
define void @main() {
%1 = tail call i32 (...) @initscr()
%2 = load i32, i32* @LINES
%3 = load i32, i32* @COLS
%4 = tail call i32 @printw(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = tail call i32 (...) @getch()
%6 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: expand [-t number] [file ...]\n");
  exit(EXIT_FAILURE);
}


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    0x2e98(%rip),%rax
mov    (%rax),%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    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: expand [-t number] [file ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: expand [-t number] [file ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
char *convert(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int integer = 0;
  char *aString = NULL;
  printf("Enter the integer:\n");
  scanf("%d", &integer);
  aString = convert(integer);
  printf("The string is: %s\n", aString);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <convert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <convert@plt>
lea    0xe8d(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter the integer:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"The string is: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
store i8* null, i8** %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i8* @convert(i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret i32 -1
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"The string is: %s\0A\00"
@str = [19 x i8] c"Enter the integer:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i8* @convert(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ print_arguments(int, char **);
int /*<<< orphan*/ printf(char *, int);
int soma(int, int);
int main(int argc, char *argv[]) {
  print_arguments(argc, argv);
  printf("%d", soma(1, 2));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <print_arguments@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <soma@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @print_arguments(i32 %0, i8** %1)
%4 = tail call i32 @soma(i32 1, i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int getchar();
void skip(void) {
  int c;
  for (;;) {
    c = getchar();
    if (c < 0)
      break;
    if (c == '\n')
      break;
  }
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1131 <skip+0x21>
jmp    1145 <skip+0x35>
cmpl   $0xa,-0x4(%rbp)
jne    1140 <skip+0x30>
jmp    1145 <skip+0x35>
jmp    1118 <skip+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
test   %eax,%eax
js     1130 <skip+0x20>
cmp    $0xa,%eax
jne    1120 <skip+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @skip() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp slt i32 %2, 0
%4 = icmp eq i32 %2, 10
%5 = or i1 %3, %4
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int posneg(float n) {
  if (n < 0) {
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<posneg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1122 <posneg+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1129 <posneg+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posneg>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @posneg(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @posneg(float %0) {
%2 = fcmp uge float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long pathconf(char *, int);
long fpathconf(int fildes, int name) { return pathconf("/", name); }


x86 assembly (clang, -O0):
<fpathconf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <pathconf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i64 @fpathconf(i32 %0, i32 %1) {
%3 = tail call i64 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i64 %3
}
void ft_strupcase(char *str) {
  --str;
  while (*(++str))
    if (*str >= 'a' && *str <= 'z')
      *str -= ' ';
}


x86 assembly (clang, -O0):
<ft_strupcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
je     115e <ft_strupcase+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1159 <ft_strupcase+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1159 <ft_strupcase+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
jmp    1114 <ft_strupcase+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strupcase>:
mov    (%rdi),%al
test   %al,%al
je     112a <ft_strupcase+0x2a>
add    $0x1,%rdi
jmp    111b <ft_strupcase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <ft_strupcase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <ft_strupcase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <ft_strupcase+0x10>
ret

LLVM IR (-O0):
define void @ft_strupcase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i32 -1
store i8* %4, i8** %2
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
br label %5
27: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_strupcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}