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

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void closedirp(DIR **dirp) {
  if (*dirp)
    closedir(*dirp);
}


x86 assembly (clang, -O0):
<closedirp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <closedirp+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closedirp>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <closedirp+0xd>
jmp    1030 <closedir@plt>
ret

LLVM IR (-O0):
define void @closedirp(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = call i32 @closedir(i32* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @closedirp(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
int C_Utils_compare_short(const short item1, const short item2) {
  if (item1 == item2)
    return 0;
  return item1 < item2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    112e <C_Utils_compare_short+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1148 <C_Utils_compare_short+0x48>
movswl -0x6(%rbp),%edx
movswl -0x8(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_short>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %si,%di
setge  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @C_Utils_compare_short(i16 signext %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = load i16, i16* %5
%9 = sext i16 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %20
12: ; preds = %2
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = load i16, i16* %5
%16 = sext i16 %15 to i32
%17 = icmp slt i32 %14, %16
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 -1, i32 1
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @C_Utils_compare_short(i16 signext %0, i16 signext %1) {
%3 = icmp eq i16 %0, %1
%4 = icmp slt i16 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
struct sstream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sstream_cstr(struct sstream *);
struct sstream *sstream_new();
int /*<<< orphan*/ sstream_push_cstr(struct sstream *, int /*<<< orphan*/);
struct sstream *sstream_copy(struct sstream *ctx) {
  struct sstream *rtn = NULL;
  rtn = sstream_new();
  sstream_push_cstr(rtn, sstream_cstr(ctx));
  return rtn;
}


x86 assembly (clang, -O0):
<sstream_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <sstream_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sstream_cstr@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <sstream_push_cstr@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstream_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <sstream_new@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <sstream_cstr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <sstream_push_cstr@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sstream = type { i32 }
define %struct.sstream* @sstream_copy(%struct.sstream* %0) {
%2 = alloca %struct.sstream*
%3 = alloca %struct.sstream*
store %struct.sstream* %0, %struct.sstream** %2
store %struct.sstream* null, %struct.sstream** %3
%4 = call %struct.sstream* (...) @sstream_new()
store %struct.sstream* %4, %struct.sstream** %3
%5 = load %struct.sstream*, %struct.sstream** %3
%6 = load %struct.sstream*, %struct.sstream** %2
%7 = call i32 @sstream_cstr(%struct.sstream* %6)
%8 = call i32 @sstream_push_cstr(%struct.sstream* %5, i32 %7)
%9 = load %struct.sstream*, %struct.sstream** %3
ret %struct.sstream* %9
}

LLVM IR (-O2):
%struct.sstream = type { i32 }
define %struct.sstream* @sstream_copy(%struct.sstream* %0) {
%2 = tail call %struct.sstream* (...) @sstream_new()
%3 = tail call i32 @sstream_cstr(%struct.sstream* %0)
%4 = tail call i32 @sstream_push_cstr(%struct.sstream* %2, i32 %3)
ret %struct.sstream* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sighandler(int num) {
  printf("signal %d\n", num);
  printf("signal %d end\n", num);
}


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

x86 assembly (clang, -O2):
<sighandler>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"signal %d\0A\00"
@.str.1 = [15 x i8] c"signal %d end\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"signal %d\0A\00"
@.str.1 = [15 x i8] c"signal %d end\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void PAGE_TelemconfigEvent() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ le64toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint64_t get_le64(uint8_t **bufferp) {
  uint64_t tmp;
  memcpy(&tmp, *bufferp, sizeof(tmp));
  *bufferp += sizeof(tmp);
  return le64toh(tmp);
}


x86 assembly (clang, -O0):
<get_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%edi
call   1030 <le64toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le64>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
addq   $0x10,(%rbx)
mov    0xc(%rsp),%edi
call   1030 <le64toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_le64(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = call i32 @memcpy(i32* %3, i32* %5, i32 4)
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %7
%10 = load i32, i32* %3
%11 = call i32 @le64toh(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_le64(i32** nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32*, i32** %0
%5 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
%6 = load i32*, i32** %0
%7 = getelementptr inbounds i32, i32* %6, i64 4
store i32* %7, i32** %0
%8 = load i32, i32* %2
%9 = call i32 @le64toh(i32 %8)
ret i32 %9
}
int calculate_schar_min() {
  signed char i = 0;
  while (i <= 0) {
    --i;
  }
  ++i;
  return i;
}


x86 assembly (clang, -O0):
<calculate_schar_min>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jg     1122 <calculate_schar_min+0x22>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
jmp    1108 <calculate_schar_min+0x8>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @calculate_schar_min() {
ret i32 -128
}
/* Variables and functions */
char tolower(char);
char *strlwr(char *s) {
  char *p = s;
  while (*p = tolower(*p))
    p++;
  return s;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114f <strlwr+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strlwr+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @tolower(i8 signext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void first_line(void) {
  printf("Name                   Objects Objsize    Space "
         "Slabs/Part/Cpu  O/S O %%Fr %%Ef Flg\n");
}


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

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

LLVM IR (-O0):
@.str = [85 x i8] c"Name Objects Objsize Space Slabs/Part/Cpu O/S O %%Fr %%Ef Flg\0A\00"
define void @first_line() {
%1 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [85 x i8] c"Name Objects Objsize Space Slabs/Part/Cpu O/S O %%Fr %%Ef Flg\0A\00"
define void @first_line() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ millis();
double CCNL_NOW(void) { return (double)millis() / 1000; }


x86 assembly (clang, -O0):
<CCNL_NOW>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <millis@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CCNL_NOW>:
push   %rax
xor    %eax,%eax
call   1030 <millis@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @CCNL_NOW() {
%1 = call i64 (...) @millis()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+03
ret double %3
}

LLVM IR (-O2):
define double @CCNL_NOW() {
%1 = tail call i64 (...) @millis()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+03
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
void intl_init(void) { setlocale(LC_ALL, ""); }


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

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

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define void @intl_init() {
%1 = load i32, i32* @LC_ALL
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define void @intl_init() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char *);
int badusage(char *exename) {
  fprintf(stderr, "Wrong parameters\n");
  usage(exename);
  return 1;
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <usage@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <usage@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Wrong parameters\0A\00"
define i32 @badusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @usage(i8* %5)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Wrong parameters\0A\00"
define i32 @badusage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @usage(i8* %0)
ret i32 1
}
vdmova(x, y) float *x, *y;
{ vimova(x, y); }


x86 assembly (clang, -O0):
<vdmova>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <vimova@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vdmova(float* %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
%5 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
%6 = load float*, float** %4
%7 = load float*, float** %5
%8 = call i32 (float*, float*, ...) bitcast (i32 (...)* @vimova to i32 (float*, float*, ...)*)(float* %6, float* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @vdmova(float* %0, float* %1) {
%3 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @vimova to i32 (float*, float*, ...)*)(float* %0, float* %1)
ret i32 undef
}
/* Type definitions */
struct atm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ update_tm(struct atm *, struct atm *, int /*<<< orphan*/);
void date_now(struct atm *tm, struct atm *now, int *num) {
  update_tm(tm, now, 0);
}


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

x86 assembly (clang, -O2):
<date_now>:
xor    %edx,%edx
jmp    1030 <update_tm@plt>

LLVM IR (-O0):
%struct.atm = type { i32 }
define void @date_now(%struct.atm* %0, %struct.atm* %1, i32* %2) {
%4 = alloca %struct.atm*
%5 = alloca %struct.atm*
%6 = alloca i32*
store %struct.atm* %0, %struct.atm** %4
store %struct.atm* %1, %struct.atm** %5
store i32* %2, i32** %6
%7 = load %struct.atm*, %struct.atm** %4
%8 = load %struct.atm*, %struct.atm** %5
%9 = call i32 @update_tm(%struct.atm* %7, %struct.atm* %8, i32 0)
ret void
}

LLVM IR (-O2):
%struct.atm = type { i32 }
define void @date_now(%struct.atm* %0, %struct.atm* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @update_tm(%struct.atm* %0, %struct.atm* %1, i32 0)
ret void
}
main() {
  long icodes[1000];
  long i = 0;
  for (i = 0; i < 10; i++) {
    icodes[i] = i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1ee0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x1f58(%rbp)
movq   $0x0,-0x1f58(%rbp)
cmpq   $0xa,-0x1f58(%rbp)
0a
jge    1163 <main+0x63>
mov    -0x1f58(%rbp),%rcx
mov    -0x1f58(%rbp),%rax
mov    %rcx,-0x1f50(%rbp,%rax,8)
ff
mov    -0x1f58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1f58(%rbp)
jmp    1128 <main+0x28>
mov    -0x4(%rbp),%eax
add    $0x1ee0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i64]
%3 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
store i64 0, i64* %3
br label %4
4: ; preds = %11, %0
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i64, i64* %3
%10 = getelementptr inbounds [1000 x i64], [1000 x i64]* %2, i64 0, i64 %9
store i64 %8, i64* %10
br label %11
11: ; preds = %7
%12 = load i64, i64* %3
%13 = add nsw i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void cc3000_assert_cs(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @cc3000_assert_cs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int *calloc(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  int *arr;
  arr = calloc(50, sizeof(int));
  if (arr == NULL) {
    perror("Error on calloc");
    exit(EXIT_FAILURE);
  } else {
    free(arr);
  }
  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)
mov    $0x32,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118e <main+0x4e>
lea    0xe85(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x32,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
test   %rax,%rax
jne    116f <main+0x2f>
lea    0xea4(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Error on calloc\00"
@EXIT_FAILURE = global i32 0
@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
%7 = call i32* @calloc(i32 50, i32 4)
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i32*, i32** %6
%16 = call i32 @free(i32* %15)
br label %17
17: ; preds = %14
%18 = load i32, i32* @EXIT_SUCCESS
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error on calloc\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @calloc(i32 50, i32 4)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = tail call i32 @free(i32* %3)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = tail call i32 @exit(i32 %11)
unreachable
}
int do_work(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @do_work() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ register_modules();
int /*<<< orphan*/ start_event_task_thread();
int basic_cs_main() {
  start_event_task_thread();
  register_modules();
}


x86 assembly (clang, -O0):
<basic_cs_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <start_event_task_thread@plt>
mov    $0x0,%al
call   1030 <register_modules@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basic_cs_main>:
push   %rax
xor    %eax,%eax
call   1040 <start_event_task_thread@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <register_modules@plt>

LLVM IR (-O0):
define i32 @basic_cs_main() {
%1 = alloca i32
%2 = call i32 (...) @start_event_task_thread()
%3 = call i32 (...) @register_modules()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @basic_cs_main() {
%1 = tail call i32 (...) @start_event_task_thread()
%2 = tail call i32 (...) @register_modules()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
imprimir_(int x) {
  while (x >= 0) {
    printf("_ _ _");
    x--;
  }
}


x86 assembly (clang, -O0):
<imprimir_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     113f <imprimir_+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <imprimir_+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     113d <imprimir_+0x2d>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <imprimir_+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"_ _ _\00"
define i32 @imprimir_(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"_ _ _\00"
define i32 @imprimir_(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %4, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ phred33ToPhred(char);
double phredToDouble(int /*<<< orphan*/);
double phred33ToDouble(char p) { return phredToDouble(phred33ToPhred(p)); }


x86 assembly (clang, -O0):
<phred33ToDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <phred33ToPhred@plt>
mov    %eax,%edi
call   1030 <phredToDouble@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @phred33ToDouble(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @phred33ToPhred(i8 signext %3)
%5 = call double @phredToDouble(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @phred33ToDouble(i8 signext %0) {
%2 = tail call i32 @phred33ToPhred(i8 signext %0)
%3 = tail call double @phredToDouble(i32 %2)
ret double %3
}
int test_imm_C5int64_lowword_mem(long long *val) {
  return ((*val) & (0xC5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C5int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 197
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C5int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 197
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void dump_args(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
}


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

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

LLVM IR (-O0):
define void @dump_args(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
ret void
}

LLVM IR (-O2):
define void @dump_args(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
struct http_response {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_response(struct http_response *);
void http_response_destroy(struct http_response *resp) {
  destroy_response(resp);
}


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

x86 assembly (clang, -O2):
<http_response_destroy>:
jmp    1030 <destroy_response@plt>

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

LLVM IR (-O2):
%struct.http_response = type { i32 }
define void @http_response_destroy(%struct.http_response* %0) {
%2 = tail call i32 @destroy_response(%struct.http_response* %0)
ret void
}
void readconfig(void) {}


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

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

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

LLVM IR (-O2):
define void @readconfig() {
ret void
}
void grid_pos(int i, int row_len, int *x, int *y) {
  *x = i % row_len;
  *y = (i - *x) / row_len;
}


x86 assembly (clang, -O0):
<grid_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_pos>:
mov    %rdx,%r8
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,(%r8)
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @grid_pos(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = srem i32 %9, %10
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = sub nsw i32 %13, %15
%17 = load i32, i32* %6
%18 = sdiv i32 %16, %17
%19 = load i32*, i32** %8
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @grid_pos(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = srem i32 %0, %1
store i32 %5, i32* %2
%6 = sdiv i32 %0, %1
store i32 %6, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int semget(int /*<<< orphan*/, int, int);
int sem_get(key_t key) {
  int sem;
  if ((sem = semget(key, 1, 0755)) == -1) {
    return -1;
  }
  return sem;
}


x86 assembly (clang, -O0):
<sem_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
mov    $0x1ed,%edx
call   1030 <semget@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1145 <sem_get+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <sem_get+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_get>:
mov    $0x1,%esi
mov    $0x1ed,%edx
jmp    1030 <semget@plt>

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

LLVM IR (-O2):
define i32 @sem_get(i32 %0) {
%2 = tail call i32 @semget(i32 %0, i32 1, i32 493)
ret i32 %2
}
void foo081(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo081(i32 %0) {
ret void
}
void swap(int *t, int a, int b) {
  int c = t[b];
  t[b] = t[a];
  t[a] = c;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%ecx
movslq %esi,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *Create1(int n) { return (int *)malloc(sizeof(int) * n); }


x86 assembly (clang, -O0):
<Create1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Create1>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @Create1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 4, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}

LLVM IR (-O2):
define i32* @Create1(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int opt;
  printf("Escolha o exercício:\n");
  scanf("%d", &opt);
  switch (opt) {}
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Escolha o exerc\C3\ADcio:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
switch i32 %5, label %6 [
]
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [22 x i8] c"Escolha o exerc\C3\ADcio:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
int swap() { return 1; }


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

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

LLVM IR (-O0):
define i32 @swap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @swap() {
ret i32 1
}
int main(void) {
  volatile int dummy;
  dummy = 0;
  dummy = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
movl   $0x1,-0x4(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
store volatile i32 1, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x54() {
  Assert_real((islower(84) == 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_islower.c",
              425, ("islower should be 0 for T"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for T\00"
define void @t_islower_0x54() {
%1 = call i64 @islower(i32 84)
%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 425, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for T\00"
define void @t_islower_0x54() {
%1 = tail call i64 @islower(i32 84)
%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 425, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double atan2(double, double);
__attribute__((__weak__, __always___)) double softboundcets_atan2(double y,
                                                                  double x) {
  return atan2(y, x);
}


x86 assembly (clang, -O0):
<softboundcets_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_atan2>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define weak double @softboundcets_atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define weak double @softboundcets_atan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
int dias_fev(int ano) {
  int x = ano;
  if (ano % 100 == 0)
    x = ano / 100;
  if (x % 4 == 0)
    return 29;
  else
    return 28;
}


x86 assembly (clang, -O0):
<dias_fev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <dias_fev+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <dias_fev+0x4f>
movl   $0x1d,-0x4(%rbp)
jmp    1156 <dias_fev+0x56>
movl   $0x1c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dias_fev>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
ja     112c <dias_fev+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
xor    %eax,%eax
test   $0x3,%dil
sete   %al
or     $0x1c,%eax
ret

LLVM IR (-O0):
define i32 @dias_fev(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %3
%7 = srem i32 %6, 100
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sdiv i32 %10, 100
store i32 %11, i32* %4
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %4
%14 = srem i32 %13, 4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 29, i32* %2
br label %18
17: ; preds = %12
store i32 28, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @dias_fev(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = sdiv i32 %0, 100
%5 = select i1 %3, i32 %4, i32 %0
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 29, i32 28
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ dump_trace();
void test_meloner() {
  dump_trace();
  return;
}


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

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

LLVM IR (-O0):
define void @test_meloner() {
%1 = call i32 (...) @dump_trace()
ret void
}

LLVM IR (-O2):
define void @test_meloner() {
%1 = tail call i32 (...) @dump_trace()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ intro();
int /*<<< orphan*/ play();
scalar_t__ playmore();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  intro();
  srand(time(NULL));
  do
    play();
  while (playmore());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <intro@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <play@plt>
mov    $0x0,%al
call   1070 <playmore@plt>
cmp    $0x0,%rax
jne    1176 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <intro@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <play@plt>
xor    %eax,%eax
call   1070 <playmore@plt>
test   %rax,%rax
jne    1170 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @intro()
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
br label %5
5: ; preds = %7, %0
%6 = call i32 (...) @play()
br label %7
7: ; preds = %5
%8 = call i64 (...) @playmore()
%9 = icmp ne i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @intro()
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @play()
%6 = tail call i64 (...) @playmore()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, void *, char *);
int shmdt(void *);
char *strerror(int /*<<< orphan*/);
void SASDetachShm(void *shm_addr) {
  if (shmdt(shm_addr) == -1) {
    printf("SASDetachShm(%p) semdt failed;%s\n", shm_addr, strerror(errno));
  }
}


x86 assembly (clang, -O0):
<SASDetachShm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <shmdt@plt>
cmp    $0xffffffff,%eax
jne    1177 <SASDetachShm+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SASDetachShm>:
push   %rbx
mov    %rdi,%rbx
call   1030 <shmdt@plt>
cmp    $0xffffffff,%eax
je     1140 <SASDetachShm+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"SASDetachShm(%p) semdt failed;%s\0A\00"
@errno = global i32 0
define void @SASDetachShm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @shmdt(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"SASDetachShm(%p) semdt failed;%s\0A\00"
@errno = global i32 0
define void @SASDetachShm(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
br label %8
8: ; preds = %4, %1
ret void
}
void Read_To_68K_Space(int adr) {}


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

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

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

LLVM IR (-O2):
define void @Read_To_68K_Space(i32 %0) {
ret void
}
int lzst0_log128(int v) {
  int i, j;
  i = 0;
  j = v;
  while (j >= 128) {
    i++;
    j = j >> 7;
  }
  return (i);
}


x86 assembly (clang, -O0):
<lzst0_log128>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jl     1138 <lzst0_log128+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <lzst0_log128+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzst0_log128>:
xor    %eax,%eax
cmp    $0x80,%edi
jl     1120 <lzst0_log128+0x20>
xor    %eax,%eax
mov    %edi,%ecx
xchg   %ax,%ax
add    $0x1,%eax
shr    $0x7,%ecx
cmp    $0x3fff,%edi
mov    %ecx,%edi
ja     1110 <lzst0_log128+0x10>
ret

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

LLVM IR (-O2):
define i32 @lzst0_log128(i32 %0) {
%2 = icmp sgt i32 %0, 127
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = lshr i32 %4, 7
%8 = icmp ugt i32 %4, 16383
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}