xunge/DecIR huggingface dataset:
int _CheckFieldSep(char *buf) {
  int i = 0;
  if ((buf[i - 1] == ':') && (buf[i] == ' ')) {
    i = 2;
  }
  return i;
}


x86 assembly (clang, -O0):
<_CheckFieldSep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1145 <_CheckFieldSep+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1145 <_CheckFieldSep+0x45>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CheckFieldSep>:
xor    %eax,%eax
cmpb   $0x3a,-0x1(%rdi)
jne    1112 <_CheckFieldSep+0x12>
xor    %eax,%eax
cmpb   $0x20,(%rdi)
sete   %al
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_CheckFieldSep(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 58
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 32
%8 = select i1 %7, i32 2, i32 0
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
struct argp_state {
  char *input;
};
typedef int /*<<< orphan*/ error_t;

/* Variables and functions */
int /*<<< orphan*/ ARGP_ERR_UNKNOWN;
error_t parse_opt(int key, char *arg, struct argp_state *state) {
  char *device = state->input;
  switch (key) {
  case 'd':
    device = arg;
    break;
  default:
    return ARGP_ERR_UNKNOWN;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
jne    1138 <parse_opt+0x38>
jmp    112b <parse_opt+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1149 <parse_opt+0x49>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <parse_opt+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_opt>:
xor    %eax,%eax
cmp    $0x64,%edi
je     1110 <parse_opt+0x10>
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.argp_state = type { i8* }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* %1, %struct.argp_state* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.argp_state*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.argp_state* %2, %struct.argp_state** %7
%9 = load %struct.argp_state*, %struct.argp_state** %7
%10 = getelementptr inbounds %struct.argp_state, %struct.argp_state* %9, i32 0, i32 0
%11 = load i8*, i8** %10
store i8* %11, i8** %8
%12 = load i32, i32* %5
switch i32 %12, label %15 [
i32 100, label %13
]
13: ; preds = %3
%14 = load i8*, i8** %6
store i8* %14, i8** %8
br label %17
15: ; preds = %3
%16 = load i32, i32* @ARGP_ERR_UNKNOWN
store i32 %16, i32* %4
br label %18
17: ; preds = %13
store i32 0, i32* %4
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.argp_state = type { i8* }
@ARGP_ERR_UNKNOWN = global i32 0
define i32 @parse_opt(i32 %0, i8* nocapture readnone %1, %struct.argp_state* nocapture readnone %2) {
%4 = icmp eq i32 %0, 100
%5 = load i32, i32* @ARGP_ERR_UNKNOWN
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Test Usupported: _POSIX_MEMORY_PROTECTION not defined\n");
  return 4;
}


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>
mov    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [55 x i8] c"Test Usupported: _POSIX_MEMORY_PROTECTION not defined\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@str = [54 x i8] c"Test Usupported: _POSIX_MEMORY_PROTECTION not defined\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ ModuleLineMessage(char const *, int, char const *);
int /*<<< orphan*/ exit(int);
void FatalError(const char *Message, const char *FileName, int LineNo) {
  ModuleLineMessage(FileName, LineNo, Message);
  exit(4);
}


x86 assembly (clang, -O0):
<FatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1040 <ModuleLineMessage@plt>
mov    $0x4,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<FatalError>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1040 <ModuleLineMessage@plt>
mov    $0x4,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @FatalError(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @ModuleLineMessage(i8* %7, i32 %8, i8* %9)
%11 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
define void @FatalError(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ModuleLineMessage(i8* %1, i32 %2, i8* %0)
%5 = tail call i32 @exit(i32 4)
unreachable
}
void foo297(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo297(i32 %0) {
ret void
}
main() {
  int printf(char *, ...) __attribute((format(printf, 1, 2)));
  printf("%Q\n");
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%Q\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gtk_radio_button_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_button_new() {
ret void
}
const char *abi(void) {
  if (sizeof(long) == 4)
    return "x32";
  return "amd64";
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"amd64\00"
define i8* @abi() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"amd64\00"
define i8* @abi() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ test45_M_bar__E();
void test45_Test3_test__I() {
  foo();
  test45_M_bar__E();
}


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

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

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

LLVM IR (-O2):
define void @test45_Test3_test__I() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @test45_M_bar__E()
ret void
}
void expression(int level) {}


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

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

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

LLVM IR (-O2):
define void @expression(i32 %0) {
ret void
}
int find_wrap(double voxelL_value, double voxelR_value) {
  double difference;
  int wrap_value;
  difference = voxelL_value - voxelR_value;
  if (difference > 3.1415926535897932384626433832795)
    wrap_value = -1;
  else if (difference < -3.1415926535897932384626433832795)
    wrap_value = 1;
  else
    wrap_value = 0;
  return wrap_value;
}


x86 assembly (clang, -O0):
<find_wrap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1140 <find_wrap+0x40>
movl   $0xffffffff,-0x1c(%rbp)
jmp    116b <find_wrap+0x6b>
movsd  0xec0(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    115f <find_wrap+0x5f>
movl   $0x1,-0x1c(%rbp)
jmp    1166 <find_wrap+0x66>
movl   $0x0,-0x1c(%rbp)
jmp    116b <find_wrap+0x6b>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_wrap>:
subsd  %xmm1,%xmm0
movsd  0xef4(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd 0xeeb(%rip),%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @find_wrap(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = fcmp ogt double %10, 0x400921FB54442D18
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %6
br label %19
13: ; preds = %2
%14 = load double, double* %5
%15 = fcmp olt double %14, 0xC00921FB54442D18
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %6
br label %18
17: ; preds = %13
store i32 0, i32* %6
br label %18
18: ; preds = %17, %16
br label %19
19: ; preds = %18, %12
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
define i32 @find_wrap(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp ogt double %3, 0x400921FB54442D18
%5 = fcmp olt double %3, 0xC00921FB54442D18
%6 = zext i1 %5 to i32
%7 = select i1 %4, i32 -1, i32 %6
ret i32 %7
}
void led_status_card_detected(void) {}


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

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

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

LLVM IR (-O2):
define void @led_status_card_detected() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void tp_print_param_int(char *name, int value) {
  printf("\tint %s = %d;\n", name, value);
}


x86 assembly (clang, -O0):
<tp_print_param_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_print_param_int>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\09int %s = %d;\0A\00"
define void @tp_print_param_int(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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\09int %s = %d;\0A\00"
define void @tp_print_param_int(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int skip_comment(FILE *file) {
  int lastc = 0, i = 0;
  while (((lastc = getc(file)) != '\n') && lastc != EOF) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<skip_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1158 <skip_comment+0x48>
mov    -0xc(%rbp),%eax
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1168 <skip_comment+0x58>
jmp    1176 <skip_comment+0x66>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <skip_comment+0x1a>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    0x2ec4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <getc@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
je     1145 <skip_comment+0x35>
cmp    (%r15),%eax
jne    1130 <skip_comment+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skip_comment(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32*, i32** %2
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %3
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ false, %5 ], [ %12, %9 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %13
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skip_comment(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = tail call i32 @getc(i32* %0)
%5 = icmp ne i32 %4, 10
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
%9 = add nuw nsw i32 %3, 1
br i1 %8, label %2, label %10
10: ; preds = %2
ret i32 %3
}
/* Type definitions */
struct tftphdr {
  int dummy;
};

/* Variables and functions */
struct tftphdr *tftprw_init(int /*<<< orphan*/);
struct tftphdr *tftpw_init() {
  return tftprw_init(0);
}


x86 assembly (clang, -O0):
<tftpw_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <tftprw_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tftpw_init>:
xor    %edi,%edi
jmp    1030 <tftprw_init@plt>

LLVM IR (-O0):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @tftpw_init() {
%1 = call %struct.tftphdr* @tftprw_init(i32 0)
ret %struct.tftphdr* %1
}

LLVM IR (-O2):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @tftpw_init() {
%1 = tail call %struct.tftphdr* @tftprw_init(i32 0)
ret %struct.tftphdr* %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void breakpoint_handler() {
  printf("\n #####> Exiting on break point !!\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"\0A #####> Exiting on break point !!\0A\00"
define void @breakpoint_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [35 x i8] c"\0A #####> Exiting on break point !!\00"
define void @breakpoint_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
void f(const int *p) {
  int *q;
  q = (int *)p;
  *q = 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @f(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  scalar_t__ tm_mday;
  scalar_t__ tm_mon;
  scalar_t__ tm_year;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
long sysdata_long() {
  time_t secs_now;
  struct tm *data;
  time(&secs_now);
  data = localtime(&secs_now);
  return (long)(data->tm_year + 1900) * 10000L +
         (long)(data->tm_mon + 1) * 100L + (long)data->tm_mday;
}


x86 assembly (clang, -O0):
<sysdata_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
add    $0x76c,%rax
imul   $0x2710,%rax,%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
add    $0x1,%rcx
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
add    (%rcx),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysdata_long>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
imul   $0x2710,0x10(%rax),%rcx
imul   $0x64,0x8(%rax),%rdx
mov    (%rax),%rax
add    %rcx,%rdx
add    %rdx,%rax
add    $0x121eb24,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i64, i64, i64 }
define i64 @sysdata_long() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 2
%7 = load i64, i64* %6
%8 = add nsw i64 %7, 1900
%9 = mul nsw i64 %8, 10000
%10 = load %struct.tm*, %struct.tm** %2
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %12, 1
%14 = mul nsw i64 %13, 100
%15 = add nsw i64 %9, %14
%16 = load %struct.tm*, %struct.tm** %2
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 0
%18 = load i64, i64* %17
%19 = add nsw i64 %15, %18
ret i64 %19
}

LLVM IR (-O2):
%struct.tm = type { i64, i64, i64 }
define i64 @sysdata_long() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%6 = load i64, i64* %5
%7 = mul i64 %6, 10000
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%9 = load i64, i64* %8
%10 = mul i64 %9, 100
%11 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%12 = load i64, i64* %11
%13 = add i64 %7, 19000100
%14 = add i64 %13, %10
%15 = add i64 %14, %12
ret i64 %15
}
void av_register_all() {}


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

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

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

LLVM IR (-O2):
define void @av_register_all() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL_RES;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void mysql_free_result(MYSQL_RES *result) {
  printf("mysql_free_result(%s)\n", (result ? "MYSQL_RES" : "NULL"));
  return;
}


x86 assembly (clang, -O0):
<mysql_free_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xefa(%rip),%rsi
lea    0xee9(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysql_free_result>:
test   %rdi,%rdi
lea    0xf07(%rip),%rax
lea    0xef6(%rip),%rsi
cmove  %rax,%rsi
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"mysql_free_result(%s)\0A\00"
@.str.1 = [10 x i8] c"MYSQL_RES\00"
@.str.2 = [5 x i8] c"NULL\00"
define void @mysql_free_result(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"mysql_free_result(%s)\0A\00"
@.str.1 = [10 x i8] c"MYSQL_RES\00"
@.str.2 = [5 x i8] c"NULL\00"
define void @mysql_free_result(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void g_malloc0() {}


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

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

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

LLVM IR (-O2):
define void @g_malloc0() {
ret void
}
int cairo_code_draw_casHarmonicsLabel_get_width() { return 66; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casHarmonicsLabel_get_width() {
ret i32 66
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casHarmonicsLabel_get_width() {
ret i32 66
}
int calledFunction(void) { return (0x20); }


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

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

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

LLVM IR (-O2):
define i32 @calledFunction() {
ret i32 32
}
int test() {
  int x;
  int y;
  int z;
  int h;
  asm("cpuid " : "=a"(x), "=b"(y), "=c"(z), "=d"(h) : "0"(0));
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
xor    %eax,%eax
cpuid
mov    %eax,-0xc(%rbp)
mov    %ebx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call { i32, i32, i32, i32 } asm "cpuid ", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%6 = extractvalue { i32, i32, i32, i32 } %5, 0
%7 = extractvalue { i32, i32, i32, i32 } %5, 1
%8 = extractvalue { i32, i32, i32, i32 } %5, 2
%9 = extractvalue { i32, i32, i32, i32 } %5, 3
store i32 %6, i32* %1
store i32 %7, i32* %2
store i32 %8, i32* %3
store i32 %9, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call { i32, i32, i32, i32 } asm "cpuid ", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ resourceid;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
unsigned long get_XErrorEvent_resourceid(void *_p) {
  return (unsigned long)((XErrorEvent *)_p)->resourceid;
}


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

x86 assembly (clang, -O2):
<get_XErrorEvent_resourceid>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XErrorEvent_resourceid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XErrorEvent_resourceid(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ f2(int);
int main() {
  f2(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f2(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ iothub_client_sample_mqtt_run();
int main(void) { iothub_client_sample_mqtt_run(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @iothub_client_sample_mqtt_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_client_sample_mqtt_run()
ret i32 0
}
int somme(int a, int b) { return a + b; }


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

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

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

LLVM IR (-O2):
define i32 @somme(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ system(char *);
void remove_lock_file(char nickname[]) {
  char chaine[100] = {0};
  snprintf(chaine, 100, "rm /home/%s/.session/rtorrent.lock\n", nickname);
  printf("%s", chaine);
  system(chaine);
}


x86 assembly (clang, -O0):
<remove_lock_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x64,%esi
lea    0xe90(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_lock_file>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rcx
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xe99(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <snprintf@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"rm /home/%s/.session/rtorrent.lock\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @remove_lock_file(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = bitcast [100 x i8]* %3 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @snprintf(i8* %5, i32 100, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"rm /home/%s/.session/rtorrent.lock\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @remove_lock_file(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 100, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_pi32(int /*<<< orphan*/, int);
__m64 test_mm_srai_pi32(__m64 a) { return _mm_srai_pi32(a, 3); }


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

x86 assembly (clang, -O2):
<test_mm_srai_pi32>:
mov    $0x3,%esi
jmp    1030 <_mm_srai_pi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srai_pi32(i32 %0) {
%2 = tail call i32 @_mm_srai_pi32(i32 %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pong();
void *write_pong(void *iterations) {
  int *number = (void *)iterations;
  int i;
  for (i = 0; i < *number; ++i) {
    pong();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<write_pong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    114f <write_pong+0x3f>
mov    $0x0,%al
call   1030 <pong@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <write_pong+0x1b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pong>:
push   %rbp
push   %rbx
push   %rax
cmpl   $0x0,(%rdi)
jle    112e <write_pong+0x1e>
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   (%rax)
xor    %eax,%eax
call   1030 <pong@plt>
add    $0x1,%ebp
cmp    (%rbx),%ebp
jl     1120 <write_pong+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @write_pong(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 (...) @pong()
%8 = add nuw nsw i32 %6, 1
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %5, label %11
11: ; preds = %5, %1
ret i8* null
}
/* Variables and functions */
double EvalAngDist_alpha0_0plus_0plus_15097_L0(double);
double funcAngDist_alpha0_0plus_0plus_15097_L0(double *x, double *par) {
  double result;
  result = par[0] * EvalAngDist_alpha0_0plus_0plus_15097_L0(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngDist_alpha0_0plus_0plus_15097_L0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngDist_alpha0_0plus_0plus_15097_L0@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngDist_alpha0_0plus_0plus_15097_L0>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngDist_alpha0_0plus_0plus_15097_L0@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngDist_alpha0_0plus_0plus_15097_L0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngDist_alpha0_0plus_0plus_15097_L0(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngDist_alpha0_0plus_0plus_15097_L0(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngDist_alpha0_0plus_0plus_15097_L0(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Type definitions */
struct option {
  int dummy;
};
struct getopt_data {
  int dummy;
};

/* Variables and functions */
int getopt_internal(int, char *const *, char const *, struct option const *,
                    int *, int /*<<< orphan*/, struct getopt_data *);
int __getopt_long_r(int argc, char *const argv[], const char *shortopts,
                    const struct option *longopts, int *longind,
                    struct getopt_data *data) {
  return getopt_internal(argc, argv, shortopts, longopts, longind, 0, data);
}


x86 assembly (clang, -O0):
<__getopt_long_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%rax
xor    %r9d,%r9d
mov    %rax,(%rsp)
call   1030 <getopt_internal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getopt_long_r>:
push   %rax
mov    %r9,(%rsp)
xor    %r9d,%r9d
call   1030 <getopt_internal@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option = type { i32 }
%struct.getopt_data = type { i32 }
define i32 @__getopt_long_r(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, %struct.getopt_data* %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca %struct.option*
%11 = alloca i32*
%12 = alloca %struct.getopt_data*
store i32 %0, i32* %7
store i8** %1, i8*** %8
store i8* %2, i8** %9
store %struct.option* %3, %struct.option** %10
store i32* %4, i32** %11
store %struct.getopt_data* %5, %struct.getopt_data** %12
%13 = load i32, i32* %7
%14 = load i8**, i8*** %8
%15 = load i8*, i8** %9
%16 = load %struct.option*, %struct.option** %10
%17 = load i32*, i32** %11
%18 = load %struct.getopt_data*, %struct.getopt_data** %12
%19 = call i32 @getopt_internal(i32 %13, i8** %14, i8* %15, %struct.option* %16, i32* %17, i32 0, %struct.getopt_data* %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.option = type { i32 }
%struct.getopt_data = type { i32 }
define i32 @__getopt_long_r(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, %struct.getopt_data* %5) {
%7 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0, %struct.getopt_data* %5)
ret i32 %7
}
/* Type definitions */
struct timeval {
  unsigned long long tv_sec;
  int tv_usec;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long GetTickMS() {
  struct timeval now = {0};
  gettimeofday(&now, NULL);
  unsigned long long u = now.tv_sec;
  u *= 1000;
  u += now.tv_usec / 1000;
  return u;
}


x86 assembly (clang, -O0):
<GetTickMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
imul   $0x3e8,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTickMS>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32, i32 }
define i64 @GetTickMS() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = bitcast %struct.timeval* %1 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i64, i64* %5
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = mul i64 %7, 1000
store i64 %8, i64* %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = sext i32 %11 to i64
%13 = load i64, i64* %2
%14 = add i64 %13, %12
store i64 %14, i64* %2
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32, i32 }
define i64 @GetTickMS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add i64 %6, %10
ret i64 %11
}
int test_check_overflow(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @test_check_overflow() {
ret i32 1
}
/* Variables and functions */
long double sqrt(double);
long double dist3(double x1, double y1, double z1, double x2, double y2,
                  double z2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) +
              (z1 - z2) * (z1 - z2));
}


x86 assembly (clang, -O0):
<dist3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist3>:
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm5,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define x86_fp80 @dist3(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = fsub double %13, %14
%16 = load double, double* %7
%17 = load double, double* %10
%18 = fsub double %16, %17
%19 = load double, double* %8
%20 = load double, double* %11
%21 = fsub double %19, %20
%22 = load double, double* %8
%23 = load double, double* %11
%24 = fsub double %22, %23
%25 = fmul double %21, %24
%26 = call double @llvm.fmuladd.f64(double %15, double %18, double %25)
%27 = load double, double* %9
%28 = load double, double* %12
%29 = fsub double %27, %28
%30 = load double, double* %9
%31 = load double, double* %12
%32 = fsub double %30, %31
%33 = call double @llvm.fmuladd.f64(double %29, double %32, double %26)
%34 = call x86_fp80 @sqrt(double %33)
ret x86_fp80 %34
}

LLVM IR (-O2):
define x86_fp80 @dist3(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %3
%8 = fsub double %1, %4
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %9)
%11 = fsub double %2, %5
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %10)
%13 = tail call x86_fp80 @sqrt(double %12)
ret x86_fp80 %13
}
int get_corner_size(const int side) { return (side * side - side) / 2; }


x86 assembly (clang, -O0):
<get_corner_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_corner_size>:
mov    %edi,%ecx
imul   %edi,%ecx
sub    %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @get_corner_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = sub nsw i32 %5, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_corner_size(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sub nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
unsigned long long TimerMatchGet64(unsigned long ulBase) {
  unsigned long ulHigh1, ulHigh2, ulLow;
  ;
  do {
    ulHigh1 = (*((volatile unsigned long *)(ulBase + 0x00000034)));
    ulLow = (*((volatile unsigned long *)(ulBase + 0x00000030)));
    ulHigh2 = (*((volatile unsigned long *)(ulBase + 0x00000034)));
  } while (ulHigh1 != ulHigh2);
  return (((unsigned long long)ulHigh1 << 32) | (unsigned long long)ulLow);
}


x86 assembly (clang, -O0):
<TimerMatchGet64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1108 <TimerMatchGet64+0x8>
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerMatchGet64>:
mov    0x34(%rdi),%rax
mov    0x30(%rdi),%rcx
cmp    0x34(%rdi),%rax
jne    1100 <TimerMatchGet64>
shl    $0x20,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @TimerMatchGet64(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
br label %6
6: ; preds = %19, %1
%7 = load i64, i64* %2
%8 = add i64 %7, 52
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = add i64 %11, 48
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %5
%15 = load i64, i64* %2
%16 = add i64 %15, 52
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
store i64 %18, i64* %4
br label %19
19: ; preds = %6
%20 = load i64, i64* %3
%21 = load i64, i64* %4
%22 = icmp ne i64 %20, %21
br i1 %22, label %6, label %23
23: ; preds = %19
%24 = load i64, i64* %3
%25 = shl i64 %24, 32
%26 = load i64, i64* %5
%27 = or i64 %25, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @TimerMatchGet64(i64 %0) {
%2 = add i64 %0, 52
%3 = inttoptr i64 %2 to i64*
%4 = add i64 %0, 48
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* %3
%8 = load volatile i64, i64* %5
%9 = load volatile i64, i64* %3
%10 = icmp eq i64 %7, %9
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = shl i64 %7, 32
%13 = or i64 %12, %8
ret i64 %13
}
void foo_1_1_1_1_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_2_2_1_1() {
ret void
}
/* Variables and functions */
float atof(char *);
int strlen(char *);
float extract_level(char *cStr) {
  int n;
  float m;
  char push;
  n = strlen(cStr) - 1;
  push = cStr[n];
  cStr[n] = '\n';
  m = atof(cStr);
  cStr[n] = push;
  return (m);
}


x86 assembly (clang, -O0):
<extract_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_level>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%r14
mov    -0x1(%r14,%rbx,1),%bpl
movb   $0xa,-0x1(%r14,%rbx,1)
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %bpl,-0x1(%r14,%rbx,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @extract_level(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca float
%5 = alloca i8
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 10, i8* %17
%18 = load i8*, i8** %2
%19 = call float @atof(i8* %18)
store float %19, float* %4
%20 = load i8, i8* %5
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
%25 = load float, float* %4
ret float %25
}

LLVM IR (-O2):
define float @extract_level(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
store i8 10, i8* %5
%7 = tail call float @atof(i8* %0)
store i8 %6, i8* %5
ret float %7
}