xunge/DecIR huggingface dataset:
/* Type definitions */
struct PdSocket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct PdSocket *);
void free_(struct PdSocket *sock) {
  if (NULL != sock) {
    free(sock);
  }
}


x86 assembly (clang, -O0):
<free_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1131 <free_+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_>:
test   %rdi,%rdi
je     111a <free_+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.PdSocket = type { i32 }
define void @free_(%struct.PdSocket* %0) {
%2 = icmp eq %struct.PdSocket* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.PdSocket* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enprintf(int, char *);
char *strndup(char const *, size_t);
char *enstrndup(int status, const char *s, size_t n) {
  char *p;
  p = strndup(s, n);
  if (!p)
    enprintf(status, "strndup: out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<enstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strndup@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <enstrndup+0x3e>
mov    -0x4(%rbp),%edi
lea    0xea7(%rip),%rsi
call   1040 <enprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enstrndup>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strndup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <enstrndup+0x26>
lea    0xec1(%rip),%rsi
mov    %ebp,%edi
call   1040 <enprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"strndup: out of memory\0A\00"
define i8* @enstrndup(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @strndup(i8* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %16, label %13
13: ; preds = %3
%14 = load i32, i32* %4
%15 = call i32 @enprintf(i32 %14, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %3
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@.str = [24 x i8] c"strndup: out of memory\0A\00"
define noalias i8* @enstrndup(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @strndup(i8* %1, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @enprintf(i32 %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ primary_reference();
int /*<<< orphan*/ printf(char *);
void plugin_func(void) {
  printf("INFO: Calling plugin function.\n");
  primary_reference();
}


x86 assembly (clang, -O0):
<plugin_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <primary_reference@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <primary_reference@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"INFO: Calling plugin function.\0A\00"
define void @plugin_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @primary_reference()
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"INFO: Calling plugin function.\00"
define void @plugin_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @primary_reference()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ test_read_mountpoints();
int main() {
  if (test_read_mountpoints()) {
    printf("test_read_mountpoints failed\n");
    return -1;
  } else {
    printf("test_read_mountpoints passed\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_read_mountpoints@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <main+0x4b>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <test_read_mountpoints@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xec9(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
neg    %ebx
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [29 x i8] c"test_read_mountpoints passed\00"
@str.2 = [29 x i8] c"test_read_mountpoints failed\00"
define i32 @main() {
%1 = tail call i64 (...) @test_read_mountpoints()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0)
%4 = xor i1 %2, true
%5 = sext i1 %4 to i32
%6 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %5
}
int eh_valido(int n, char *p) {
  int i;
  for (i = 0; i < n; i++) {
    if (p[i] > 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<eh_valido>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1152 <eh_valido+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jle    113f <eh_valido+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1159 <eh_valido+0x59>
jmp    1144 <eh_valido+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <eh_valido+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eh_valido>:
mov    $0x1,%eax
test   %edi,%edi
jle    111f <eh_valido+0x1f>
mov    %edi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x0,(%rsi,%rdx,1)
jg     1120 <eh_valido+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <eh_valido+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @eh_valido(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp sgt i8 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
int tcpgate_main(int, char **);
int main(int argc, char **argv) { return tcpgate_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <tcpgate_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <tcpgate_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @tcpgate_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @tcpgate_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
void *mempbrkm(char const *, size_t, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void *mempbrk(const char *data, size_t len, const char *accept) {
  return mempbrkm(data, len, accept, strlen(accept));
}


x86 assembly (clang, -O0):
<mempbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1030 <mempbrkm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempbrk>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <mempbrkm@plt>

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

LLVM IR (-O2):
define i8* @mempbrk(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i8* @mempbrkm(i8* %0, i64 %1, i8* %2, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int DMOpenDevFile() {
  int devFile;
  if ((devFile = open("/dev/i2c-1", O_RDWR)) < 0) {
    return -1;
  }
  return devFile;
}


x86 assembly (clang, -O0):
<DMOpenDevFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1145 <DMOpenDevFile+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <DMOpenDevFile+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMOpenDevFile>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <open@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/i2c-1\00"
@O_RDWR = global i32 0
define i32 @DMOpenDevFile() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/i2c-1\00"
@O_RDWR = global i32 0
define i32 @DMOpenDevFile() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
/* Variables and functions */
bool is_full() { return false; }


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

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

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

LLVM IR (-O2):
define i32 @is_full() {
ret i32 0
}
int stack_storage_def(void) { return (32); }


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

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

LLVM IR (-O0):
define i32 @stack_storage_def() {
ret i32 32
}

LLVM IR (-O2):
define i32 @stack_storage_def() {
ret i32 32
}
struct s9 {
  int a;
  int b;
  int : 0;
} f9(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f9+0x9>
jmp    1109 <f9+0x9>

x86 assembly (clang, -O2):
<f9>:
jmp    1100 <f9>

LLVM IR (-O0):
define i64 @f9() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i64 @f9() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int helperPrimitiveBlockClosure_ValueWithArguments(int, int *, int);
int primitiveBlockClosure_Value_(int receiver, int *arguments) {
  return helperPrimitiveBlockClosure_ValueWithArguments(receiver, arguments, 1);
}


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

x86 assembly (clang, -O2):
<primitiveBlockClosure_Value_>:
mov    $0x1,%edx
jmp    1030 <helperPrimitiveBlockClosure_ValueWithArguments@plt>

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

LLVM IR (-O2):
define i32 @primitiveBlockClosure_Value_(i32 %0, i32* %1) {
%3 = tail call i32 @helperPrimitiveBlockClosure_ValueWithArguments(i32 %0, i32* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ BootComCheckActivationRequest();
int /*<<< orphan*/ BootComInit();
int /*<<< orphan*/ Init();
int /*<<< orphan*/ LedToggle();
void main(void) {
  Init();
  BootComInit();
  while (1) {
    LedToggle();
    BootComCheckActivationRequest();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <Init@plt>
mov    $0x0,%al
call   1040 <BootComInit@plt>
mov    $0x0,%al
call   1030 <LedToggle@plt>
mov    $0x0,%al
call   1060 <BootComCheckActivationRequest@plt>
jmp    1152 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <Init@plt>
xor    %eax,%eax
call   1040 <BootComInit@plt>
nop
xor    %eax,%eax
call   1030 <LedToggle@plt>
xor    %eax,%eax
call   1060 <BootComCheckActivationRequest@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @Init()
%2 = call i32 (...) @BootComInit()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @LedToggle()
%5 = call i32 (...) @BootComCheckActivationRequest()
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @Init()
%2 = tail call i32 (...) @BootComInit()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @LedToggle()
%5 = tail call i32 (...) @BootComCheckActivationRequest()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void jet_sleep(int t) { usleep(t * 1000); }


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

x86 assembly (clang, -O2):
<jet_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @jet_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int ft_n_count(unsigned long int n, int i) {
  while (n > 9) {
    i++;
    n /= 10;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_n_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x9,-0x8(%rbp)
jbe    1136 <ft_n_count+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    110b <ft_n_count+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_n_count>:
cmp    $0xa,%rdi
jb     1126 <ft_n_count+0x26>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
add    $0x1,%esi
mov    %rdi,%rax
mul    %rcx
shr    $0x3,%rdx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1110 <ft_n_count+0x10>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_n_count(i64 %0, i32 %1) {
%3 = icmp ugt i64 %0, 9
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, 1
%8 = udiv i64 %6, 10
%9 = icmp ugt i64 %6, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ %1, %2 ], [ %7, %4 ]
ret i32 %11
}
/* Variables and functions */
int *func_ret_null();
void func_bad() {
  int *p = func_ret_null();
  *p += 1;
}


x86 assembly (clang, -O0):
<func_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <func_ret_null@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_bad>:
push   %rax
xor    %eax,%eax
call   1030 <func_ret_null@plt>
addl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @func_bad() {
%1 = alloca i32*
%2 = call i32* (...) @func_ret_null()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @func_bad() {
%1 = tail call i32* (...) @func_ret_null()
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int /*<<< orphan*/ set_args(int, char **);
int /*<<< orphan*/ store_exe_path(char *);
int main(int argc, char *argv[]) {
  store_exe_path(argv[0]);
  set_args(argc, argv);
  MAIN__();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <store_exe_path@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <set_args@plt>
mov    $0x0,%al
call   1030 <MAIN__@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
call   1050 <store_exe_path@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <set_args@plt>
xor    %eax,%eax
call   1030 <MAIN__@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @store_exe_path(i8* %8)
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @set_args(i32 %10, i8** %11)
%13 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @store_exe_path(i8* %3)
%5 = tail call i32 @set_args(i32 %0, i8** %1)
%6 = tail call i32 (...) @MAIN__()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LibUsefulSetValue(char *, char *);
void HTTPSetUserAgent(char *AgentName) {
  LibUsefulSetValue("HTTP:User-Agent", AgentName);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"HTTP:User-Agent\00"
define void @HTTPSetUserAgent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @LibUsefulSetValue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"HTTP:User-Agent\00"
define void @HTTPSetUserAgent(i8* %0) {
%2 = tail call i32 @LibUsefulSetValue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int current_setting(char *);
int current_mptcp() {
  return current_setting("/proc/sys/net/mptcp/mptcp_enabled");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @current_mptcp() {
%1 = call i32 @current_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @current_mptcp() {
%1 = tail call i32 @current_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void dfn_ap(void *p) {}


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

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

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

LLVM IR (-O2):
define void @dfn_ap(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NumericalDifferantiation(double);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void TestNumericalDifferantiation() {
  printf("Numerical Diff for x = 1, %lf (Must be 16326.8 theoretically)\n",
         NumericalDifferantiation(1.0));
}


x86 assembly (clang, -O0):
<TestNumericalDifferantiation>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
call   1040 <NumericalDifferantiation@plt>
mov    %eax,%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestNumericalDifferantiation>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <NumericalDifferantiation@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Numerical Diff for x = 1, %lf (Must be 16326.8 theoretically)\0A\00"
define void @TestNumericalDifferantiation() {
%1 = call i32 @NumericalDifferantiation(double 1.000000e+00)
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"Numerical Diff for x = 1, %lf (Must be 16326.8 theoretically)\0A\00"
define void @TestNumericalDifferantiation() {
%1 = tail call i32 @NumericalDifferantiation(double 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int square_root(int);
int main() {
  int answer;
  printf("%d\n", square_root(answer));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1040 <square_root@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @square_root(i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
char *strbld(char *dest, char const *src) {
  while ((*dest = *src++)) {
    dest++;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strbld>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     113c <strbld+0x3c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strbld+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbld>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     1122 <strbld+0x22>
add    $0x1,%rsi
nop
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strbld+0x10>
ret

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

LLVM IR (-O2):
define i8* @strbld(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void stampa_targhet(int i) {
  if (i == -1) {
    puts("\nil targhet non e' stato trovato\n");
  } else {
    printf("\nil targhet e' nella posizione della riga: %d\n", i);
  }
  return;
}


x86 assembly (clang, -O0):
<stampa_targhet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1146 <stampa_targhet+0x26>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
jmp    1155 <stampa_targhet+0x35>
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stampa_targhet>:
cmp    $0xffffffff,%edi
je     1133 <stampa_targhet+0x13>
mov    %edi,%esi
lea    0xef4(%rip),%rdi
jmp    1040 <printf@plt>
lea    0xec6(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0Ail targhet non e' stato trovato\0A\00"
@.str.1 = [47 x i8] c"\0Ail targhet e' nella posizione della riga: %d\0A\00"
define void @stampa_targhet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0Ail targhet non e' stato trovato\0A\00"
@.str.1 = [47 x i8] c"\0Ail targhet e' nella posizione della riga: %d\0A\00"
define void @stampa_targhet(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  if (0) {
    puts("msvc");
  }
  if (0) {
    puts("clang");
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void WriteLong(unsigned char *p, unsigned long v) {
  p[3] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[2] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[1] = (unsigned char)(v & 0xFF);
  v >>= 8;
  p[0] = (unsigned char)v;
}


x86 assembly (clang, -O0):
<WriteLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLong>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @WriteLong(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i64, i64* %4
%11 = lshr i64 %10, 8
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
%17 = load i64, i64* %4
%18 = lshr i64 %17, 8
store i64 %18, i64* %4
%19 = load i64, i64* %4
%20 = and i64 %19, 255
%21 = trunc i64 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
%24 = load i64, i64* %4
%25 = lshr i64 %24, 8
store i64 %25, i64* %4
%26 = load i64, i64* %4
%27 = trunc i64 %26 to i8
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 0
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @WriteLong(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int linear(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", linear(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <linear@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @walt_migrate_sync_cpu(i32 %0) {
ret void
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
double tdiff(const struct timespec start, const struct timespec end) {
  return end.tv_sec - start.tv_sec + (end.tv_nsec - start.tv_nsec) * 1e-9;
}


x86 assembly (clang, -O0):
<tdiff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x8(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %esi,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xed0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdiff>:
sub    %edi,%esi
cvtsi2sd %esi,%xmm2
subsd  %xmm0,%xmm1
mulsd  0xeee(%rip),%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
define double @tdiff(double %0, i32 %1, double %2, i32 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = bitcast %struct.timespec* %5 to { double, i32 }*
%8 = getelementptr inbounds { double, i32 }, { double, i32 }* %7, i32 0, i32 0
store double %0, double* %8
%9 = getelementptr inbounds { double, i32 }, { double, i32 }* %7, i32 0, i32 1
store i32 %1, i32* %9
%10 = bitcast %struct.timespec* %6 to { double, i32 }*
%11 = getelementptr inbounds { double, i32 }, { double, i32 }* %10, i32 0, i32 0
store double %2, double* %11
%12 = getelementptr inbounds { double, i32 }, { double, i32 }* %10, i32 0, i32 1
store i32 %3, i32* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%14 = load double, double* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%21 = load i32, i32* %20
%22 = sub nsw i32 %19, %21
%23 = sitofp i32 %22 to double
%24 = call double @llvm.fmuladd.f64(double %23, double 1.000000e-09, double %17)
ret double %24
}

LLVM IR (-O2):
define double @tdiff(double %0, i32 %1, double %2, i32 %3) {
%5 = fsub double %2, %0
%6 = sub nsw i32 %3, %1
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e-09, double %5)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcomplex8array(char *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 8));
}


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

x86 assembly (clang, -O2):
<popcomplex8array>:
shl    $0x3,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popcomplex8array(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 = mul nsw i32 %6, 8
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popcomplex8array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(int /*<<< orphan*/);
void ft_puttabstr(char **tab) {
  while (*(tab + 1))
    ft_putstr(*tab++);
}


x86 assembly (clang, -O0):
<ft_puttabstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1149 <ft_puttabstr+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <ft_putstr@plt>
jmp    111c <ft_puttabstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_puttabstr>:
push   %rbx
cmpq   $0x0,0x8(%rdi)
je     1132 <ft_puttabstr+0x22>
mov    %rdi,%rbx
add    $0x10,%rbx
nop
mov    -0x10(%rbx),%edi
call   1030 <ft_putstr@plt>
cmpq   $0x0,(%rbx)
lea    0x8(%rbx),%rbx
jne    1120 <ft_puttabstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_puttabstr(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8** [ %12, %5 ], [ %2, %1 ]
%7 = phi i8** [ %6, %5 ], [ %0, %1 ]
%8 = load i8*, i8** %7
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = tail call i32 @ft_putstr(i32 %10)
%12 = getelementptr inbounds i8*, i8** %6, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %5
15: ; preds = %5, %1
ret void
}
/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ getenv(char *);
int main() { return !(1 == atoi(getenv("EXPECTED_PCH"))); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"EXPECTED_PCH\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @atoi(i32 %2)
%4 = icmp eq i32 1, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [13 x i8] c"EXPECTED_PCH\00"
define i32 @main() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @atoi(i32 %1)
%3 = icmp ne i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETTEXTALIGN_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


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

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

LLVM IR (-O0):
define void @U_WMRSETTEXTALIGN_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_WMRCORE_N16_swap(i8* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRSETTEXTALIGN_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
void VpSysSemaphoreInit(int semaphoreId) {}


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

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

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

LLVM IR (-O2):
define void @VpSysSemaphoreInit(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add(int);
int /*<<< orphan*/ mult(int);
int /*<<< orphan*/ sub(int);
void eval(char c, int ii) {
  if (c == '+')
    add(ii);
  else if (c == '-')
    sub(ii);
  else if (c == '*')
    mult(ii);
}


x86 assembly (clang, -O0):
<eval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
jne    115b <eval+0x2b>
mov    -0x8(%rbp),%edi
call   1030 <add@plt>
jmp    1194 <eval+0x64>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
jne    1175 <eval+0x45>
mov    -0x8(%rbp),%edi
call   1050 <sub@plt>
jmp    118f <eval+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
jne    118a <eval+0x5a>
mov    -0x8(%rbp),%edi
call   1040 <mult@plt>
jmp    118f <eval+0x5f>
jmp    1194 <eval+0x64>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval>:
cmp    $0x2a,%dil
je     1149 <eval+0x19>
cmp    $0x2d,%dil
je     1150 <eval+0x20>
cmp    $0x2b,%dil
jne    1157 <eval+0x27>
mov    %esi,%edi
jmp    1030 <add@plt>
mov    %esi,%edi
jmp    1040 <mult@plt>
mov    %esi,%edi
jmp    1050 <sub@plt>
ret

LLVM IR (-O0):
define void @eval(i8 signext %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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 43
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @add(i32 %9)
br label %27
11: ; preds = %2
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %4
%17 = call i32 @sub(i32 %16)
br label %26
18: ; preds = %11
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 42
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32, i32* %4
%24 = call i32 @mult(i32 %23)
br label %25
25: ; preds = %22, %18
br label %26
26: ; preds = %25, %15
br label %27
27: ; preds = %26, %8
ret void
}

LLVM IR (-O2):
define void @eval(i8 signext %0, i32 %1) {
switch i8 %0, label %9 [
i8 43, label %3
i8 45, label %5
i8 42, label %7
]
3: ; preds = %2
%4 = tail call i32 @add(i32 %1)
br label %9
5: ; preds = %2
%6 = tail call i32 @sub(i32 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @mult(i32 %1)
br label %9
9: ; preds = %2, %5, %7, %3
ret void
}
OP(fd, dd) { op_dd(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_dd@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_dd()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void cmp_reg64_imm8(int reg64, unsigned char imm8) {
  put8(0x48);
  put8(0x83);
  put8(0xF8 + reg64);
  put8(imm8);
}


x86 assembly (clang, -O0):
<cmp_reg64_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x83,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xf8,%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_reg64_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x83,%edi
call   1030 <put8@plt>
add    $0xf8,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_reg64_imm8(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext 72)
%6 = call i32 @put8(i8 zeroext -125)
%7 = load i32, i32* %3
%8 = add nsw i32 248, %7
%9 = trunc i32 %8 to i8
%10 = call i32 @put8(i8 zeroext %9)
%11 = load i8, i8* %4
%12 = call i32 @put8(i8 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @cmp_reg64_imm8(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext 72)
%4 = tail call i32 @put8(i8 zeroext -125)
%5 = trunc i32 %0 to i8
%6 = add i8 %5, -8
%7 = tail call i32 @put8(i8 zeroext %6)
%8 = tail call i32 @put8(i8 zeroext %1)
ret void
}