xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ ENOENT;
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
scalar_t__ errno;
const char *default_pidfile(void) {
  access("/run", F_OK);
  return (errno == ENOENT) ? "/var/run/qotd.pid" : "/run/qotd.pid";
}


x86 assembly (clang, -O0):
<default_pidfile>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <access@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%rdx
mov    0x2e96(%rip),%rax
mov    (%rax),%rsi
lea    0xec5(%rip),%rax
lea    0xeba(%rip),%rcx
cmp    %rsi,%rdx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_pidfile>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%rax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
lea    0xec4(%rip),%rcx
lea    0xec1(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"/run\00"
@F_OK = global i32 0
@errno = global i64 0
@ENOENT = global i64 0
@.str.1 = [18 x i8] c"/var/run/qotd.pid\00"
@.str.2 = [14 x i8] c"/run/qotd.pid\00"
define i8* @default_pidfile() {
%1 = load i32, i32* @F_OK
%2 = call i32 @access(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i64, i64* @errno
%4 = load i64, i64* @ENOENT
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
ret i8* %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"/run\00"
@F_OK = global i32 0
@errno = global i64 0
@ENOENT = global i64 0
@.str.1 = [18 x i8] c"/var/run/qotd.pid\00"
@.str.2 = [14 x i8] c"/run/qotd.pid\00"
define i8* @default_pidfile() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i64, i64* @errno
%4 = load i64, i64* @ENOENT
%5 = icmp eq i64 %3, %4
%6 = select i1 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
ret i8* %6
}
/* Variables and functions */
char const *cgihttpscriptptr();
char const *cgihttpsscriptptr();
char *getenv(char *);
scalar_t__ strcasecmp(char const *, char *);
const char *cgirelscriptptr() {
  const char *p = getenv("HTTPS");
  if (p && strcasecmp(p, "on") == 0)
    return (cgihttpsscriptptr());
  return (cgihttpscriptptr());
}


x86 assembly (clang, -O0):
<cgirelscriptptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118d <cgirelscriptptr+0x4d>
mov    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    118d <cgirelscriptptr+0x4d>
mov    $0x0,%al
call   1050 <cgihttpsscriptptr@plt>
mov    %rax,-0x8(%rbp)
jmp    1198 <cgirelscriptptr+0x58>
mov    $0x0,%al
call   1060 <cgihttpscriptptr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgirelscriptptr>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1166 <cgirelscriptptr+0x26>
lea    0xead(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     116e <cgirelscriptptr+0x2e>
xor    %eax,%eax
pop    %rcx
jmp    1060 <cgihttpscriptptr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cgihttpsscriptptr@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"HTTPS\00"
@.str.1 = [3 x i8] c"on\00"
define i8* @cgirelscriptptr() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i64 @strcasecmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i8* (...) @cgihttpsscriptptr()
store i8* %11, i8** %1
br label %14
12: ; preds = %6, %0
%13 = call i8* (...) @cgihttpscriptptr()
store i8* %13, i8** %1
br label %14
14: ; preds = %12, %10
%15 = load i8*, i8** %1
ret i8* %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"HTTPS\00"
@.str.1 = [3 x i8] c"on\00"
define i8* @cgirelscriptptr() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i8* (...) @cgihttpsscriptptr()
br label %10
8: ; preds = %3, %0
%9 = tail call i8* (...) @cgihttpscriptptr()
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
const char *get_default_receiver() {
  static const char *default_receiver = "world";
  return default_receiver;
}


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

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

LLVM IR (-O0):
@get_default_receiver.default_receiver = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"world\00"
define i8* @get_default_receiver() {
%1 = load i8*, i8** @get_default_receiver.default_receiver
ret i8* %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
define i8* @get_default_receiver() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int os_getloadavg(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_getloadavg() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "false"
        "\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Usage: false\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [14 x i8] c"Usage: false\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int bbm_read(void *, unsigned short, unsigned char *);
int bbm_com_read(void *handle, unsigned short addr, unsigned char *data) {
  int res;
  res = bbm_read(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <bbm_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_read>:
jmp    1030 <bbm_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_read(i8* %0, i16 zeroext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i8*, i8** %6
%11 = call i32 @bbm_read(i8* %8, i16 zeroext %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_read(i8* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 @bbm_read(i8* %0, i16 zeroext %1, i8* %2)
ret i32 %4
}
char *allocated_variable_expand(line)
char *line;
{ return allocated_variable_expand_for_file(line, (struct file *)0); }


x86 assembly (clang, -O0):
<allocated_variable_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <allocated_variable_expand_for_file@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocated_variable_expand>:
push   %rax
xor    %esi,%esi
xor    %eax,%eax
call   1030 <allocated_variable_expand_for_file@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.file = type opaque
define i8* @allocated_variable_expand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, %struct.file*, ...) bitcast (i32 (...)* @allocated_variable_expand_for_file to i32 (i8*, %struct.file*, ...)*)(i8* %3, %struct.file* null)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
%struct.file = type opaque
define i8* @allocated_variable_expand(i8* %0) {
%2 = tail call i32 (i8*, %struct.file*, ...) bitcast (i32 (...)* @allocated_variable_expand_for_file to i32 (i8*, %struct.file*, ...)*)(i8* %0, %struct.file* null)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void gtk_statusbar_get_context_id() {}


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

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

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

LLVM IR (-O2):
define void @gtk_statusbar_get_context_id() {
ret void
}
sumaDigitos(int numero, int suma) {
  if (numero == 0) {
    return 0;
  } else {
    suma = suma + (numero % 10);
    if (numero / 10 == 0) {
      return suma;
    } else {
      suma = sumaDigitos(numero / 10, suma);
    }
  }
}


x86 assembly (clang, -O0):
<sumaDigitos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1134 <sumaDigitos+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1189 <sumaDigitos+0x79>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    116c <sumaDigitos+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <sumaDigitos+0x79>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <sumaDigitos@plt>
mov    %eax,-0xc(%rbp)
jmp    1189 <sumaDigitos+0x79>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumaDigitos>:
test   %edi,%edi
je     1153 <sumaDigitos+0x53>
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%ecx
mov    %edi,%eax
sub    %ecx,%eax
add    %esi,%eax
lea    0x9(%rdi),%ecx
cmp    $0x13,%ecx
jb     1152 <sumaDigitos+0x52>
xchg   %ax,%ax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1130 <sumaDigitos+0x30>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumaDigitos(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = srem i32 %0, 10
%6 = add nsw i32 %5, %1
%7 = add i32 %0, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %14, label %9
9: ; preds = %4, %9
%10 = phi i32 [ %11, %9 ], [ %0, %4 ]
%11 = sdiv i32 %10, 10
%12 = add nsw i32 %11, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %14, label %9
14: ; preds = %9, %4, %2
%15 = phi i32 [ 0, %2 ], [ %6, %4 ], [ %6, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("#include test\n");
  printf("b\n");
  printf("g\n");
  printf("i\n");
  printf("p\n");
  printf("r\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"#include test\0A\00"
@.str.1 = [3 x i8] c"b\0A\00"
@.str.2 = [3 x i8] c"g\0A\00"
@.str.3 = [3 x i8] c"i\0A\00"
@.str.4 = [3 x i8] c"p\0A\00"
@.str.5 = [3 x i8] c"r\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"#include test\00"
@str.6 = [2 x i8] c"b\00"
@str.7 = [2 x i8] c"g\00"
@str.8 = [2 x i8] c"i\00"
@str.9 = [2 x i8] c"p\00"
@str.10 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}
int g_is_f(float s, float d) { return s != 0; }


x86 assembly (clang, -O0):
<g_is_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_is_f>:
xorps  %xmm1,%xmm1
cmpneqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @g_is_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fcmp une float %5, 0.000000e+00
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @g_is_f(float %0, float %1) {
%3 = fcmp une float %0, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct flock {
  int l_whence;
  int l_type;
  void *l_len;
  void *l_start;
};
typedef void *off_t;

/* Variables and functions */
int fcntl(int, int, struct flock *);
int lock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t len) {
  struct flock lock;
  lock.l_start = offset;
  lock.l_len = len;
  lock.l_whence = whence;
  lock.l_type = type;
  return fcntl(fd, cmd, &lock);
}


x86 assembly (clang, -O0):
<lock_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_reg>:
sub    $0x18,%rsp
mov    %rcx,0x10(%rsp)
mov    %r9,0x8(%rsp)
mov    %r8d,(%rsp)
mov    %edx,0x4(%rsp)
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca %struct.flock
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%14 = load i8*, i8** %10
%15 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 3
store i8* %14, i8** %15
%16 = load i8*, i8** %12
%17 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 2
store i8* %16, i8** %17
%18 = load i32, i32* %11
%19 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 0
store i32 %18, i32* %19
%20 = load i32, i32* %9
%21 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 1
store i32 %20, i32* %21
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @fcntl(i32 %22, i32 %23, %struct.flock* %13)
ret i32 %24
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca %struct.flock
%8 = bitcast %struct.flock* %7 to i8*
%9 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 3
store i8* %3, i8** %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 2
store i8* %5, i8** %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 0
store i32 %4, i32* %11
%12 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 1
store i32 %2, i32* %12
%13 = call i32 @fcntl(i32 %0, i32 %1, %struct.flock* %7)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRAF_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRAF_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRAF_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
u_int16_t get_nxflat16(u_int16_t *addr16) { return ntohs(*addr16); }


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

x86 assembly (clang, -O2):
<get_nxflat16>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @get_nxflat16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ntohs(i32 %2)
ret i32 %3
}
__attribute__((always_)) void enable_nonboot_cpus(void) {}


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

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

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

LLVM IR (-O2):
define void @enable_nonboot_cpus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ T2DLP_errormsg();
int /*<<< orphan*/ assert(int /*<<< orphan*/);
long T2DLP_on() {
  T2DLP_errormsg();
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<T2DLP_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <T2DLP_errormsg@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<T2DLP_on>:
push   %rax
xor    %eax,%eax
call   1040 <T2DLP_errormsg@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @T2DLP_on() {
%1 = call i32 (...) @T2DLP_errormsg()
%2 = call i32 @assert(i32 0)
ret i64 0
}

LLVM IR (-O2):
define i64 @T2DLP_on() {
%1 = tail call i32 (...) @T2DLP_errormsg()
%2 = tail call i32 @assert(i32 0)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int foo(int x) {
  if (x == 3) {
    printf("processing...\n");
    sleep(3);
  } else {
    printf("processing...\n");
    sleep(1);
  }
  return x * x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1150 <foo+0x30>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
jmp    1166 <foo+0x46>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
cmp    $0x3,%edi
sete   %al
lea    0xecc(%rip),%rdi
lea    (%rax,%rax,1),%ebp
add    $0x1,%ebp
call   1030 <puts@plt>
mov    %ebp,%edi
call   1040 <sleep@plt>
imul   %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str.1 = [14 x i8] c"processing...\00"
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 3
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.1, i64 0, i64 0)
%4 = select i1 %2, i32 3, i32 1
%5 = tail call i32 @puts(i8* dereferenceable(1) %3)
%6 = tail call i32 @sleep(i32 %4)
%7 = mul nsw i32 %0, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [-ap] program [...]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s [-ap] program [...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s [-ap] program [...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, double);
void q(char *str, double x) { printf("%s: %f\n", str, x); }


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

x86 assembly (clang, -O2):
<q>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %f\0A\00"
define void @q(i8* %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FiveFunction();
int /*<<< orphan*/ TwoFunction();
void SixAFunction() {
  FiveFunction();
  TwoFunction();
}


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

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

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

LLVM IR (-O2):
define void @SixAFunction() {
%1 = tail call i32 (...) @FiveFunction()
%2 = tail call i32 (...) @TwoFunction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ht_inc_cnt_valid(int, int);
int /*<<< orphan*/ lock_spinner();
int /*<<< orphan*/ unlock_spinner();
void count_valid(int numdate) {
  lock_spinner();
  ht_inc_cnt_valid(numdate, 1);
  unlock_spinner();
}


x86 assembly (clang, -O0):
<count_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <lock_spinner@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <ht_inc_cnt_valid@plt>
mov    $0x0,%al
call   1030 <unlock_spinner@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_valid>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <lock_spinner@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <ht_inc_cnt_valid@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <unlock_spinner@plt>

LLVM IR (-O0):
define void @count_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @lock_spinner()
%4 = load i32, i32* %2
%5 = call i32 @ht_inc_cnt_valid(i32 %4, i32 1)
%6 = call i32 (...) @unlock_spinner()
ret void
}

LLVM IR (-O2):
define void @count_valid(i32 %0) {
%2 = tail call i32 (...) @lock_spinner()
%3 = tail call i32 @ht_inc_cnt_valid(i32 %0, i32 1)
%4 = tail call i32 (...) @unlock_spinner()
ret void
}
long __syscall6(long num, long arg1, long arg2, long arg3, long arg4, long arg5,
                long arg6) {
  unsigned long result;
  register long r10 asm("r10") = arg4;
  register long r8 asm("r8") = arg5;
  register long r9 asm("r9") = arg6;
  asm volatile("syscall"
               : "=a"(result)
               : "a"(num), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8),
                 "r"(r9)
               : "memory", "rcx", "r11");
  return result;
}


x86 assembly (clang, -O0):
<__syscall6>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%r8
mov    -0x50(%rbp),%r9
syscall
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall6>:
mov    %r9,%r11
mov    %rdi,%rax
mov    0x8(%rsp),%r9
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
mov    %r11,%r8
syscall
ret

LLVM IR (-O0):
define i64 @__syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%19 = load i64, i64* %12
store i64 %19, i64* %16
%20 = load i64, i64* %13
store i64 %20, i64* %17
%21 = load i64, i64* %14
store i64 %21, i64* %18
%22 = load i64, i64* %8
%23 = load i64, i64* %9
%24 = load i64, i64* %10
%25 = load i64, i64* %11
%26 = load i64, i64* %16
%27 = load i64, i64* %17
%28 = load i64, i64* %18
%29 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},{r8},{r9},~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %22, i64 %23, i64 %24, i64 %25, i64 %26, i64 %27, i64 %28)
store i64 %29, i64* %15
%30 = load i64, i64* %15
ret i64 %30
}

LLVM IR (-O2):
define i64 @__syscall6(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},{r8},{r9},~{memory},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
/* Variables and functions */
int dup2(int, int);
int main(int argc, const char *argv[]) {
  int d = 1;
  return (dup2(d, d) != -1 ? 0 : 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <dup2@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @dup2(i32 %7, i32 %8)
%10 = icmp ne i32 %9, -1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @dup2(i32 1, i32 1)
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char const *sev_to_string(int);
const char *log_level_to_string(int level) { return sev_to_string(level); }


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

x86 assembly (clang, -O2):
<log_level_to_string>:
jmp    1030 <sev_to_string@plt>

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

LLVM IR (-O2):
define i8* @log_level_to_string(i32 %0) {
%2 = tail call i8* @sev_to_string(i32 %0)
ret i8* %2
}
/* Variables and functions */
int GetInt(char *);
int /*<<< orphan*/ SimpleChangeInt(int);
int /*<<< orphan*/ printf(char *, int);
void Ex5_Pointers() {
  int a = GetInt("Give input: ");
  SimpleChangeInt(a);
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<Ex5_Pointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <GetInt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <SimpleChangeInt@plt>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ex5_Pointers>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <GetInt@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <SimpleChangeInt@plt>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Give input: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @Ex5_Pointers() {
%1 = tail call i32 @GetInt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @SimpleChangeInt(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int impresao;
  printf("Digite um valor");
  scanf("%d", &impresao);
  printf("O valor é: %d", impresao);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Digite um valor\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"O valor \C3\A9: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Digite um valor\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"O valor \C3\A9: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
bool is_leapyear(int year) {
  return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
}


x86 assembly (clang, -O0):
<is_leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <is_leapyear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leapyear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leapyear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leapyear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leapyear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
double mapVal(double x, double in_min, double in_max, double out_min,
              double out_max) {
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}


x86 assembly (clang, -O0):
<mapVal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapVal>:
subsd  %xmm1,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @mapVal(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %10
%15 = load double, double* %9
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %8
%19 = load double, double* %7
%20 = fsub double %18, %19
%21 = fdiv double %17, %20
%22 = load double, double* %9
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @mapVal(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %4, %3
%8 = fmul double %6, %7
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
%11 = fadd double %10, %3
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stdout;
void print_json_exit(int proc_pid, int proc_tgid, int exit_code) {
  fprintf(stdout,
          "{\"type\": \"exit\" \"pid\": %d, \"tgid\": %d, "
          "\"exit_code\": %d}\n",
          proc_pid, proc_tgid, exit_code);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_json_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_json_exit>:
push   %rbx
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eb1(%rip),%rbx
mov    (%rbx),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [57 x i8] c"{\22type\22: \22exit\22 \22pid\22: %d, \22tgid\22: %d, \22exit_code\22: %d}\0A\00"
define void @print_json_exit(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* @stdout
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [57 x i8] c"{\22type\22: \22exit\22 \22pid\22: %d, \22tgid\22: %d, \22exit_code\22: %d}\0A\00"
define void @print_json_exit(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ chkBadRdir(char *);
int /*<<< orphan*/ printf(char *);
void rdirParser(char *str) {
  if (chkBadRdir(str)) {
    printf("error:bad redirection.\n");
  } else {
  }
}


x86 assembly (clang, -O0):
<rdirParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <chkBadRdir@plt>
cmp    $0x0,%rax
je     1150 <rdirParser+0x30>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <rdirParser+0x35>
jmp    1155 <rdirParser+0x35>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdirParser>:
push   %rax
call   1040 <chkBadRdir@plt>
test   %rax,%rax
je     1138 <rdirParser+0x18>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"error:bad redirection.\0A\00"
define void @rdirParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @chkBadRdir(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"error:bad redirection.\00"
define void @rdirParser(i8* %0) {
%2 = tail call i64 @chkBadRdir(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
scalar_t__ isEmptyDynArr(struct DynArr *);
int /*<<< orphan*/ popDynArr(struct DynArr *);
double pow(double, int);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void square(struct DynArr *stack) {
  double a, c;
  if (isEmptyDynArr(stack))
    return;
  a = topDynArr(stack);
  popDynArr(stack);
  c = pow(a, 2);
  pushDynArr(stack, c);
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isEmptyDynArr@plt>
cmp    $0x0,%rax
je     1174 <square+0x24>
jmp    11ad <square+0x5d>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1070 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <isEmptyDynArr@plt>
test   %rax,%rax
je     1168 <square+0x18>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1070 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @square(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call i64 @isEmptyDynArr(%struct.DynArr* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %19
9: ; preds = %1
%10 = load %struct.DynArr*, %struct.DynArr** %2
%11 = call double @topDynArr(%struct.DynArr* %10)
store double %11, double* %3
%12 = load %struct.DynArr*, %struct.DynArr** %2
%13 = call i32 @popDynArr(%struct.DynArr* %12)
%14 = load double, double* %3
%15 = call double @pow(double %14, i32 2)
store double %15, double* %4
%16 = load %struct.DynArr*, %struct.DynArr** %2
%17 = load double, double* %4
%18 = call i32 @pushDynArr(%struct.DynArr* %16, double %17)
br label %19
19: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @square(%struct.DynArr* %0) {
%2 = tail call i64 @isEmptyDynArr(%struct.DynArr* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call double @topDynArr(%struct.DynArr* %0)
%6 = tail call i32 @popDynArr(%struct.DynArr* %0)
%7 = tail call double @pow(double %5, i32 2)
%8 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %7)
br label %9
9: ; preds = %1, %4
ret void
}
/* Variables and functions */
int bfin_read_SICB_SYSCR();
int /*<<< orphan*/ bfin_write_SICB_SYSCR(int);
void bfin_coreb_reset(void) {
  bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | 0x0080);
}


x86 assembly (clang, -O0):
<bfin_coreb_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bfin_read_SICB_SYSCR@plt>
mov    %eax,%edi
or     $0x80,%edi
call   1040 <bfin_write_SICB_SYSCR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfin_coreb_reset>:
push   %rax
xor    %eax,%eax
call   1030 <bfin_read_SICB_SYSCR@plt>
or     $0x80,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <bfin_write_SICB_SYSCR@plt>

LLVM IR (-O0):
define void @bfin_coreb_reset() {
%1 = call i32 (...) @bfin_read_SICB_SYSCR()
%2 = or i32 %1, 128
%3 = call i32 @bfin_write_SICB_SYSCR(i32 %2)
ret void
}

LLVM IR (-O2):
define void @bfin_coreb_reset() {
%1 = tail call i32 (...) @bfin_read_SICB_SYSCR()
%2 = or i32 %1, 128
%3 = tail call i32 @bfin_write_SICB_SYSCR(i32 %2)
ret void
}