xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ ioctl(int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void cmd_without_param(int cmd, int fd) {
  if (ioctl(fd, cmd, NULL) >= 0)
    exit(0);
  perror("ioctl");
  exit(1);
}


x86 assembly (clang, -O0):
<cmd_without_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jl     115e <cmd_without_param+0x2e>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<cmd_without_param>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
test   %rax,%rax
js     114a <cmd_without_param+0x1a>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ioctl\00"
define void @cmd_without_param(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i64 @ioctl(i32 %5, i32 %6, i32* null)
%8 = icmp sge i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"ioctl\00"
define void @cmd_without_param(i32 %0, i32 %1) {
%3 = tail call i64 @ioctl(i32 %1, i32 %0, i32* null)
%4 = icmp sgt i64 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
}
int isregfile(char *filename) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @isregfile(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage: wdls [option]\n");
  printf("\t-p\t--port=\tHTTP port\n");
  printf("\t-r\t--root=\tHTTP root path\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: wdls [option]\0A\00"
@.str.1 = [23 x i8] c"\09-p\09--port=\09HTTP port\0A\00"
@.str.2 = [28 x i8] c"\09-r\09--root=\09HTTP root path\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Usage: wdls [option]\00"
@str.3 = [22 x i8] c"\09-p\09--port=\09HTTP port\00"
@str.4 = [27 x i8] c"\09-r\09--root=\09HTTP root path\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ move(int, char, char, char);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("\n\nSolution for 3 discs..\n");
  move(3, 'a', 'b', 'c');
  printf("\n\nSolution for 5 discs..\n");
  move(5, 'a', 'b', 'c');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
call   1040 <move@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
call   1040 <move@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
call   1040 <move@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
mov    $0x61,%esi
mov    $0x62,%edx
mov    $0x63,%ecx
call   1040 <move@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0A\0ASolution for 3 discs..\0A\00"
@.str.1 = [26 x i8] c"\0A\0ASolution for 5 discs..\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @move(i32 3, i8 signext 97, i8 signext 98, i8 signext 99)
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @move(i32 5, i8 signext 97, i8 signext 98, i8 signext 99)
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"\0A\0ASolution for 3 discs..\00"
@str.2 = [25 x i8] c"\0A\0ASolution for 5 discs..\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @move(i32 3, i8 signext 97, i8 signext 98, i8 signext 99)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @move(i32 5, i8 signext 97, i8 signext 98, i8 signext 99)
ret i32 0
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  int /*<<< orphan*/ sa_mask;
  scalar_t__ sa_flags;
};

/* Variables and functions */
int sigaction(int, struct sigaction *, struct sigaction *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sig_catch(int sig, void (*func)(int)) {
  struct sigaction sa;
  sa.sa_flags = 0;
  sa.sa_handler = func;
  sigemptyset(&sa.sa_mask);
  return sigaction(sig, &sa, (struct sigaction *)0);
}


x86 assembly (clang, -O0):
<sig_catch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x8,%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_catch>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movq   $0x0,0x18(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <sigemptyset@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)*, i32, i64 }
define i32 @sig_catch(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 2
store i64 0, i64* %6
%7 = load void (i32)*, void (i32)** %4
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %7, void (i32)** %8
%9 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
%10 = call i32 @sigemptyset(i32* %9)
%11 = load i32, i32* %3
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %5, %struct.sigaction* null)
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i32, i64 }
define i32 @sig_catch(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %6
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
%8 = call i32 @sigemptyset(i32* %7)
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, %struct.sigaction* null)
ret i32 %9
}
/* Variables and functions */
scalar_t__ alloca(int);
int /*<<< orphan*/ test();
int main() {
  int buf[16];
  int offset = (((int)buf) & 0xFFF);
  int *space = (int *)alloca(offset);
  *space = 0;
  test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rax
and    $0xfff,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%edi
call   1030 <alloca@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1040 <test@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
and    $0xff0,%edi
call   1030 <alloca@plt>
movl   $0x0,(%rax)
xor    %eax,%eax
call   1040 <test@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%6 = ptrtoint i32* %5 to i32
%7 = and i32 %6, 4095
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i64 @alloca(i32 %8)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %4
%11 = load i32*, i32** %4
store i32 0, i32* %11
%12 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = ptrtoint [16 x i32]* %1 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 4080
%6 = call i64 @alloca(i32 %5)
%7 = inttoptr i64 %6 to i32*
store i32 0, i32* %7
%8 = call i32 (...) @test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *textyear(int year) {
  static char y[10];
  if (year < 0)
    sprintf(y, "%d BC", -year);
  else
    sprintf(y, "%d AD", year);
  return y;
}


x86 assembly (clang, -O0):
<textyear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1142 <textyear+0x32>
xor    %edx,%edx
sub    -0x4(%rbp),%edx
lea    0x2ef8(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1158 <textyear+0x48>
mov    -0x4(%rbp),%edx
lea    0x2edd(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2eca(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textyear>:
push   %rax
mov    %edi,%edx
test   %edi,%edi
js     1127 <textyear+0x17>
lea    0x2f0b(%rip),%rdi
lea    0xee1(%rip),%rsi
jmp    1137 <textyear+0x27>
neg    %edx
lea    0x2ef9(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ee6(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@textyear.y = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"%d BC\00"
@.str.1 = [6 x i8] c"%d AD\00"
define i8* @textyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @textyear.y, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @textyear.y, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %5
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @textyear.y, i64 0, i64 0)
}

LLVM IR (-O2):
@textyear.y = internal global [10 x i8] zeroinitializer
@.str = [6 x i8] c"%d BC\00"
@.str.1 = [6 x i8] c"%d AD\00"
define i8* @textyear(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @textyear.y, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @textyear.y, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %3
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @textyear.y, i64 0, i64 0)
}
unsigned int qr_switch_cost(unsigned int state[], const int k, const int j) {
  (void)k;
  return state[j];
}


x86 assembly (clang, -O0):
<qr_switch_cost>:
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
pop    %rbp
ret

x86 assembly (clang, -O2):
<qr_switch_cost>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @qr_switch_cost(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%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
ret i32 %12
}

LLVM IR (-O2):
define i32 @qr_switch_cost(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
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MEDIUM_ERROR;
int tcmu_set_sense_data(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                        int /*<<< orphan*/ *);
int set_medium_error(uint8_t *sense) {
  return tcmu_set_sense_data(sense, MEDIUM_ERROR, 0x1100, NULL);
}


x86 assembly (clang, -O0):
<set_medium_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    $0x1100,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <tcmu_set_sense_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_medium_error>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%esi
mov    $0x1100,%edx
xor    %ecx,%ecx
jmp    1030 <tcmu_set_sense_data@plt>

LLVM IR (-O0):
@MEDIUM_ERROR = global i32 0
define i32 @set_medium_error(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @MEDIUM_ERROR
%5 = call i32 @tcmu_set_sense_data(i32* %3, i32 %4, i32 4352, i32* null)
ret i32 %5
}

LLVM IR (-O2):
@MEDIUM_ERROR = global i32 0
define i32 @set_medium_error(i32* %0) {
%2 = load i32, i32* @MEDIUM_ERROR
%3 = tail call i32 @tcmu_set_sense_data(i32* %0, i32 %2, i32 4352, i32* null)
ret i32 %3
}
int do_006() { return 6; }


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

x86 assembly (clang, -O2):
mov    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @do_006() {
ret i32 6
}

LLVM IR (-O2):
define i32 @do_006() {
ret i32 6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ RunFunctionalTests();
int /*<<< orphan*/ RunMountingTests();
int main(int argc, char **argv) {
  RunMountingTests();
  RunFunctionalTests();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <RunMountingTests@plt>
mov    $0x0,%al
call   1030 <RunFunctionalTests@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <RunMountingTests@plt>
xor    %eax,%eax
call   1030 <RunFunctionalTests@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @RunMountingTests()
%7 = call i32 (...) @RunFunctionalTests()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @RunMountingTests()
%4 = tail call i32 (...) @RunFunctionalTests()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int add2(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  int result;
  scanf("%d", &n);
  result = add2(n, n * n);
  printf("Sum = %ld\n", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    %edi,%esi
imul   %edi,%esi
call   1050 <add2@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @add2(i32 %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int Fibonnaci(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else
    return Fibonnaci(n - 1) + Fibonnaci(n - 2);
}


x86 assembly (clang, -O0):
<Fibonnaci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <Fibonnaci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <Fibonnaci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <Fibonnaci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <Fibonnaci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <Fibonnaci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <Fibonnaci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fibonnaci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <Fibonnaci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <Fibonnaci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <Fibonnaci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Fibonnaci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @Fibonnaci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
scalar_t__ system(char *);
int diff_files(const char *name1, const char *name2) {
  char cmd[512];
  memset(cmd, 0, 512);
  sprintf(cmd, "diff %s %s", name1, name2);
  return system(cmd) != 0;
}


x86 assembly (clang, -O0):
<diff_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe94(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_files>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
lea    0xea5(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %r15,%rdi
call   1030 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"diff %s %s\00"
define i32 @diff_files(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 512)
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%13 = call i64 @system(i8* %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"diff %s %s\00"
define i32 @diff_files(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 512)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%7 = call i64 @system(i8* %4)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
double En(int, double, double);
double E_modeShape(int p, double *L) {
  if (p < 2)
    return 0.0;
  else
    return En(p - 2, L[0], L[1]);
}


x86 assembly (clang, -O0):
<E_modeShape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1136 <E_modeShape+0x26>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <E_modeShape+0x47>
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
call   1030 <En@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<E_modeShape>:
cmp    $0x2,%edi
jge    1119 <E_modeShape+0x9>
xorps  %xmm0,%xmm0
ret
add    $0xfffffffe,%edi
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
jmp    1030 <En@plt>

LLVM IR (-O0):
define double @E_modeShape(i32 %0, double* %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store double 0.000000e+00, double* %3
br label %19
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 2
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = call double @En(i32 %11, double %14, double %17)
store double %18, double* %3
br label %19
19: ; preds = %9, %8
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @E_modeShape(i32 %0, double* nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -2
%6 = load double, double* %1
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = tail call double @En(i32 %5, double %6, double %8)
br label %10
10: ; preds = %2, %4
%11 = phi double [ %9, %4 ], [ 0.000000e+00, %2 ]
ret double %11
}
int custom_strncmp(const unsigned char *src1, const unsigned char *src2,
                   int len) {
  int retcode = 0;
  while (len--) {
    if (*(src1++) != *(src2++)) {
      retcode = 1;
      len = 0;
    }
  }
  return (retcode);
}


x86 assembly (clang, -O0):
<custom_strncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1169 <custom_strncmp+0x69>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     1164 <custom_strncmp+0x64>
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    1116 <custom_strncmp+0x16>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_strncmp>:
test   %edx,%edx
je     113c <custom_strncmp+0x3c>
add    $0xffffffff,%edx
xor    %r9d,%r9d
mov    $0x1,%r8d
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%r9,1),%ecx
cmp    (%rsi,%r9,1),%cl
cmovne %r8d,%eax
jne    113b <custom_strncmp+0x3b>
lea    0x1(%r9),%rcx
cmp    %r9d,%edx
mov    %rcx,%r9
jne    1120 <custom_strncmp+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @custom_strncmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %20, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %16, %5 ], [ 0, %3 ]
%7 = phi i32 [ %10, %5 ], [ %2, %3 ]
%8 = phi i8* [ %13, %5 ], [ %1, %3 ]
%9 = phi i8* [ %11, %5 ], [ %0, %3 ]
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %8
%15 = icmp eq i8 %12, %14
%16 = select i1 %15, i32 %6, i32 1
%17 = icmp eq i32 %10, 0
%18 = xor i1 %15, true
%19 = select i1 %18, i1 true, i1 %17
br i1 %19, label %20, label %5
20: ; preds = %5, %3
%21 = phi i32 [ 0, %3 ], [ %16, %5 ]
ret i32 %21
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void sigalarm_block() {
  sigset_t ens;
  sigemptyset(&ens);
  sigaddset(&ens, SIGALRM);
  sigprocmask(SIG_BLOCK, &ens, NULL);
}


x86 assembly (clang, -O0):
<sigalarm_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigalarm_block>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
define void @sigalarm_block() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGALRM
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
define void @sigalarm_block() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGALRM
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %1, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int fchownat(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/);
int chownat(int fd, char const *file, uid_t owner, gid_t group) {
  return fchownat(fd, file, owner, group, 0);
}


x86 assembly (clang, -O0):
<chownat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <fchownat@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @chownat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @fchownat(i32 %0, i8* %1, i32 %2, i32 %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int f(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int q;
  scanf("%d", &q);
  int ans = f(q, q);
  printf("%d\n", ans);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    %edi,%esi
call   1030 <f@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @f(i32 %4, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void dummy_gennorm_fun() { return; }


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

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

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

LLVM IR (-O2):
define void @dummy_gennorm_fun() {
ret void
}
/* Type definitions */
struct delete_cmdline_parser_params {
  int dummy;
};
struct delete_args_info {
  int dummy;
};

/* Variables and functions */
int delete_cmdline_parser_internal(int, char **, struct delete_args_info *,
                                   struct delete_cmdline_parser_params *,
                                   int /*<<< orphan*/);
int delete_cmdline_parser_ext(int argc, char **argv,
                              struct delete_args_info *args_info,
                              struct delete_cmdline_parser_params *params) {
  int result;
  result = delete_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<delete_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <delete_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.delete_args_info = type { i32 }
%struct.delete_cmdline_parser_params = type { i32 }
define i32 @delete_cmdline_parser_ext(i32 %0, i8** %1, %struct.delete_args_info* %2, %struct.delete_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.delete_args_info*
%8 = alloca %struct.delete_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.delete_args_info* %2, %struct.delete_args_info** %7
store %struct.delete_cmdline_parser_params* %3, %struct.delete_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.delete_args_info*, %struct.delete_args_info** %7
%13 = load %struct.delete_cmdline_parser_params*, %struct.delete_cmdline_parser_params** %8
%14 = call i32 @delete_cmdline_parser_internal(i32 %10, i8** %11, %struct.delete_args_info* %12, %struct.delete_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.delete_args_info = type { i32 }
%struct.delete_cmdline_parser_params = type { i32 }
define i32 @delete_cmdline_parser_ext(i32 %0, i8** %1, %struct.delete_args_info* %2, %struct.delete_cmdline_parser_params* %3) {
%5 = tail call i32 @delete_cmdline_parser_internal(i32 %0, i8** %1, %struct.delete_args_info* %2, %struct.delete_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
void unquote(char *str) {
  char *prev, *s;
  s = prev = str;
  s++;
  while (*s != 0) {
    *prev = *s;
    prev++;
    s++;
  }
  str[prev - str - 1] = 0;
}


x86 assembly (clang, -O0):
<unquote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <unquote+0x59>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <unquote+0x20>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unquote>:
mov    0x1(%rdi),%cl
mov    %rdi,%rax
test   %cl,%cl
je     111e <unquote+0x1e>
mov    %rdi,%rax
nopl   (%rax)
mov    %cl,(%rax)
movzbl 0x2(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <unquote+0x10>
mov    %rdi,%rcx
not    %rcx
add    %rax,%rcx
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define void @unquote(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %3, %1 ]
%7 = phi i8* [ %10, %5 ], [ %2, %1 ]
%8 = phi i8* [ %9, %5 ], [ %0, %1 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i8* [ %0, %1 ], [ %9, %5 ]
%15 = ptrtoint i8* %14 to i64
%16 = ptrtoint i8* %0 to i64
%17 = xor i64 %16, -1
%18 = add i64 %15, %17
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WSramAddr(int);
int /*<<< orphan*/ Wd(int, int);
int /*<<< orphan*/ Ws(char *);
int Winst98(int i, int code) {
  Ws("cbi   ");
  WSramAddr((code >> 3) & 0x1F);
  Ws(", ");
  Wd(code & 7, 1);
  return 0;
}


x86 assembly (clang, -O0):
<Winst98>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x8(%rbp),%edi
sar    $0x3,%edi
and    $0x1f,%edi
call   1040 <WSramAddr@plt>
lea    0xea8(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
mov    $0x1,%esi
call   1050 <Wd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Winst98>:
push   %rbx
mov    %esi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <Ws@plt>
mov    %ebx,%edi
shr    $0x3,%edi
and    $0x1f,%edi
call   1040 <WSramAddr@plt>
lea    0xeb4(%rip),%rdi
call   1030 <Ws@plt>
and    $0x7,%ebx
mov    %ebx,%edi
mov    $0x1,%esi
call   1050 <Wd@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"cbi \00"
@.str.1 = [3 x i8] c", \00"
define i32 @Winst98(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = ashr i32 %6, 3
%8 = and i32 %7, 31
%9 = call i32 @WSramAddr(i32 %8)
%10 = call i32 @Ws(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %4
%12 = and i32 %11, 7
%13 = call i32 @Wd(i32 %12, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"cbi \00"
@.str.1 = [3 x i8] c", \00"
define i32 @Winst98(i32 %0, i32 %1) {
%3 = tail call i32 @Ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = lshr i32 %1, 3
%5 = and i32 %4, 31
%6 = tail call i32 @WSramAddr(i32 %5)
%7 = tail call i32 @Ws(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = and i32 %1, 7
%9 = tail call i32 @Wd(i32 %8, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int read(int /*<<< orphan*/, unsigned char *, int);
int term_get(void) {
  unsigned char c;
  int q;
  if (read(STDIN_FILENO, &c, 1) == 1) {
    q = c;
  } else
    q = -1;
  return q;
}


x86 assembly (clang, -O0):
<term_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1144 <term_get+0x34>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114b <term_get+0x3b>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_get>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @term_get() {
%1 = alloca i8
%2 = load i32, i32* @STDIN_FILENO
%3 = call i32 @read(i32 %2, i8* %1, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int *malloc(int);
void main() {
  int *a, i;
  int n;
  n = 10;
  a = malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    a[i] = 0;
  }
  while (n > 0) {
    *a = 1;
    n--;
    a++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x10(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x29>
jmp    1167 <main+0x57>
cmpl   $0x0,-0x10(%rbp)
jle    1195 <main+0x85>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <main+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x28,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %1
store i32 0, i32* %2
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i32*, i32** %1
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 0, i32* %17
br label %18
18: ; preds = %13
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %9
21: ; preds = %9
br label %22
22: ; preds = %25, %21
%23 = load i32, i32* %3
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %22
%26 = load i32*, i32** %1
store i32 1, i32* %26
%27 = load i32, i32* %3
%28 = add nsw i32 %27, -1
store i32 %28, i32* %3
%29 = load i32*, i32** %1
%30 = getelementptr inbounds i32, i32* %29, i32 1
store i32* %30, i32** %1
br label %22
31: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32* @malloc(i32 40)
ret void
}
double f(double x) { return x * x * x + x - 1; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed3(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
%9 = fsub double %8, 1.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %0)
%4 = fadd double %3, -1.000000e+00
ret double %4
}
int main(void) {
  void substring(const char source[81], int start, int count, char result[81]);
  char result[81];
  substring("character", 4, 3, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rcx
lea    0xed6(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
call   1030 <substring@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
lea    0xee5(%rip),%rdi
mov    %rsp,%rcx
mov    $0x4,%esi
mov    $0x3,%edx
call   1030 <substring@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"character\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"character\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
ret i32 0
}
void ff_hevc_put_hevc_uni_pel_pixels32_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels32_8_avx2() {
ret void
}