xunge/DecIR huggingface dataset:
/* Variables and functions */
char toupper(char);
void upper(char *str, int len) {
  int i;
  for (i = 0; i < len; i++)
    str[i] = toupper(str[i]);
}


x86 assembly (clang, -O0):
<upper>:
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    115e <upper+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <upper+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <upper+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <upper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @upper(i8* 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 i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runFIFO(int);
int /*<<< orphan*/ runHPF_EX(int);
int /*<<< orphan*/ runHPF_NE(int);
int /*<<< orphan*/ runLts(int);
int /*<<< orphan*/ runRR_2(int);
int /*<<< orphan*/ runRR_3(int);
int /*<<< orphan*/ runSJF_EX(int);
int /*<<< orphan*/ runSJF_NE(int);
void correr(int i) {
  runFIFO(i);
  runRR_2(i);
  runRR_3(i);
  runSJF_NE(i);
  runSJF_EX(i);
  runHPF_EX(i);
  runHPF_NE(i);
  runLts(i);
}


x86 assembly (clang, -O0):
<correr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <runFIFO@plt>
mov    -0x4(%rbp),%edi
call   1040 <runRR_2@plt>
mov    -0x4(%rbp),%edi
call   1080 <runRR_3@plt>
mov    -0x4(%rbp),%edi
call   10a0 <runSJF_NE@plt>
mov    -0x4(%rbp),%edi
call   1030 <runSJF_EX@plt>
mov    -0x4(%rbp),%edi
call   1070 <runHPF_EX@plt>
mov    -0x4(%rbp),%edi
call   1050 <runHPF_NE@plt>
mov    -0x4(%rbp),%edi
call   1090 <runLts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<correr>:
push   %rbx
mov    %edi,%ebx
call   1060 <runFIFO@plt>
mov    %ebx,%edi
call   1040 <runRR_2@plt>
mov    %ebx,%edi
call   1080 <runRR_3@plt>
mov    %ebx,%edi
call   10a0 <runSJF_NE@plt>
mov    %ebx,%edi
call   1030 <runSJF_EX@plt>
mov    %ebx,%edi
call   1070 <runHPF_EX@plt>
mov    %ebx,%edi
call   1050 <runHPF_NE@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1090 <runLts@plt>

LLVM IR (-O0):
define void @correr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @runFIFO(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @runRR_2(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @runRR_3(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @runSJF_NE(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @runSJF_EX(i32 %11)
%13 = load i32, i32* %2
%14 = call i32 @runHPF_EX(i32 %13)
%15 = load i32, i32* %2
%16 = call i32 @runHPF_NE(i32 %15)
%17 = load i32, i32* %2
%18 = call i32 @runLts(i32 %17)
ret void
}

LLVM IR (-O2):
define void @correr(i32 %0) {
%2 = tail call i32 @runFIFO(i32 %0)
%3 = tail call i32 @runRR_2(i32 %0)
%4 = tail call i32 @runRR_3(i32 %0)
%5 = tail call i32 @runSJF_NE(i32 %0)
%6 = tail call i32 @runSJF_EX(i32 %0)
%7 = tail call i32 @runHPF_EX(i32 %0)
%8 = tail call i32 @runHPF_NE(i32 %0)
%9 = tail call i32 @runLts(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetFontLtalic109(unsigned long);
void setfontltalic(unsigned long lt) { SetFontLtalic109(lt); }


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

x86 assembly (clang, -O2):
<setfontltalic>:
jmp    1030 <SetFontLtalic109@plt>

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

LLVM IR (-O2):
define void @setfontltalic(i64 %0) {
%2 = tail call i32 @SetFontLtalic109(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ex8();
int /*<<< orphan*/ getchar();
int main() {
  int a[10] = {11, 12, 13, 15, 21, 49, 11, 29, 39, 23};
  float b[10] = {55.5, 75.5, 60.5, 90.5, 120.5, 40.5, 50.5, 65.5, 70.5, 80.5};
  ex8();
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed1(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    $0x0,%al
call   1050 <ex8@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ex8@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 11, i32 12, i32 13, i32 15, i32 21, i32 49, i32 11, i32 29, i32 39, i32 23]
@__const.main.b = [10 x float] [float 5.550000e+01, float 7.550000e+01, float 6.050000e+01, float 9.050000e+01, float 1.205000e+02, float 4.050000e+01, float 5.050000e+01, float 6.550000e+01, float 7.050000e+01, float 8.050000e+01]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x float]
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast [10 x float]* %3 to i8*
%6 = call i32 (...) @ex8()
%7 = call i32 (...) @getchar()
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ex8()
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
__attribute__((__weak__, __always___)) int
softboundcets_strcmp(const char *s1, const char *s2) {
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<softboundcets_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ b_init();
void a_init() {
  b_init();
  b_init();
}


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

x86 assembly (clang, -O2):
<a_init>:
push   %rax
xor    %eax,%eax
call   1030 <b_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <b_init@plt>

LLVM IR (-O0):
define void @a_init() {
%1 = call i32 (...) @b_init()
%2 = call i32 (...) @b_init()
ret void
}

LLVM IR (-O2):
define void @a_init() {
%1 = tail call i32 (...) @b_init()
%2 = tail call i32 (...) @b_init()
ret void
}
int output_device_ack(void) { return 0xffffffff; }


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

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

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

LLVM IR (-O2):
define i32 @output_device_ack() {
ret i32 -1
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int filesize(char *filename) {
  int size;
  struct stat fileinfo;
  if (stat(filename, &fileinfo) != 0)
    size = (int)0;
  else
    size = (int)fileinfo.st_size;
  return size;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <filesize+0x2f>
movl   $0x0,-0xc(%rbp)
jmp    1146 <filesize+0x36>
mov    -0x18(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <filesize+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @filesize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 %8, i32 0
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void usage(FILE *stream) {
  fputs("usage: "
        "ioseqw"
        " [opts] -s <record-size> -c <record-count>\n\n"
        "Mandatory:\n"
        "  -s <record-size>   Size of records to write\n"
        "  -c <record-count>  Number of records to write\n\n"
        "Optional:\n"
        "  -f <filename>      Name of the file to write to\n"
        "  -t <sync-type>     Sync option to use for writing\n"
        "  -h                 Show this help\n"
        "  -v                 Show version\n\n"
        "Sync types:\n"
        "  -t sync            Use the O_SYNC open option\n"
        "  -t dsync           Use the O_DSYNC open option\n"
        "  -t fsync           Use the fsync() system call\n",
        stream);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1f8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [505 x i8] c"usage: ioseqw [opts] -s <record-size> -c <record-count>\0A\0AMandatory:\0A -s <record-size> Size of records to write\0A -c <record-count> Number of records to write\0A\0AOptional:\0A -f <filename> Name of the file to write to\0A -t <sync-type> Sync option to use for writing\0A -h Show this help\0A -v Show version\0A\0ASync types:\0A -t sync Use the O_SYNC open option\0A -t dsync Use the O_DSYNC open option\0A -t fsync Use the fsync() system call\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [505 x i8] c"usage: ioseqw [opts] -s <record-size> -c <record-count>\0A\0AMandatory:\0A -s <record-size> Size of records to write\0A -c <record-count> Number of records to write\0A\0AOptional:\0A -f <filename> Name of the file to write to\0A -t <sync-type> Sync option to use for writing\0A -h Show this help\0A -v Show version\0A\0ASync types:\0A -t sync Use the O_SYNC open option\0A -t dsync Use the O_DSYNC open option\0A -t fsync Use the fsync() system call\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0), i64 504, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allocate(int, int);
int /*<<< orphan*/ deallocate(int);
int main(void) {
  allocate(1000, 2);
  allocate(1000, 1);
  deallocate(2);
  deallocate(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
mov    $0x2,%esi
call   1040 <allocate@plt>
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1040 <allocate@plt>
mov    $0x2,%edi
call   1030 <deallocate@plt>
mov    $0x1,%edi
call   1030 <deallocate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
mov    $0x2,%esi
call   1040 <allocate@plt>
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1040 <allocate@plt>
mov    $0x2,%edi
call   1030 <deallocate@plt>
mov    $0x1,%edi
call   1030 <deallocate@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @allocate(i32 1000, i32 2)
%3 = call i32 @allocate(i32 1000, i32 1)
%4 = call i32 @deallocate(i32 2)
%5 = call i32 @deallocate(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @allocate(i32 1000, i32 2)
%2 = tail call i32 @allocate(i32 1000, i32 1)
%3 = tail call i32 @deallocate(i32 2)
%4 = tail call i32 @deallocate(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outbufBytes(char const *, int);
void telnetConfigure(void) {
  static const char config[] = {'\xFF', '\xFD', 34,     '\xFF', '\xFA', 34, 1,
                                0,      '\xFF', '\xF0', '\xFF', '\xFB', 1};
  outbufBytes(config, sizeof config);
}


x86 assembly (clang, -O0):
<telnetConfigure>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xd,%esi
call   1030 <outbufBytes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<telnetConfigure>:
lea    0xee9(%rip),%rdi
mov    $0xd,%esi
jmp    1030 <outbufBytes@plt>

LLVM IR (-O0):
@telnetConfigure.config = internal constant [13 x i8] c"\FF\FD\22\FF\FA\22\01\00\FF\F0\FF\FB\01"
define void @telnetConfigure() {
%1 = call i32 @outbufBytes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @telnetConfigure.config, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@telnetConfigure.config = internal constant [13 x i8] c"\FF\FD\22\FF\FA\22\01\00\FF\F0\FF\FB\01"
define void @telnetConfigure() {
%1 = tail call i32 @outbufBytes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @telnetConfigure.config, i64 0, i64 0), i32 13)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode;
typedef int /*<<< orphan*/ id;

/* Variables and functions */
int /*<<< orphan*/ CG_Argv(int);
int /*<<< orphan*/ CG_Say(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ trap_Argv(int, char *, int);
void CG_Chat_f(void) {
  char id[3];
  char mode[3];
  trap_Argv(1, id, sizeof(id));
  trap_Argv(2, mode, sizeof(mode));
  CG_Say(atoi(id), atoi(mode), CG_Argv(3));
}


x86 assembly (clang, -O0):
<CG_Chat_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rsi
mov    $0x1,%edi
mov    $0x3,%edx
call   1040 <trap_Argv@plt>
lea    -0x6(%rbp),%rsi
mov    $0x2,%edi
mov    $0x3,%edx
call   1040 <trap_Argv@plt>
lea    -0x3(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x10(%rbp)
lea    -0x6(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1030 <CG_Argv@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1050 <CG_Say@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_Chat_f>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xd(%rsp),%r14
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x3,%edx
call   1040 <trap_Argv@plt>
lea    0xa(%rsp),%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <trap_Argv@plt>
mov    %r14,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1030 <CG_Argv@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1050 <CG_Say@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @CG_Chat_f() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i32 @trap_Argv(i32 1, i8* %3, i32 3)
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = call i32 @trap_Argv(i32 2, i8* %5, i32 3)
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%8 = call i32 @atoi(i8* %7)
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%10 = call i32 @atoi(i8* %9)
%11 = call i32 @CG_Argv(i32 3)
%12 = call i32 @CG_Say(i32 %8, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @CG_Chat_f() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @trap_Argv(i32 1, i8* %3, i32 3)
%6 = call i32 @trap_Argv(i32 2, i8* %4, i32 3)
%7 = call i32 @atoi(i8* %3)
%8 = call i32 @atoi(i8* %4)
%9 = call i32 @CG_Argv(i32 3)
%10 = call i32 @CG_Say(i32 %7, i32 %8, i32 %9)
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
uint8_t parse_hex_digit(char c) {
  if (c >= 'a' && c <= 'f')
    return c - 'a' + 0xa;
  if (c >= 'A' && c <= 'F')
    return c - 'A' + 0xa;
  return c - '0';
}


x86 assembly (clang, -O0):
<parse_hex_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <parse_hex_digit+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x66,%eax
jg     1136 <parse_hex_digit+0x36>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    116c <parse_hex_digit+0x6c>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1162 <parse_hex_digit+0x62>
movsbl -0x2(%rbp),%eax
cmp    $0x46,%eax
jg     1162 <parse_hex_digit+0x62>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    116c <parse_hex_digit+0x6c>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_hex_digit>:
lea    -0x61(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x6,%cl
mov    $0xc9,%ecx
mov    $0xd0,%edx
cmovb  %ecx,%edx
cmp    $0x6,%al
mov    $0xa9,%eax
cmovae %edx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @parse_hex_digit(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 102
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %36
17: ; preds = %7, %1
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 70
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 65
%29 = add nsw i32 %28, 10
%30 = trunc i32 %29 to i8
store i8 %30, i8* %2
br label %36
31: ; preds = %21, %17
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = sub nsw i32 %33, 48
%35 = trunc i32 %34 to i8
store i8 %35, i8* %2
br label %36
36: ; preds = %31, %25, %11
%37 = load i8, i8* %2
ret i8 %37
}

LLVM IR (-O2):
define signext i8 @parse_hex_digit(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 6
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = select i1 %5, i8 -55, i8 -48
%7 = select i1 %3, i8 -87, i8 %6
%8 = add i8 %7, %0
ret i8 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t fork(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fork() {
ret i32 0
}
int f_bun_mm1(float *a1, float *a2) {
  return (__builtin_isunordered(*a1, *a2));
}


x86 assembly (clang, -O0):
<f_bun_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bun_mm1>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @f_bun_mm1(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fcmp uno float %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_bun_mm1(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp uno float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int sqrt(double);
int /*<<< orphan*/ track_stats(void *);
double poly1(double x, void *params) {
  track_stats(params);
  return 1 + 1 / sqrt(x) + 1 / x;
}


x86 assembly (clang, -O0):
<poly1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <track_stats@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xea3(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly1>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <track_stats@plt>
movsd  (%rsp),%xmm0
call   1040 <sqrt@plt>
add    $0x1,%eax
cmp    $0x3,%eax
mov    $0x1,%ecx
cmovb  %eax,%ecx
cvtsi2sd %ecx,%xmm1
movsd  0xeb1(%rip),%xmm0
divsd  (%rsp),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @poly1(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @track_stats(i8* %5)
%7 = load double, double* %3
%8 = call i32 @sqrt(double %7)
%9 = sdiv i32 1, %8
%10 = add nsw i32 1, %9
%11 = sitofp i32 %10 to double
%12 = load double, double* %3
%13 = fdiv double 1.000000e+00, %12
%14 = fadd double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @poly1(double %0, i8* %1) {
%3 = tail call i32 @track_stats(i8* %1)
%4 = tail call i32 @sqrt(double %0)
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %5, i32 1
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.000000e+00, %0
%10 = fadd double %9, %8
ret double %10
}
int calculMediane(int iterationMediane, int *histogramme) {
  int i;
  i = 0;
  while (iterationMediane > 0) {
    iterationMediane -= histogramme[i];
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<calculMediane>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113d <calculMediane+0x3d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <calculMediane+0x12>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculMediane>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <calculMediane+0x1c>
cs nopw 0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
sub    (%rsi,%rcx,4),%edi
jg     1110 <calculMediane+0x10>
ret

LLVM IR (-O0):
define i32 @calculMediane(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 = %9, %2
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @calculMediane(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %5
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
%10 = add nuw i64 %5, 1
%11 = icmp sgt i32 %9, 0
br i1 %11, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %10 to i32
br label %14
14: ; preds = %12, %2
%15 = phi i32 [ 0, %2 ], [ %13, %12 ]
ret i32 %15
}
/* Type definitions */
struct section_list_link {
  int dummy;
};
struct section_list {
  int dummy;
};
struct section {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_search(struct genlist const *, struct section const *);
struct section_list_link *section_list_search(const struct section_list *tthis,
                                              const struct section *pfoo) {
  return ((struct section_list_link *)genlist_search(
      (const struct genlist *)tthis, pfoo));
}


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

x86 assembly (clang, -O2):
<section_list_search>:
jmp    1030 <genlist_search@plt>

LLVM IR (-O0):
%struct.section_list_link = type { i32 }
%struct.section_list = type { i32 }
%struct.section = type { i32 }
%struct.genlist = type { i32 }
define %struct.section_list_link* @section_list_search(%struct.section_list* %0, %struct.section* %1) {
%3 = alloca %struct.section_list*
%4 = alloca %struct.section*
store %struct.section_list* %0, %struct.section_list** %3
store %struct.section* %1, %struct.section** %4
%5 = load %struct.section_list*, %struct.section_list** %3
%6 = bitcast %struct.section_list* %5 to %struct.genlist*
%7 = load %struct.section*, %struct.section** %4
%8 = call i64 @genlist_search(%struct.genlist* %6, %struct.section* %7)
%9 = inttoptr i64 %8 to %struct.section_list_link*
ret %struct.section_list_link* %9
}

LLVM IR (-O2):
%struct.section_list_link = type { i32 }
%struct.section_list = type { i32 }
%struct.section = type { i32 }
%struct.genlist = type { i32 }
define %struct.section_list_link* @section_list_search(%struct.section_list* %0, %struct.section* %1) {
%3 = bitcast %struct.section_list* %0 to %struct.genlist*
%4 = tail call i64 @genlist_search(%struct.genlist* %3, %struct.section* %1)
%5 = inttoptr i64 %4 to %struct.section_list_link*
ret %struct.section_list_link* %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void maybeclose(int fd) {
  if (fd != -1)
    close(fd);
}


x86 assembly (clang, -O0):
<maybeclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112d <maybeclose+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @maybeclose(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
bool_t clntraw_control(CLIENT *cl, int i, char *c) { return FALSE; }


x86 assembly (clang, -O0):
<clntraw_control>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clntraw_control>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @clntraw_control(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @FALSE
ret i32 %7
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @clntraw_control(i32* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @FALSE
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cap1166_blink(unsigned int);
int /*<<< orphan*/ cap1166_blink_rate(int);
unsigned int cap1166_get_blink();
void led_breathe(int i, int p) {
  unsigned int l;
  l = cap1166_get_blink();
  if (p == 0) {
    l &= ~(1 << (i));
  } else {
    l |= (1 << (i));
  };
  cap1166_blink_rate(p);
  cap1166_blink(l);
}


x86 assembly (clang, -O0):
<led_breathe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <cap1166_get_blink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    116a <led_breathe+0x3a>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    117a <led_breathe+0x4a>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <cap1166_blink_rate@plt>
mov    -0xc(%rbp),%edi
call   1050 <cap1166_blink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_breathe>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <cap1166_get_blink@plt>
mov    %eax,%ebx
btr    %ebp,%ebx
bts    %ebp,%eax
test   %r14d,%r14d
cmovne %eax,%ebx
mov    %r14d,%edi
call   1030 <cap1166_blink_rate@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <cap1166_blink@plt>

LLVM IR (-O0):
define void @led_breathe(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @cap1166_get_blink()
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = shl i32 1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %5
%14 = and i32 %13, %12
store i32 %14, i32* %5
br label %20
15: ; preds = %2
%16 = load i32, i32* %3
%17 = shl i32 1, %16
%18 = load i32, i32* %5
%19 = or i32 %18, %17
store i32 %19, i32* %5
br label %20
20: ; preds = %15, %9
%21 = load i32, i32* %4
%22 = call i32 @cap1166_blink_rate(i32 %21)
%23 = load i32, i32* %5
%24 = call i32 @cap1166_blink(i32 %23)
ret void
}

LLVM IR (-O2):
define void @led_breathe(i32 %0, i32 %1) {
%3 = tail call i32 (...) @cap1166_get_blink()
%4 = icmp eq i32 %1, 0
%5 = shl nuw i32 1, %0
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = or i32 %3, %5
%9 = select i1 %4, i32 %7, i32 %8
%10 = tail call i32 @cap1166_blink_rate(i32 %1)
%11 = tail call i32 @cap1166_blink(i32 %9)
ret void
}
/* Variables and functions */
int PAPI_read_ts(int, long long *, long long *);
void papif_read_ts(int *EventSet, long long *values, long long *cycles,
                   int *check) {
  *check = PAPI_read_ts(*EventSet, values, cycles);
}


x86 assembly (clang, -O0):
<papif_read_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <PAPI_read_ts@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_read_ts>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_read_ts@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_read_ts(i32* nocapture %0, i64* %1, i64* %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @PAPI_read_ts(i32 %5, i64* %1, i64* %2)
store i32 %6, i32* %3
ret void
}
double hex(qx)
double qx;
{
  double f;
  long z;
  f = floor(qx);
  z = f;
  printf("0%lo  0x%lx  %ld.\n", z, z, z);
  return (qx);
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <floor@plt>
cvttsd2si %xmm0,%rcx
lea    0xec9(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"0%lo 0x%lx %ld.\0A\00"
define double @hex(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i64
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @llvm.floor.f64(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = fptosi double %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = load i64, i64* %4
%11 = load i64, i64* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %10, i64 %11)
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
@.str = [19 x i8] c"0%lo 0x%lx %ld.\0A\00"
define double @hex(double returned %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fptosi double %2 to i64
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %3, i64 %3)
ret double %0
}
XFlush() {}


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

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

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

LLVM IR (-O2):
define i32 @XFlush() {
ret i32 undef
}
/* Variables and functions */
long *_RPyFetchFastGil();
extern __attribute__((visibility("hidden"))) long *RPyFetchFastGil(void) {
  return _RPyFetchFastGil();
}


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

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

LLVM IR (-O0):
define hidden i64* @RPyFetchFastGil() {
%1 = call i64* (...) @_RPyFetchFastGil()
ret i64* %1
}

LLVM IR (-O2):
define hidden i64* @RPyFetchFastGil() {
%1 = tail call i64* (...) @_RPyFetchFastGil()
ret i64* %1
}
int g3(int j, unsigned short *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<g3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g3>:
movzwl (%rsi,%rdx,2),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @g3(i32 %0, i16* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i64
store i32 %0, i32* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i16*, i16** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = zext i16 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @g3(i32 %0, i16* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %1, i64 %2
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, %0
ret i32 %7
}
void check_negative_sized_VLA_7() {
  signed char x = -1;
  int vla[x + 2];
}


x86 assembly (clang, -O0):
<check_negative_sized_VLA_7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x2,%eax
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_negative_sized_VLA_7() {
%1 = alloca i8
%2 = alloca i8*
%3 = alloca i64
store i8 -1, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %2
%9 = alloca i32, i64 %7
store i64 %7, i64* %3
%10 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @check_negative_sized_VLA_7() {
ret void
}
/* Variables and functions */
double log(int);
double atanh(double x) { return .5 * log((1. + x) / (1. - x)); }


x86 assembly (clang, -O0):
<atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanh>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <log@plt>
mulsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
%9 = call double @log(i32 %8)
%10 = fmul double 5.000000e-01, %9
ret double %10
}

LLVM IR (-O2):
define double @atanh(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fdiv double %2, %3
%5 = fptosi double %4 to i32
%6 = tail call double @log(i32 %5)
%7 = fmul double %6, 5.000000e-01
ret double %7
}
/* Type definitions */
typedef int __u16;

/* Variables and functions */
int cec_has_backup(__u16 log_addr_mask) {
  return log_addr_mask & ((1 << 12) | (1 << 13));
}


x86 assembly (clang, -O0):
<cec_has_backup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_has_backup>:
mov    %edi,%eax
and    $0x3000,%eax
ret

LLVM IR (-O0):
define i32 @cec_has_backup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 12288
ret i32 %4
}

LLVM IR (-O2):
define i32 @cec_has_backup(i32 %0) {
%2 = and i32 %0, 12288
ret i32 %2
}
int x20_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x20_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printer(int a, int b) {
  if (a + b == 10)
    printf("%d+%d = 10\n", a, b);
}


x86 assembly (clang, -O0):
<printer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0xa,%eax
jne    113f <printer+0x2f>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printer>:
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%eax
cmp    $0xa,%eax
jne    1128 <printer+0x18>
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d+%d = 10\0A\00"
define void @printer(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tracefree(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @tracefree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct libjte_env {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int write_jt_match_record(struct libjte_env *, char *, char *, int,
                          int /*<<< orphan*/, unsigned char *);
int libjte_write_match_record(struct libjte_env *o, char *filename,
                              char *mirror_name, int sector_size, off_t size,
                              unsigned char md5[16]) {
  int ret;
  ret = write_jt_match_record(o, filename, mirror_name, sector_size, size, md5);
  if (ret <= 0)
    return ret;
  return 1;
}


x86 assembly (clang, -O0):
<libjte_write_match_record>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x30(%rbp),%r9
call   1030 <write_jt_match_record@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jg     1163 <libjte_write_match_record+0x53>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <libjte_write_match_record+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libjte_write_match_record>:
push   %rax
call   1030 <write_jt_match_record@plt>
test   %eax,%eax
mov    $0x1,%ecx
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.libjte_env = type { i32 }
define i32 @libjte_write_match_record(%struct.libjte_env* %0, i8* %1, i8* %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca %struct.libjte_env*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
store %struct.libjte_env* %0, %struct.libjte_env** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
%15 = load %struct.libjte_env*, %struct.libjte_env** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i8*, i8** %13
%21 = call i32 @write_jt_match_record(%struct.libjte_env* %15, i8* %16, i8* %17, i32 %18, i32 %19, i8* %20)
store i32 %21, i32* %14
%22 = load i32, i32* %14
%23 = icmp sle i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %6
%25 = load i32, i32* %14
store i32 %25, i32* %7
br label %27
26: ; preds = %6
store i32 1, i32* %7
br label %27
27: ; preds = %26, %24
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
%struct.libjte_env = type { i32 }
define i32 @libjte_write_match_record(%struct.libjte_env* %0, i8* %1, i8* %2, i32 %3, i32 %4, i8* %5) {
%7 = tail call i32 @write_jt_match_record(%struct.libjte_env* %0, i8* %1, i8* %2, i32 %3, i32 %4, i8* %5)
%8 = icmp slt i32 %7, 1
%9 = select i1 %8, i32 %7, i32 1
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ const reverse(scalar_t__ const);
bool is_palindrome(uint32_t const n) { return reverse(n) == n; }


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

x86 assembly (clang, -O2):
<is_palindrome>:
push   %rbx
mov    %rdi,%rbx
call   1030 <reverse@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_palindrome(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @reverse(i64 %3)
%5 = load i64, i64* %2
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_palindrome(i64 %0) {
%2 = tail call i64 @reverse(i64 %0)
%3 = icmp eq i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void test0(void) {
  void **x = NULL;
  *x = (void *)&x;
}


x86 assembly (clang, -O0):
<test0>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test0() {
%1 = alloca i8**
store i8** null, i8*** %1
%2 = bitcast i8*** %1 to i8*
%3 = load i8**, i8*** %1
store i8* %2, i8** %3
ret void
}

LLVM IR (-O2):