xunge/DecIR huggingface dataset:
double zero(double x, double y, double t) { return 0; }


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @zero(double %0, double %1, double %2) {
ret double 0.000000e+00
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int termwidth(void) {
  struct winsize ws;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
  return ws.ws_col;
}


x86 assembly (clang, -O0):
<termwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termwidth>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @termwidth() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @termwidth() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
void align_free(void *ptr) {
  char *src = (char *)ptr - sizeof(char *);
  free(*(char **)src);
}


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

x86 assembly (clang, -O2):
<align_free>:
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @align_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -8
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @align_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void err_SimpleMessage(char *message) { fprintf(stderr, "%s\n", message); }


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

x86 assembly (clang, -O2):
<err_SimpleMessage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @err_SimpleMessage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int Output_Consumer(const void *pOutput, unsigned int nOutputLen,
                    void *pUserData) {
  printf("%.*s", nOutputLen, (const char *)pOutput);
  return 0;
}


x86 assembly (clang, -O0):
<Output_Consumer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Output_Consumer>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.*s\00"
define i32 @Output_Consumer(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIOCSIFDSTADDR;
int /*<<< orphan*/ do_ip_set(char *, int /*<<< orphan*/, char *);
void do_ip_dst_set(char *p) { do_ip_set(p, SIOCSIFDSTADDR, "destination"); }


x86 assembly (clang, -O0):
<do_ip_dst_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdx
call   1030 <do_ip_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ip_dst_set>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdx
jmp    1030 <do_ip_set@plt>

LLVM IR (-O0):
@SIOCSIFDSTADDR = global i32 0
@.str = [12 x i8] c"destination\00"
define void @do_ip_dst_set(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @SIOCSIFDSTADDR
%5 = call i32 @do_ip_set(i8* %3, i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIOCSIFDSTADDR = global i32 0
@.str = [12 x i8] c"destination\00"
define void @do_ip_dst_set(i8* %0) {
%2 = load i32, i32* @SIOCSIFDSTADDR
%3 = tail call i32 @do_ip_set(i8* %0, i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void gui_print_overwrite(const char *fmt, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @gui_print_overwrite(i8* nocapture %0, ...) {
ret void
}
void util_ParentDeathSigIfAvail(int signo __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @util_ParentDeathSigIfAvail(i32 %0) {
ret void
}
void IOCONFIG(char *S) { ; }


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

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

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

LLVM IR (-O2):
define void @IOCONFIG(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int val1 = 0B00000001;
  int val2 = 0b00000010;
  int total = val1 + val2;
  int val3 = 0xF;
  int val4 = 0b00001111;
  printf("%d + %d = %d\n", val1, val2, total);
  if (val3 == val4)
    printf("They are both %d\n", val4);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1178 <main+0x68>
mov    -0x18(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [18 x i8] c"They are both %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 15)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int __mount50(char const *, char const *, int, void *, int /*<<< orphan*/);
int mount(const char *type, const char *dir, int flags, void *data) {
  return __mount50(type, dir, flags, data, 0) == -1 ? -1 : 0;
}


x86 assembly (clang, -O0):
<mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <__mount50@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount>:
push   %rax
xor    %r8d,%r8d
call   1030 <__mount50@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mount(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @__mount50(i8* %9, i8* %10, i32 %11, i8* %12, i32 0)
%14 = icmp eq i32 %13, -1
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -1, i32 0
ret i32 %16
}

LLVM IR (-O2):
define i32 @mount(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @__mount50(i8* %0, i8* %1, i32 %2, i8* %3, i32 0)
%6 = icmp eq i32 %5, -1
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_unblock_sigs() {
  printf("NOT IMPLEMENTED:"
         "pa_unblock_sigs"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_unblock_sigs\00"
define i32 @pa_unblock_sigs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int custom_rand_generate(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @custom_rand_generate() {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int main(int argc, char *argv[]) {
  printf("%s\n", "Test Lexer:");
  test1();
  test2();
  test3();
  printf("%s\n", "Test Lexer: OK!");
  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)
lea    0xea3(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
lea    0xe7b(%rip),%rdi
lea    0xe84(%rip),%rsi
call   1050 <printf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1030 <test3@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Test Lexer:\00"
@.str.2 = [16 x i8] c"Test Lexer: OK!\00"
@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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @test1()
%8 = call i32 (...) @test2()
%9 = call i32 (...) @test3()
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Test Lexer:\00"
@.str.2 = [16 x i8] c"Test Lexer: OK!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @test1()
%5 = tail call i32 (...) @test2()
%6 = tail call i32 (...) @test3()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
void lw6sys_signal_fpe_handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @lw6sys_signal_fpe_handler(i32 %0) {
ret void
}
/* Variables and functions */
int nondet(int /*<<< orphan*/, int);
int main() {
  int i = nondet(0, 5);
  int j = 0;
  while (j < 10) {
    i = i + j;
    j = j + 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x5,%esi
call   1030 <nondet@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1156 <main+0x46>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @nondet(i32 0, i32 5)
%2 = add i32 %1, 45
ret i32 %2
}
short test_45_2(short *mem) { return __atomic_fetch_sub(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_45_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%ax
neg    %ax
lock xadd %ax,0x8(%rcx)
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_45_2>:
mov    $0xffff,%ax
lock xadd %ax,0x8(%rdi)
ret

LLVM IR (-O0):
define signext i16 @test_45_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 4
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw sub i16* %6, i16 %7 acq_rel
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @test_45_2(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 4
%3 = atomicrmw sub i16* %2, i16 1 acq_rel
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_join(pthread_t __th, void **__thread_return) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_join(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void GPMCWaitPinSelect(unsigned int baseAddr, unsigned int csNum,
                       unsigned int waitPin) {
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) &=
      ~(0x00030000u);
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) |=
      ((waitPin << (0x00000010u)) & (0x00030000u));
}


x86 assembly (clang, -O0):
<GPMCWaitPinSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffcffff,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x10,%edx
and    $0x30000,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCWaitPinSelect>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x60,%eax
andl   $0xfffcffff,(%rax)
and    $0x3,%edx
shl    $0x10,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCWaitPinSelect(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* %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 96, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -196609
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 16
%18 = and i32 %17, 196608
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 96, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCWaitPinSelect(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 96
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -196609
store volatile i32 %10, i32* %8
%11 = shl i32 %2, 16
%12 = and i32 %11, 196608
%13 = load volatile i32, i32* %8
%14 = or i32 %13, %12
store volatile i32 %14, i32* %8
ret void
}
int test_imm_A0int8_reg(signed char val) {
  return ((val) & (-0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff60,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A0int8_reg>:
test   $0xffffff60,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A0int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -160
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ puts(char const *);
void __attribute__((noreturn)) panic(const char *msg) {
  puts(msg);
  delay(100000000);
  abort();
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
mov    $0x5f5e100,%edi
call   1050 <delay@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
call   1040 <puts@plt>
mov    $0x5f5e100,%edi
call   1050 <delay@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @delay(i32 100000000)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @panic(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @delay(i32 100000000)
%4 = tail call i32 (...) @abort()
unreachable
}
int fun1188() { return 1188; }


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

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

LLVM IR (-O0):
define i32 @fun1188() {
ret i32 1188
}

LLVM IR (-O2):
define i32 @fun1188() {
ret i32 1188
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float r, pi;
  pi = 3.14159;
  printf("Ingrese el radio del circulo: ");
  scanf("%f", &r);
  printf("El area del circulo es %.4f unidades\n", (pi * r * r));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  0xeb2(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Ingrese el radio del circulo: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [38 x i8] c"El area del circulo es %.4f unidades\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x400921FA00000000, float* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %3
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = load float, float* %2
%10 = fmul float %8, %9
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Ingrese el radio del circulo: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [38 x i8] c"El area del circulo es %.4f unidades\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 0x400921FA00000000
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read(int, char *, int);
__attribute__((no)) void urandom_read(int fd, int count) {
  char buf[256];
  int i;
  for (i = 0; i < count; ++i)
    read(fd, buf, 256);
}


x86 assembly (clang, -O0):
<urandom_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <urandom_read+0x52>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1030 <read@plt>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    112b <urandom_read+0x1b>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<urandom_read>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
test   %esi,%esi
jle    1144 <urandom_read+0x34>
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   1030 <read@plt>
add    $0xffffffff,%ebx
jne    1130 <urandom_read+0x20>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @urandom_read(i32 %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = call i32 @read(i32 %0, i8* %4, i32 256)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stdout;
void sysError(const char *err, const char *detail) {
  fprintf(stdout, err);
  fprintf(stdout, ": ");
  fprintf(stdout, detail);
  fprintf(stdout, "\n");
  exit(2);
}


x86 assembly (clang, -O0):
<sysError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sysError>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rsi
mov    0x2eaf(%rip),%rbx
mov    (%rbx),%edi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c": \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @sysError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdout
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32 %10, i8* %11)
%13 = load i32, i32* @stdout
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c": \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @sysError(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* %1)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ do_log(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ exit(int);
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void close_on_exec(int fd) {
  if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
    do_log(LOG_ERR, "can't set fd %d to close on exec: %m", fd);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<close_on_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1180 <close_on_exec+0x50>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe8f(%rip),%rsi
call   1040 <do_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_on_exec>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1151 <close_on_exec+0x21>
pop    %rbx
ret
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %ebx,%edx
call   1040 <do_log@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@LOG_ERR = global i32 0
@.str = [37 x i8] c"can't set fd %d to close on exec: %m\00"
define void @close_on_exec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFD
%5 = load i32, i32* @FD_CLOEXEC
%6 = call i32 @fcntl(i32 %3, i32 %4, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @LOG_ERR
%10 = load i32, i32* %2
%11 = call i32 @do_log(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@LOG_ERR = global i32 0
@.str = [37 x i8] c"can't set fd %d to close on exec: %m\00"
define void @close_on_exec(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = load i32, i32* @FD_CLOEXEC
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @LOG_ERR
%8 = tail call i32 @do_log(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}
int pathconN_nm7_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 1;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pathconN_nm7_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <pathconN_nm7_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <pathconN_nm7_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <pathconN_nm7_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <pathconN_nm7_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm7_work>:
test   %rdi,%rdi
je     110b <pathconN_nm7_work+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <pathconN_nm7_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <pathconN_nm7_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <pathconN_nm7_work+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pathconN_nm7_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 1, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
void xTimerIntDisable(unsigned long ulBase, unsigned long ulChannel,
                      unsigned long ulIntFlags) {

  ;
  if (ulIntFlags == 0x00000001) {
    (*((volatile unsigned long *)(ulBase + 0x0000000C))) &= ~ulIntFlags;
  } else {
    (*((volatile unsigned long *)(ulBase + 0x0000000C))) &=
        ~(ulIntFlags & (0x00000002 << (ulChannel - 1)));
  }
}


x86 assembly (clang, -O0):
<xTimerIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    1137 <xTimerIntDisable+0x37>
mov    -0x18(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0xc(%rax)
jmp    1164 <xTimerIntDisable+0x64>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %eax,%ecx
mov    $0x2,%eax
shl    %cl,%eax
cltq
and    %rax,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xTimerIntDisable>:
mov    $0xfffffffffffffffe,%rax
cmp    $0x1,%rdx
je     1122 <xTimerIntDisable+0x22>
add    $0xff,%sil
mov    $0x2,%eax
mov    %esi,%ecx
shl    %cl,%eax
cltq
and    %rdx,%rax
not    %rax
and    %rax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @xTimerIntDisable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i64, i64* %6
%11 = xor i64 %10, -1
%12 = load i64, i64* %4
%13 = add i64 %12, 12
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, %11
store volatile i64 %16, i64* %14
br label %31
17: ; preds = %3
%18 = load i64, i64* %6
%19 = load i64, i64* %5
%20 = sub i64 %19, 1
%21 = trunc i64 %20 to i32
%22 = shl i32 2, %21
%23 = sext i32 %22 to i64
%24 = and i64 %18, %23
%25 = xor i64 %24, -1
%26 = load i64, i64* %4
%27 = add i64 %26, 12
%28 = inttoptr i64 %27 to i64*
%29 = load volatile i64, i64* %28
%30 = and i64 %29, %25
store volatile i64 %30, i64* %28
br label %31
31: ; preds = %17, %9
ret void
}

LLVM IR (-O2):
define void @xTimerIntDisable(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 1
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = trunc i64 %1 to i32
%7 = add i32 %6, -1
%8 = shl i32 2, %7
%9 = sext i32 %8 to i64
%10 = and i64 %9, %2
%11 = xor i64 %10, -1
br label %12
12: ; preds = %3, %5
%13 = phi i64 [ %11, %5 ], [ -2, %3 ]
%14 = add i64 %0, 12
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = and i64 %16, %13
store volatile i64 %17, i64* %15
ret void
}
void skip_char(char sc, char **buf) {
  char *ptr = *buf;
  while (*ptr == sc)
    ptr++;
  *buf = ptr;
}


x86 assembly (clang, -O0):
<skip_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    113d <skip_char+0x3d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1119 <skip_char+0x19>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_char>:
mov    (%rsi),%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
cmp    %dil,0x1(%rcx)
je     1110 <skip_char+0x10>
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @skip_char(i8 signext %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %3, %2 ], [ %8, %4 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %0
%8 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %7, label %4, label %9
9: ; preds = %4
store i8* %5, i8** %1
ret void
}
void dfu_init() {}


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

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

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

LLVM IR (-O2):
define void @dfu_init() {
ret void
}
int test_imm_1Dint64_lowword_mem(long long *val) {
  return ((*val) & (0x1D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Dint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 29
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void fun(int (*fn)(int)) {
  int result;
  result = (*fn)(5);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
call   *-0x8(%rbp)
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    %rdi,%rax
mov    $0x5,%edi
jmp    *%rax

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

LLVM IR (-O2):
define void @fun(i32 (i32)* nocapture %0) {
%2 = tail call i32 %0(i32 5)
ret void
}
int s8l(int a, int b) { return a * 8 + b; }


x86 assembly (clang, -O0):
<s8l>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s8l>:
lea    (%rsi,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @s8l(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 = mul nsw i32 %5, 8
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @s8l(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 3
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
scalar_t__ time(int /*<<< orphan*/ *);
void test_time(void) {
  time_t tval;
  printf("test_time: entered\n");
  tval = time(NULL);
  fprintf(stderr, "# current time is %d \n", (int)tval);
  printf("test_time: leaving\n");
}


x86 assembly (clang, -O0):
<test_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_time>:
push   %rax
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    0x2e95(%rip),%rcx
mov    (%rcx),%edi
lea    0xeac(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"test_time: entered\0A\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"# current time is %d \0A\00"
@.str.2 = [20 x i8] c"test_time: leaving\0A\00"
define void @test_time() {
%1 = alloca i64
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = load i32, i32* @stderr
%5 = load i64, i64* %1
%6 = trunc i64 %5 to i32
%7 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [23 x i8] c"# current time is %d \0A\00"
@str = [19 x i8] c"test_time: entered\00"
@str.3 = [19 x i8] c"test_time: leaving\00"
define void @test_time() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 @time(i32* null)
%3 = load i32, i32* @stderr
%4 = trunc i64 %2 to i32
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello Tia!!"); }


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

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

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

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

/* Variables and functions */
int tolower(int);
int tolower_l(int c, locale_t l) { return tolower(c); }


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

x86 assembly (clang, -O2):
<tolower_l>:
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @tolower_l(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 = call i32 @tolower(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @tolower_l(i32 %0, i32 %1) {
%3 = tail call i32 @tolower(i32 %0)
ret i32 %3
}