xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cgc_memcpy(char *, char const *, size_t);
int cgc_strlen(char const *);
char *malloc(size_t);
char *strdup(const char *str) {
  size_t n = cgc_strlen(str) + 1;
  char *dup = malloc(n);
  if (dup == NULL)
    return NULL;
  cgc_memcpy(dup, str, n);
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cgc_strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1173 <strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    118c <strdup+0x5c>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <cgc_memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <cgc_strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <cgc_memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @cgc_strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @cgc_memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
int XDisplayHeightMM() {}


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

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

LLVM IR (-O0):
define i32 @XDisplayHeightMM() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XDisplayHeightMM() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ imgfree(void *);
void imgunload(const char *path, void *img, void *_info) { imgfree(img); }


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

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

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

LLVM IR (-O2):
define void @imgunload(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @imgfree(i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/ *);
int read_int(FILE *file) {
  int ret;
  fread(&ret, 1, sizeof(int), file);
  return ret;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i32* %3, i32 1, i32 4, i32* %4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @read_int(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 1, i32 4, i32* %0)
%5 = load i32, i32* %2
ret i32 %5
}
void ExttDeletedResourceAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttDeletedResourceAuxTable() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
struct timespec Timespec_of_timeval(const struct timeval x) {
  struct timespec retval;
  retval.tv_sec = x.tv_sec;
  retval.tv_nsec = x.tv_usec * 1000;
  return retval;
}


x86 assembly (clang, -O0):
<Timespec_of_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x3e8,-0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timespec_of_timeval>:
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rdi,%rcx
imul   $0x3e8,%edi,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define i64 @Timespec_of_timeval(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %10, i32* %11
%12 = bitcast %struct.timespec* %2 to i64*
%13 = load i64, i64* %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @Timespec_of_timeval(i64 %0) {
%2 = and i64 %0, -4294967296
%3 = mul i64 %0, 1000
%4 = and i64 %3, 4294967288
%5 = or i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] n\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedd(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s [options] n\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s [options] n\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct mda_scan {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct mda_scan *mda_sudiran_load(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, int);
struct mda_scan *mda_scan_load(FILE *fptr) {
  return mda_sudiran_load(fptr, 0, NULL, 1);
}


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

x86 assembly (clang, -O2):
<mda_scan_load>:
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <mda_sudiran_load@plt>

LLVM IR (-O0):
%struct.mda_scan = type { i32 }
define %struct.mda_scan* @mda_scan_load(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.mda_scan* @mda_sudiran_load(i32* %3, i32 0, i32* null, i32 1)
ret %struct.mda_scan* %4
}

LLVM IR (-O2):
%struct.mda_scan = type { i32 }
define %struct.mda_scan* @mda_scan_load(i32* %0) {
%2 = tail call %struct.mda_scan* @mda_sudiran_load(i32* %0, i32 0, i32* null, i32 1)
ret %struct.mda_scan* %2
}
void swap_ints(const int *in, int *out) {
  out[0] = in[0] + in[1];
  out[1] = -in[1];
  out[2] = in[1] + in[2];
}


x86 assembly (clang, -O0):
<swap_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
add    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
add    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_ints>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
sub    0x4(%rdi),%eax
mov    %eax,0x4(%rsi)
mov    0x8(%rdi),%eax
add    0x4(%rdi),%eax
mov    %eax,0x8(%rsi)
ret

LLVM IR (-O0):
define void @swap_ints(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sub nsw i32 0, %16
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = load i32, i32* %21
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = add nsw i32 %22, %25
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 2
store i32 %26, i32* %28
ret void
}

LLVM IR (-O2):
define void @swap_ints(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
store i32 %6, i32* %1
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %10
%14 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %13, i32* %14
ret void
}
int fun439() { return 439; }


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

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

LLVM IR (-O0):
define i32 @fun439() {
ret i32 439
}

LLVM IR (-O2):
define i32 @fun439() {
ret i32 439
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int fstat(int /*<<< orphan*/, struct stat *);
int is_dir(FILE *f) {
  struct stat s;
  int status = fstat(fileno(f), &s);
  if (status != 0) {
    return 0;
  }
  return S_ISDIR(s.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
lea    -0x18(%rbp),%rsi
call   1050 <fstat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1169 <is_dir+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1174 <is_dir+0x44>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
call   1040 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1050 <fstat@plt>
test   %eax,%eax
je     1148 <is_dir+0x18>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.stat
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fileno(i32* %6)
%8 = call i32 @fstat(i32 %7, %struct.stat* %4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %16
12: ; preds = %1
%13 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @S_ISDIR(i32 %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = call i32 @fstat(i32 %4, %struct.stat* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @S_ISDIR(i32 %9)
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ ServerListenBroadcast();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (ServerListenBroadcast()) {
    printf(" server listen broadcast failed!\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ServerListenBroadcast@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <main+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <ServerListenBroadcast@plt>
test   %rax,%rax
je     1140 <main+0x20>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c" server listen broadcast failed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @ServerListenBroadcast()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [33 x i8] c" server listen broadcast failed!\00"
define i32 @main() {
%1 = tail call i64 (...) @ServerListenBroadcast()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %6
}
void foo033(int p) {}


x86 assembly (clang, -O0):
<foo033>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo033(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char *);
char *strerror(int);
int main(int argc, char *argv[]) {
  for (int i = 0; i < 32; i++) {
    printf("%d signal is %s\n", i, strerror(i));
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1185 <main+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%esi
mov    %rax,%rdx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xec3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1050 <strerror@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <main+0x10>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d signal is %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = call i8* @strerror(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %7
18: ; preds = %7
%19 = load i32, i32* @EXIT_SUCCESS
%20 = call i32 @exit(i32 %19)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d signal is %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %6
3: ; preds = %6
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %10, %6 ]
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, 32
br i1 %11, label %3, label %6
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Aget_space(void *attr_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Sclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Aget_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Aget_space>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Sclose\00"
define i8* @H5Aget_space(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @__coverity_alloc__(i32 10)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @__coverity_mark_as_afm_allocated__(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Sclose\00"
define i8* @H5Aget_space(i8* nocapture readnone %0) {
%2 = tail call i8* @__coverity_alloc__(i32 10)
%3 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
long long pqcpucycles_impl(void) {
  long long result;
  asm volatile(".byte 15;.byte 49" : "=A"(result));
  return result;
}


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

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

LLVM IR (-O0):
define i64 @pqcpucycles_impl() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @pqcpucycles_impl() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *);
void mc_print_cursor_line(void) { do_csi("?1i"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"?1i\00"
define void @mc_print_cursor_line() {
%1 = call i32 @do_csi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"?1i\00"
define void @mc_print_cursor_line() {
%1 = tail call i32 @do_csi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int utf8_bytes(wchar_t ch) {
  if (ch < 0x80)
    return 1;
  else if (ch < 0x800)
    return 2;
  else if (ch < 0x10000)
    return 3;
  else if (ch < 0x200000)
    return 4;
  else
    return 0;
}


x86 assembly (clang, -O0):
<utf8_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1120 <utf8_bytes+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1172 <utf8_bytes+0x72>
cmpl   $0x800,-0x8(%rbp)
jge    1139 <utf8_bytes+0x39>
movl   $0x2,-0x4(%rbp)
jmp    1172 <utf8_bytes+0x72>
cmpl   $0x10000,-0x8(%rbp)
jge    1152 <utf8_bytes+0x52>
movl   $0x3,-0x4(%rbp)
jmp    1172 <utf8_bytes+0x72>
cmpl   $0x200000,-0x8(%rbp)
jge    116b <utf8_bytes+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    1172 <utf8_bytes+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_bytes>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1135 <utf8_bytes+0x35>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1135 <utf8_bytes+0x35>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1135 <utf8_bytes+0x35>
xor    %eax,%eax
cmp    $0x200000,%edi
setb   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @utf8_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 2097152
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @utf8_bytes(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 2097152
%9 = select i1 %8, i32 4, i32 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
int application(int i) {
  return (i - 9) * (i - 9) * (i - 9) - 75 * (i - 9) + 24;
}


x86 assembly (clang, -O0):
<application>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
mov    -0x4(%rbp),%ecx
sub    $0x9,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
sub    $0x9,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
sub    $0x9,%ecx
imul   $0x4b,%ecx,%ecx
sub    %ecx,%eax
add    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<application>:
lea    -0x9(%rdi),%ecx
mov    %ecx,%eax
imul   %ecx,%eax
add    $0xffffffb5,%eax
imul   %ecx,%eax
add    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @application(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 9
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 9
%7 = mul nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 9
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 9
%13 = mul nsw i32 75, %12
%14 = sub nsw i32 %10, %13
%15 = add nsw i32 %14, 24
ret i32 %15
}

LLVM IR (-O2):
define i32 @application(i32 %0) {
%2 = add nsw i32 %0, -9
%3 = mul nsw i32 %2, %2
%4 = add nsw i32 %3, -75
%5 = mul i32 %4, %2
%6 = add nsw i32 %5, 24
ret i32 %6
}
int main(int argc, char **argv) {
  int *argcp = &argc;
  return **argv + *argcp;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rax
movsbl (%rax),%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, %0
ret i32 %6
}
unsigned long string_dec_to_int(char *s) {
  unsigned long cpt = 0;
  unsigned short i = 0;
  while (s[i] != '\0') {
    cpt = cpt * 10 + s[i] - '0';
    i++;
  }
  return cpt;
}


x86 assembly (clang, -O0):
<string_dec_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
mov    -0x8(%rbp),%rax
movzwl -0x12(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1159 <string_dec_to_int+0x59>
imul   $0xa,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movzwl -0x12(%rbp),%edx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x10(%rbp)
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1116 <string_dec_to_int+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_dec_to_int>:
mov    (%rdi),%dl
test   %dl,%dl
je     112f <string_dec_to_int+0x2f>
mov    $0x1,%cx
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%rax
movsbq %dl,%rdx
lea    (%rdx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
movzwl %cx,%edx
movzbl (%rdi,%rdx,1),%edx
add    $0x1,%ecx
test   %dl,%dl
jne    1110 <string_dec_to_int+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @string_dec_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i16
store i8* %0, i8** %2
store i64 0, i64* %3
store i16 0, i16* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i16, i16* %4
%8 = zext i16 %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, 0
br i1 %12, label %13, label %26
13: ; preds = %5
%14 = load i64, i64* %3
%15 = mul i64 %14, 10
%16 = load i8*, i8** %2
%17 = load i16, i16* %4
%18 = zext i16 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i64
%22 = add i64 %15, %21
%23 = sub i64 %22, 48
store i64 %23, i64* %3
%24 = load i16, i16* %4
%25 = add i16 %24, 1
store i16 %25, i16* %4
br label %5
26: ; preds = %5
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @string_dec_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i16 [ %12, %4 ], [ 0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = mul i64 %7, 10
%9 = sext i8 %5 to i64
%10 = add i64 %8, -48
%11 = add i64 %10, %9
%12 = add i16 %6, 1
%13 = zext i16 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void chronopic_flush(int serial_fd) { tcflush(serial_fd, TCIOFLUSH); }


x86 assembly (clang, -O0):
<chronopic_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chronopic_flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @chronopic_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @chronopic_flush(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int tst_DECCKSR(char const *, int, char *);
int tst_DSR_memory_sum(const char *the_title) {
  return tst_DECCKSR(the_title, 1, "?63;1n");
}


x86 assembly (clang, -O0):
<tst_DSR_memory_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    0xed4(%rip),%rdx
call   1030 <tst_DECCKSR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_DSR_memory_sum>:
lea    0xee9(%rip),%rdx
mov    $0x1,%esi
jmp    1030 <tst_DECCKSR@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"?63;1n\00"
define i32 @tst_DSR_memory_sum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @tst_DECCKSR(i8* %3, i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"?63;1n\00"
define i32 @tst_DSR_memory_sum(i8* %0) {
%2 = tail call i32 @tst_DECCKSR(i8* %0, i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello, World!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime_r(int /*<<< orphan*/ *, char *);
void test(void) {
  char *buffer_pointer;
  char buffer[80];
  time_t time;
  buffer_pointer = ctime_r(&time, buffer);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x60(%rbp),%rsi
lea    -0x64(%rbp),%rdi
call   1030 <ctime_r@plt>
mov    %rax,-0x8(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x68,%rsp
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <ctime_r@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i8*
%2 = alloca [80 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i8* @ctime_r(i32* %3, i8* %4)
store i8* %5, i8** %1
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i8* @ctime_r(i32* %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printSolution(int arr[], int level) {
  int i;
  for (i = 0; i < level; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printSolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printSolution+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printSolution+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSolution>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printSolution+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printSolution+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printSolution(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printSolution(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int foo(int z0, unsigned z1) {
  int t0 = (z0 != 0);
  int t1 = (z1 != 0);
  int t2 = (t0 | t1);
  return t2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
or     %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = or i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct fc_sockaddr_list_link {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link_next(struct genlist_link const *);
struct fc_sockaddr_list_link *
fc_sockaddr_list_link_next(const struct fc_sockaddr_list_link *plink) {
  return ((struct fc_sockaddr_list_link *)genlist_link_next(
      (const struct genlist_link *)plink));
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_link_next>:
jmp    1030 <genlist_link_next@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_link_next(%struct.fc_sockaddr_list_link* %0) {
%2 = alloca %struct.fc_sockaddr_list_link*
store %struct.fc_sockaddr_list_link* %0, %struct.fc_sockaddr_list_link** %2
%3 = load %struct.fc_sockaddr_list_link*, %struct.fc_sockaddr_list_link** %2
%4 = bitcast %struct.fc_sockaddr_list_link* %3 to %struct.genlist_link*
%5 = call i64 @genlist_link_next(%struct.genlist_link* %4)
%6 = inttoptr i64 %5 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %6
}

LLVM IR (-O2):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_link_next(%struct.fc_sockaddr_list_link* %0) {
%2 = bitcast %struct.fc_sockaddr_list_link* %0 to %struct.genlist_link*
%3 = tail call i64 @genlist_link_next(%struct.genlist_link* %2)
%4 = inttoptr i64 %3 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %4
}
int check(char cond) { return (cond == 0); }


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @check(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @check(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int dog_kick() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dog_kick() {
ret i32 0
}
/* Variables and functions */
int rand();
char *hind_addr(void) {
  int bits = 48 + rand() % (63 - 48);
  return (char *)(1UL << bits);
}


x86 assembly (clang, -O0):
<hind_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xf,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hind_addr>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
shr    $0x3,%eax
add    %edx,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
add    $0x30,%cl
mov    $0x1,%eax
shl    %cl,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hind_addr() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 15
%4 = add nsw i32 48, %3
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = shl i64 1, %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @hind_addr() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 15
%3 = add nsw i32 %2, 48
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
char *strrchr(char *, char);
char *getName(char *name) {
  extern char **Argv;
  if (name) {
    return (name);
  }
  if ((name = strrchr(Argv[0], '/')) != (char *)NULL) {
    return (name);
  }
  return (Argv[0]);
}


x86 assembly (clang, -O0):
<getName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <getName+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getName+0x67>
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1166 <getName+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <getName+0x67>
mov    0x2e73(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getName>:
mov    %rdi,%rax
test   %rdi,%rdi
je     1119 <getName+0x9>
ret
push   %rbx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@Argv = external global i8**
define i8* @getName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %3
store i8* %7, i8** %2
br label %20
8: ; preds = %1
%9 = load i8**, i8*** @Argv
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i8* @strrchr(i8* %11, i8 signext 47)
store i8* %12, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = load i8*, i8** %3
store i8* %15, i8** %2
br label %20
16: ; preds = %8
%17 = load i8**, i8*** @Argv
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
store i8* %19, i8** %2
br label %20
20: ; preds = %16, %14, %6
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@Argv = external global i8**
define i8* @getName(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = load i8**, i8*** @Argv
%5 = load i8*, i8** %4
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %5, i8 signext 47)
%7 = icmp eq i8* %6, null
%8 = select i1 %7, i8* %5, i8* %6
br label %9
9: ; preds = %3, %1
%10 = phi i8* [ %0, %1 ], [ %8, %3 ]
ret i8* %10
}
/* Type definitions */
struct ndm_ptrvec_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ ndm_ptrvec_size(struct ndm_ptrvec_t const *);
size_t ndm_ptrvec_is_empty(const struct ndm_ptrvec_t *v) {
  return ndm_ptrvec_size(v) == 0;
}


x86 assembly (clang, -O0):
<ndm_ptrvec_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ndm_ptrvec_size@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_ptrvec_is_empty>:
push   %rax
call   1030 <ndm_ptrvec_size@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ndm_ptrvec_t = type { i32 }
define i64 @ndm_ptrvec_is_empty(%struct.ndm_ptrvec_t* %0) {
%2 = alloca %struct.ndm_ptrvec_t*
store %struct.ndm_ptrvec_t* %0, %struct.ndm_ptrvec_t** %2
%3 = load %struct.ndm_ptrvec_t*, %struct.ndm_ptrvec_t** %2
%4 = call i64 @ndm_ptrvec_size(%struct.ndm_ptrvec_t* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
%struct.ndm_ptrvec_t = type { i32 }
define i64 @ndm_ptrvec_is_empty(%struct.ndm_ptrvec_t* %0) {
%2 = tail call i64 @ndm_ptrvec_size(%struct.ndm_ptrvec_t* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/);
int setfsgid(gid_t gid) { return syscall(123, gid); }


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

x86 assembly (clang, -O2):
<setfsgid>:
mov    %edi,%esi
mov    $0x7b,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setfsgid(i32 %0) {
%2 = tail call i32 @syscall(i32 123, i32 %0)
ret i32 %2
}
void bugbreak() {}


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

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

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

LLVM IR (-O2):
define void @bugbreak() {
ret void
}
const char *dsfmt_get_idstring(void) {
  return "dSFMT2-132049:371-23:fb9f4eff4bf77-fffffbfefff37";
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"dSFMT2-132049:371-23:fb9f4eff4bf77-fffffbfefff37\00"
define i8* @dsfmt_get_idstring() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"dSFMT2-132049:371-23:fb9f4eff4bf77-fffffbfefff37\00"
define i8* @dsfmt_get_idstring() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_dec(char *str) { sprintf(str, "DEC   A                         "); }


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

x86 assembly (clang, -O2):
<sprint_dec>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
@.str = [33 x i8] c"DEC A \00"
define void @sprint_dec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"DEC A \00"
define void @sprint_dec(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}