xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int file_exists(const char *file_path) {
  struct stat buffer;
  int return_value;
  return_value = stat(file_path, &buffer);
  return return_value == 0 && buffer.st_size > 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    1146 <file_exists+0x36>
cmpq   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
sete   %al
cmpq   $0x0,(%rsp)
setg   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i64, i64* %10
%12 = icmp sgt i64 %11, 0
br label %13
13: ; preds = %9, %1
%14 = phi i1 [ false, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = icmp sgt i64 %7, 0
%9 = select i1 %5, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Alloc(unsigned int);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *StrAlloc(const char *s) {
  return strcpy(Alloc((unsigned)strlen(s) + 1), s);
}


x86 assembly (clang, -O0):
<StrAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1030 <Alloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrAlloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1030 <Alloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
define i8* @StrAlloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = call i32 @Alloc(i32 %6)
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i32 %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @StrAlloc(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = tail call i32 @Alloc(i32 %4)
%6 = tail call i8* @strcpy(i32 %5, i8* %0)
ret i8* %6
}
/* Variables and functions */
__attribute__((visibility("default"))) void *
sd_bus_track_get_userdata(void *track) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_track_get_userdata(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: logfile [options]\n");
  fprintf(stderr, "options include:\n"
                  "  -b              Set logfile source from pmlog\n"
                  "  -k              Set logfile source from kmsg\n"
                  "  -e              Set logfile source from eventlog\n"
                  "  -f <filename>   Log to file. Default to stdout\n"
                  "  -r [<kbytes>]   Rotate log every kbytes. (128 if "
                  "unspecified). Requires -f\n"
                  "  -n <count>      Sets max number of rotated logs to "
                  "<count>, default 3\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeeb(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: logfile [options]\0A\00"
@.str.1 = [362 x i8] c"options include:\0A -b Set logfile source from pmlog\0A -k Set logfile source from kmsg\0A -e Set logfile source from eventlog\0A -f <filename> Log to file. Default to stdout\0A -r [<kbytes>] Rotate log every kbytes. (128 if unspecified). Requires -f\0A -n <count> Sets max number of rotated logs to <count>, default 3\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([362 x i8], [362 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: logfile [options]\0A\00"
@.str.1 = [362 x i8] c"options include:\0A -b Set logfile source from pmlog\0A -k Set logfile source from kmsg\0A -e Set logfile source from eventlog\0A -f <filename> Log to file. Default to stdout\0A -r [<kbytes>] Rotate log every kbytes. (128 if unspecified). Requires -f\0A -n <count> Sets max number of rotated logs to <count>, default 3\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([362 x i8], [362 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xda() {
  Assert_real((isgraph(218) == 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_isgraph.c",
              1095, ("isgraph should be 0 for 0xda"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xda>:
push   %rax
mov    $0xda,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x447,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xda\00"
define void @t_isgraph_0xda() {
%1 = call i64 @isgraph(i32 218)
%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 1095, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xda\00"
define void @t_isgraph_0xda() {
%1 = tail call i64 @isgraph(i32 218)
%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 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_boolean() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_boolean"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_boolean\0A\00"
define i32 @pa_tagstruct_get_boolean() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_boolean\00"
define i32 @pa_tagstruct_get_boolean() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
short foor(short a, char c) { return 3; }


x86 assembly (clang, -O0):
<foor>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    $0x3,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<foor>:
mov    $0x3,%ax
ret

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

LLVM IR (-O2):
define signext i16 @foor(i16 signext %0, i8 signext %1) {
ret i16 3
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int compar_cstarstar(const void *v1, const void *v2) {
  const char **s1 = (const char **)v1, **s2 = (const char **)v2;
  return (strcasecmp(*s1, *s2));
}


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

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

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

LLVM IR (-O2):
define i32 @compar_cstarstar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_dl_free_symbolic(void **);
void umf4fsym(void **Symbolic) { umfpack_dl_free_symbolic(Symbolic); }


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

x86 assembly (clang, -O2):
<umf4fsym>:
jmp    1030 <umfpack_dl_free_symbolic@plt>

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

LLVM IR (-O2):
define void @umf4fsym(i8** %0) {
%2 = tail call i32 @umfpack_dl_free_symbolic(i8** %0)
ret void
}
int m12mo_getOpenIntelISP(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @m12mo_getOpenIntelISP() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mcat_scd(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2)
    printf("Donner deux arguments\n");
  mcat_scd(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <mcat_scd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1135 <main+0x15>
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rdi
call   1030 <mcat_scd@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Donner deux arguments\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @mcat_scd(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"Donner deux arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @mcat_scd(i8* %8)
ret i32 0
}
void g_param_spec_string() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_string() {
ret void
}
/* Type definitions */
struct aFILE {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int /*<<< orphan*/ ftello(int /*<<< orphan*/);
off_t my_ftello(struct aFILE *fp) { return ftello(_get_actual_fp(fp)); }


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

x86 assembly (clang, -O2):
<my_ftello>:
push   %rax
call   1040 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ftello@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_ftello(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i32 @ftello(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_ftello(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i32 @ftello(i32 %2)
ret i32 %3
}
/* Variables and functions */
int patternCompare(unsigned char const *, unsigned char const *, int, int);
int Glob(const unsigned char *zPattern, const unsigned char *zString, int iEsc,
         int CaseCompare) {
  int rc;
  if (iEsc < 0) {
    iEsc = '\\';
  }
  rc = patternCompare(zPattern, zString, iEsc, CaseCompare);
  return rc;
}


x86 assembly (clang, -O0):
<Glob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1137 <Glob+0x27>
movl   $0x5c,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <patternCompare@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Glob>:
test   %edx,%edx
mov    $0x5c,%eax
cmovs  %eax,%edx
jmp    1030 <patternCompare@plt>

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

LLVM IR (-O2):
define i32 @Glob(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, 0
%6 = select i1 %5, i32 92, i32 %2
%7 = tail call i32 @patternCompare(i8* %0, i8* %1, i32 %6, i32 %3)
ret i32 %7
}
/* Variables and functions */
char *read_from_fp(int /*<<< orphan*/, size_t *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ test_from_string(char *, size_t);
void test_from_stdin() {
  size_t len;
  char *data = read_from_fp(stdin, &len);
  test_from_string(data, len);
}


x86 assembly (clang, -O0):
<test_from_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <read_from_fp@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <test_from_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_from_stdin>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <read_from_fp@plt>
mov    (%rsp),%rsi
mov    %rax,%rdi
call   1030 <test_from_string@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @test_from_stdin() {
%1 = alloca i64
%2 = alloca i8*
%3 = load i32, i32* @stdin
%4 = call i8* @read_from_fp(i32 %3, i64* %1)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i64, i64* %1
%7 = call i32 @test_from_string(i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @test_from_stdin() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i32, i32* @stdin
%4 = call i8* @read_from_fp(i32 %3, i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @test_from_string(i8* %4, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
int writes(int fd, const char *str) { return write(fd, str, strlen(str)); }


x86 assembly (clang, -O0):
<writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @writes(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
double tanh(double x) { return 0.0; }


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

x86 assembly (clang, -O2):
<tanh>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @tanh(double %0) {
ret double 0.000000e+00
}
void interrupt_reserved_4(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @interrupt_reserved_4() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
double sin(int);
int main() {
  double d = 0.0;
  d = sin(100);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @sin(i32 100)
ret i32 0
}
void *test_anti_range_89(unsigned short n) {
  extern void *alloc_anti_range_89(unsigned short)
      __attribute__((alloc_size(1)));
  if ((0x7fff * 2 + 1) - 2 <= n && n <= (0x7fff * 2 + 1) - 1)
    n = (0x7fff * 2 + 1) - 2 - 1;
  return alloc_anti_range_89(n);
}


x86 assembly (clang, -O0):
<test_anti_range_89>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0xfffd,%eax
cmp    %ecx,%eax
jg     1145 <test_anti_range_89+0x35>
movzwl -0x2(%rbp),%eax
cmp    $0xfffe,%eax
jg     1145 <test_anti_range_89+0x35>
movw   $0xfffc,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_89@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_89>:
lea    0x3(%rdi),%eax
cmp    $0x2,%ax
mov    $0xfffc,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_89@plt>

LLVM IR (-O0):
define i8* @test_anti_range_89(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sle i32 65533, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp sle i32 %8, 65534
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -4, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_89(i16 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_89(i16 zeroext %0) {
%2 = add i16 %0, 3
%3 = icmp ult i16 %2, 2
%4 = select i1 %3, i16 -4, i16 %0
%5 = tail call i8* @alloc_anti_range_89(i16 zeroext %4)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
int gen_posix_mutex_destroy(pthread_mutex_t *mut) {
  if (!mut) {
    return (-EINVAL);
  }
  pthread_mutex_destroy(mut);
  return (0);
}


x86 assembly (clang, -O0):
<gen_posix_mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <gen_posix_mutex_destroy+0x2a>
xor    %eax,%eax
mov    0x2eb0(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <gen_posix_mutex_destroy+0x3a>
mov    -0x10(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_posix_mutex_destroy>:
push   %rax
test   %rdi,%rdi
je     111f <gen_posix_mutex_destroy+0xf>
call   1030 <pthread_mutex_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2eba(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @gen_posix_mutex_destroy(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
br label %8
6: ; preds = %1
%7 = tail call i32 @pthread_mutex_destroy(i32* %0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ 0, %6 ], [ %5, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void stamac_usage(char *name) {
  printf("\nUsage: %s <get | set <mac address>>\n"
         "\tget - display the MAC address of the first Wi-Fi STA that connects "
         "to\n"
         "\t\tthe router after it came out from the factory to 'stdout'.\n"
         "\tset xx:xx:xx:xx:xx:xx - record specified MAC address to POT "
         "partition,\n"
         "\t\tif thers is a MAC address existed yet, just display\n"
         "\t\tit without any write action.\n"
         "\tclean - clean the result in POT partition.\n",
         name);
  exit(0);
}


x86 assembly (clang, -O0):
<stamac_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stamac_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [371 x i8] c"\0AUsage: %s <get | set <mac address>>\0A\09get - display the MAC address of the first Wi-Fi STA that connects to\0A\09\09the router after it came out from the factory to 'stdout'.\0A\09set xx:xx:xx:xx:xx:xx - record specified MAC address to POT partition,\0A\09\09if thers is a MAC address existed yet, just display\0A\09\09it without any write action.\0A\09clean - clean the result in POT partition.\0A\00"
define void @stamac_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([371 x i8], [371 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [371 x i8] c"\0AUsage: %s <get | set <mac address>>\0A\09get - display the MAC address of the first Wi-Fi STA that connects to\0A\09\09the router after it came out from the factory to 'stdout'.\0A\09set xx:xx:xx:xx:xx:xx - record specified MAC address to POT partition,\0A\09\09if thers is a MAC address existed yet, just display\0A\09\09it without any write action.\0A\09clean - clean the result in POT partition.\0A\00"
define void @stamac_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([371 x i8], [371 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void exit_with_error_msg(const char *msg) {
  fprintf(stderr, "%s: %s\n", msg, strerror(errno));
  exit(0);
}


x86 assembly (clang, -O0):
<exit_with_error_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_error_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @exit_with_error_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @exit_with_error_msg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
size_t HashExpandSize(size_t original_capacity) {
  return original_capacity + (original_capacity >> 1);
}


x86 assembly (clang, -O0):
<HashExpandSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
add    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @HashExpandSize(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 1
%6 = add i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @HashExpandSize(i64 %0) {
%2 = lshr i64 %0, 1
%3 = add i64 %2, %0
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void DESIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  ;
  IntRegister(112, pfnHandler);
  IntEnable(112);
}


x86 assembly (clang, -O0):
<DESIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x70,%edi
call   1040 <IntRegister@plt>
mov    $0x70,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIntRegister>:
push   %rax
mov    $0x70,%edi
call   1040 <IntRegister@plt>
mov    $0x70,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @DESIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 112, void (...)* %6)
%8 = call i32 @IntEnable(i32 112)
ret void
}

LLVM IR (-O2):
define void @DESIntRegister(i32 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 112, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 112)
ret void
}
/* Variables and functions */
float __nv_sinpif(float);
float sinpif(float __a) { return __nv_sinpif(__a); }


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

x86 assembly (clang, -O2):
<sinpif>:
jmp    1030 <__nv_sinpif@plt>

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

LLVM IR (-O2):
define float @sinpif(float %0) {
%2 = tail call float @__nv_sinpif(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ mcal_cpu_nop();
void __hard_fault_handler() {
  for (;;) {
    mcal_cpu_nop();
  }
}


x86 assembly (clang, -O0):
<__hard_fault_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <__hard_fault_handler+0x9>
mov    $0x0,%al
call   1030 <mcal_cpu_nop@plt>
jmp    1119 <__hard_fault_handler+0x9>

x86 assembly (clang, -O2):
<__hard_fault_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mcal_cpu_nop@plt>
jmp    1120 <__hard_fault_handler+0x10>

LLVM IR (-O0):
define void @__hard_fault_handler() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @mcal_cpu_nop()
br label %1
}

LLVM IR (-O2):
define void @__hard_fault_handler() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @mcal_cpu_nop()
br label %1
}
double ret_double3(int i, int j) {
  static double d = 1.23456;
  return d;
}


x86 assembly (clang, -O0):
<ret_double3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  0x2f0e(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret_double3>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
@ret_double3.d = internal global double 1.234560e+00
define double @ret_double3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load double, double* @ret_double3.d
ret double %5
}

LLVM IR (-O2):
define double @ret_double3(i32 %0, i32 %1) {
ret double 1.234560e+00
}
/* Variables and functions */
int /*<<< orphan*/ uart0_write(char const *);
void cc3_uart0_write(const char *str) { uart0_write(str); }


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

x86 assembly (clang, -O2):
<cc3_uart0_write>:
jmp    1030 <uart0_write@plt>

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

LLVM IR (-O2):
define void @cc3_uart0_write(i8* %0) {
%2 = tail call i32 @uart0_write(i8* %0)
ret void
}
long long foo(a, b)
long long a, b;
{ return a * b; }


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

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

LLVM IR (-O0):
define i64 @foo(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* %4
%7 = mul nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int FmoGetLastMBInSliceGroup(scalar_t__);
scalar_t__ FmoGetNumberOfSliceGroup();
int FmoGetLastMBOfPicture() {
  return FmoGetLastMBInSliceGroup(FmoGetNumberOfSliceGroup() - 1);
}


x86 assembly (clang, -O0):
<FmoGetLastMBOfPicture>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <FmoGetNumberOfSliceGroup@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
call   1030 <FmoGetLastMBInSliceGroup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FmoGetLastMBOfPicture>:
push   %rax
xor    %eax,%eax
call   1040 <FmoGetNumberOfSliceGroup@plt>
lea    -0x1(%rax),%rdi
pop    %rax
jmp    1030 <FmoGetLastMBInSliceGroup@plt>

LLVM IR (-O0):
define i32 @FmoGetLastMBOfPicture() {
%1 = call i64 (...) @FmoGetNumberOfSliceGroup()
%2 = sub nsw i64 %1, 1
%3 = call i32 @FmoGetLastMBInSliceGroup(i64 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @FmoGetLastMBOfPicture() {
%1 = tail call i64 (...) @FmoGetNumberOfSliceGroup()
%2 = add nsw i64 %1, -1
%3 = tail call i32 @FmoGetLastMBInSliceGroup(i64 %2)
ret i32 %3
}
void termop_whatareyou(struct ansiseq *s) {
  tnc_log_log(
      7, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c",
      481, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_whatareyou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1e1,%r8d
lea    0xf37(%rip),%r9
lea    0xf42(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_whatareyou>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf69(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1e1,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_whatareyou = [18 x i8] c"termop_whatareyou\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_whatareyou(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 481, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.termop_whatareyou, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_whatareyou = [18 x i8] c"termop_whatareyou\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_whatareyou(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 481, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.termop_whatareyou, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 10, b = 20;
  printf("a = %d,b = %d\n", a, b);
  int *p = &a;
  int *q = &b;
  swap(p, q);
  printf("a = %d,b = %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x14,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"a = %d,b = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
int iscright(char c) {
  int ret = 0;
  switch (c) {
  case '>':
  case ')':
  case '}':
  case ']':
  case '\'':
  case '\"':
    ret = 1;
    break;
  default:
    ret = 0;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<iscright>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x22,%eax
je     117b <iscright+0x7b>
jmp    1126 <iscright+0x26>
mov    -0xc(%rbp),%eax
sub    $0x27,%eax
je     117b <iscright+0x7b>
jmp    1137 <iscright+0x37>
mov    -0xc(%rbp),%eax
sub    $0x29,%eax
je     117b <iscright+0x7b>
jmp    1148 <iscright+0x48>
mov    -0xc(%rbp),%eax
sub    $0x3e,%eax
je     117b <iscright+0x7b>
jmp    1159 <iscright+0x59>
mov    -0xc(%rbp),%eax
sub    $0x5d,%eax
je     117b <iscright+0x7b>
jmp    116a <iscright+0x6a>
mov    -0xc(%rbp),%eax
sub    $0x7d,%eax
jne    1187 <iscright+0x87>
jmp    117b <iscright+0x7b>
movl   $0x1,-0x8(%rbp)
jmp    118e <iscright+0x8e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscright>:
mov    $0x1,%eax
lea    -0x22(%rdi),%ecx
cmp    $0x3b,%ecx
ja     111e <iscright+0x1e>
movabs $0x8000000100000a1,%rdx
bt     %rcx,%rdx
jae    111e <iscright+0x1e>
ret
cmp    $0x7d,%edi
je     111d <iscright+0x1d>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iscright(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 62, label %6
i32 41, label %6
i32 125, label %6
i32 93, label %6
i32 39, label %6
i32 34, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %8
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @iscright(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 62, label %4
i32 41, label %4
i32 125, label %4
i32 93, label %4
i32 39, label %4
i32 34, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int sn_decode_int(char **, char *);
int sn_decode_array(char **p, char *end) { return sn_decode_int(p, end); }


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

x86 assembly (clang, -O2):
<sn_decode_array>:
jmp    1030 <sn_decode_int@plt>

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

LLVM IR (-O2):
define i32 @sn_decode_array(i8** %0, i8* %1) {
%3 = tail call i32 @sn_decode_int(i8** %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void rdatafree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @rdatafree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int genobj();
int genobj_() { return (genobj()); }


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

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

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

LLVM IR (-O2):
define i32 @genobj_() {
%1 = tail call i32 (...) @genobj()
ret i32 %1
}