xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ do_syscall(char *);
void CE_Lock(void) { do_syscall("CE_Lock"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"CE_Lock\00"
define void @CE_Lock() {
%1 = call i32 @do_syscall(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"CE_Lock\00"
define void @CE_Lock() {
%1 = tail call i32 @do_syscall(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dyStringTest();
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc != 1)
    usage();
  dyStringTest();
  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)
cmpl   $0x1,-0x8(%rbp)
je     1147 <main+0x27>
mov    $0x0,%al
call   1040 <usage@plt>
mov    $0x0,%al
call   1030 <dyStringTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     112d <main+0xd>
xor    %eax,%eax
call   1040 <usage@plt>
xor    %eax,%eax
call   1030 <dyStringTest@plt>
xor    %eax,%eax
pop    %rcx
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 i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = call i32 (...) @dyStringTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = tail call i32 (...) @dyStringTest()
ret i32 0
}
char *funChar(char *x, char *y) {
  if (*x > *y)
    return x;
  else if (*y > *x)
    return y;
  return x;
}


x86 assembly (clang, -O0):
<funChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    112f <funChar+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <funChar+0x5f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    1152 <funChar+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <funChar+0x5f>
jmp    1157 <funChar+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funChar>:
mov    %rsi,%rax
mov    (%rdi),%cl
mov    (%rsi),%dl
cmp    %cl,%dl
cmovle %rdi,%rax
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @funChar(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = icmp sgt i8 %4, %3
%7 = select i1 %6, i8* %1, i8* %0
%8 = select i1 %5, i8* %0, i8* %7
ret i8* %8
}
unsigned int hash_djb2(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_djb2+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_djb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_djb2+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %11 to i32
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
void avcodec_parameters_free() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_parameters_free() {
ret void
}
int eval(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @eval() {
ret i32 0
}
/* Variables and functions */
double cos(int);
double foo(void) { return cos(0.); }


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

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

LLVM IR (-O0):
define double @foo() {
%1 = call double @cos(i32 0)
ret double %1
}

LLVM IR (-O2):
define double @foo() {
%1 = tail call double @cos(i32 0)
ret double %1
}
unsigned long conv_dpt_9_001(unsigned long val) {
  unsigned int div = 0;
  while (val >= 2047) {
    ++div;
    val >>= 1;
  }
  val |= div << 11;
  return val;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x7ff,-0x8(%rbp)
jb     1137 <conv_dpt_9_001+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <conv_dpt_9_001+0xf>
mov    -0xc(%rbp),%eax
shl    $0xb,%eax
mov    %eax,%eax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %rdi,%rax
xor    %ecx,%ecx
cmp    $0x7ff,%rdi
jb     1136 <conv_dpt_9_001+0x36>
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    %rax
add    $0x800,%rcx
cmp    $0xffd,%rdx
mov    %rax,%rdx
ja     1120 <conv_dpt_9_001+0x20>
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @conv_dpt_9_001(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp uge i64 %5, 2047
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add i32 %8, 1
store i32 %9, i32* %3
%10 = load i64, i64* %2
%11 = lshr i64 %10, 1
store i64 %11, i64* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = shl i32 %13, 11
%15 = zext i32 %14 to i64
%16 = load i64, i64* %2
%17 = or i64 %16, %15
store i64 %17, i64* %2
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
define i64 @conv_dpt_9_001(i64 %0) {
%2 = icmp ugt i64 %0, 2046
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ugt i64 %5, 4093
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = shl i32 %6, 11
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %9, %1
%13 = phi i64 [ %0, %1 ], [ %7, %9 ]
%14 = phi i64 [ 0, %1 ], [ %11, %9 ]
%15 = or i64 %13, %14
ret i64 %15
}
void gtk_socket_add_id() {}


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

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

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

LLVM IR (-O2):
define void @gtk_socket_add_id() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_msg(char *msg, int abort) {
  fprintf(stderr, "[Error]: %s\n", msg);
  if (abort)
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1160 <error_msg+0x40>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_msg>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    1141 <error_msg+0x21>
pop    %rbx
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"[Error]: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_msg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"[Error]: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_msg(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
char str_to_char(char *str) {
  char ret = *str;
  return ret;
}


x86 assembly (clang, -O0):
<str_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_char>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @str_to_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @str_to_char(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xf8() {
  Assert_real((islower(248) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1245, ("islower should be 0 for 0xf8"));
}


x86 assembly (clang, -O0):
<t_islower_0xf8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf8,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4dd,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xf8>:
push   %rax
mov    $0xf8,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4dd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf8\00"
define void @t_islower_0xf8() {
%1 = call i64 @islower(i32 248)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1245, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf8\00"
define void @t_islower_0xf8() {
%1 = tail call i64 @islower(i32 248)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1245, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int snd_media_device_create(struct snd_usb_audio *chip,
                            struct usb_interface *iface) {
  return 0;
}


x86 assembly (clang, -O0):
<snd_media_device_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.snd_usb_audio = type opaque
%struct.usb_interface = type opaque
define i32 @snd_media_device_create(%struct.snd_usb_audio* %0, %struct.usb_interface* %1) {
%3 = alloca %struct.snd_usb_audio*
%4 = alloca %struct.usb_interface*
store %struct.snd_usb_audio* %0, %struct.snd_usb_audio** %3
store %struct.usb_interface* %1, %struct.usb_interface** %4
ret i32 0
}

LLVM IR (-O2):
%struct.snd_usb_audio = type opaque
%struct.usb_interface = type opaque
define i32 @snd_media_device_create(%struct.snd_usb_audio* nocapture readnone %0, %struct.usb_interface* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void do_separator_line(FILE *fout) {
  (void)fprintf(fout, "--------------------------------------------------------"
                      "-----------------------------------\n");
}


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

x86 assembly (clang, -O2):
<do_separator_line>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x5c,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [93 x i8] c"-------------------------------------------------------------------------------------------\0A\00"
define void @do_separator_line(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i64 92, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void touchstone_os_threadExit(void *thread_result) {
  pthread_exit(thread_result);
  return;
}


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

x86 assembly (clang, -O2):
<touchstone_os_threadExit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @touchstone_os_threadExit(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ converse(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int N = 1025, r = 2;
  converse(N, r);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x401,%edi
mov    $0x2,%esi
call   1040 <converse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @converse(i32 1025, i32 2)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
struct socket_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ complete_connect(struct socket_info *);
void srvready(struct socket_info *sinfo,
              char *CANTUSE_params __attribute__((unused))) {
  complete_connect(sinfo);
}


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

x86 assembly (clang, -O2):
<srvready>:
jmp    1030 <complete_connect@plt>

LLVM IR (-O0):
%struct.socket_info = type { i32 }
define void @srvready(%struct.socket_info* %0, i8* %1) {
%3 = alloca %struct.socket_info*
%4 = alloca i8*
store %struct.socket_info* %0, %struct.socket_info** %3
store i8* %1, i8** %4
%5 = load %struct.socket_info*, %struct.socket_info** %3
%6 = call i32 @complete_connect(%struct.socket_info* %5)
ret void
}

LLVM IR (-O2):
%struct.socket_info = type { i32 }
define void @srvready(%struct.socket_info* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @complete_connect(%struct.socket_info* %0)
ret void
}
void set_key_wait_vtime(long wait_vtime) {}


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

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

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

LLVM IR (-O2):
define void @set_key_wait_vtime(i64 %0) {
ret void
}
/* Variables and functions */
bool plugin_init() { return true; }


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

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

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

LLVM IR (-O2):
define i32 @plugin_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
print_side_usage() {
  printf("\n"
         "\n usage: side in-file-1 in-file-2 "
         "out-file method"
         "\n        where method is Top-to-bottom "
         "or Side-by-side"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [106 x i8] c"\0A\0A usage: side in-file-1 in-file-2 out-file method\0A where method is Top-to-bottom or Side-by-side\0A\00"
define i32 @print_side_usage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [105 x i8] c"\0A\0A usage: side in-file-1 in-file-2 out-file method\0A where method is Top-to-bottom or Side-by-side\00"
define i32 @print_side_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([105 x i8], [105 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int main(void) {
  int foo = 10, bar = 15, rem = 0;
  asm volatile("div %%rbx"
               : "=d"(rem), "=a"(bar)
               : "a"(bar), "b"(foo), "d"(rem));
  printf("bar / foo, bar %% foo = %d, %d\n", bar, rem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ebx
mov    -0x18(%rbp),%edx
div    %rbx
mov    %edx,-0x18(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xf,%eax
mov    $0xa,%ebx
xor    %edx,%edx
div    %rbx
lea    0xed9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"bar / foo, bar %% foo = %d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 15, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = call { i32, i32 } asm sideeffect "div %rbx", "={dx},={ax},{ax},{bx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6, i32 %7)
%9 = extractvalue { i32, i32 } %8, 0
%10 = extractvalue { i32, i32 } %8, 1
store i32 %9, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"bar / foo, bar %% foo = %d, %d\0A\00"
define i32 @main() {
%1 = tail call { i32, i32 } asm sideeffect "div %rbx", "={dx},={ax},{ax},{bx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 15, i32 10, i32 0)
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void TimerDMAEventSet(uint32_t ui32Base, uint32_t ui32DMAEvent) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000006C))) = ui32DMAEvent;
}


x86 assembly (clang, -O0):
<TimerDMAEventSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x6c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerDMAEventSet>:
mov    %rsi,0x6c(%rdi)
ret

LLVM IR (-O0):
define void @TimerDMAEventSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 108
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerDMAEventSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 108
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int main() {
  int data1 = 10;
  int data2 = 20;
  __asm__ __volatile__("imull %[value1], %[value2]"
                       : [value2] "=r"(data2)
                       : [value1] "r"(data1), "0"(data2));
  printf("The result is %d\n", data2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%eax
mov    $0x14,%esi
imul   %eax,%esi
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 asm sideeffect "imull $1, $0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "imull $1, $0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version() { printf("update-passwd %s\n", "3.5.3"); }


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xef4(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"update-passwd %s\0A\00"
@.str.1 = [6 x i8] c"3.5.3\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"update-passwd %s\0A\00"
@.str.1 = [6 x i8] c"3.5.3\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct hashtable_link {
  int dummy;
};
struct hashtable {
  int dummy;
};

/* Variables and functions */
struct hashtable_link *__hashtable_find(struct hashtable *, int /*<<< orphan*/,
                                        char *);
int /*<<< orphan*/ __hashtable_hash(struct hashtable *, char *);
struct hashtable_link *hashtable_find(struct hashtable *ht, char *key) {
  return __hashtable_find(ht, __hashtable_hash(ht, key), key);
}


x86 assembly (clang, -O0):
<hashtable_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__hashtable_hash@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <__hashtable_find@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_find>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__hashtable_hash@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__hashtable_find@plt>

LLVM IR (-O0):
%struct.hashtable_link = type { i32 }
%struct.hashtable = type { i32 }
define %struct.hashtable_link* @hashtable_find(%struct.hashtable* %0, i8* %1) {
%3 = alloca %struct.hashtable*
%4 = alloca i8*
store %struct.hashtable* %0, %struct.hashtable** %3
store i8* %1, i8** %4
%5 = load %struct.hashtable*, %struct.hashtable** %3
%6 = load %struct.hashtable*, %struct.hashtable** %3
%7 = load i8*, i8** %4
%8 = call i32 @__hashtable_hash(%struct.hashtable* %6, i8* %7)
%9 = load i8*, i8** %4
%10 = call %struct.hashtable_link* @__hashtable_find(%struct.hashtable* %5, i32 %8, i8* %9)
ret %struct.hashtable_link* %10
}

LLVM IR (-O2):
%struct.hashtable_link = type { i32 }
%struct.hashtable = type { i32 }
define %struct.hashtable_link* @hashtable_find(%struct.hashtable* %0, i8* %1) {
%3 = tail call i32 @__hashtable_hash(%struct.hashtable* %0, i8* %1)
%4 = tail call %struct.hashtable_link* @__hashtable_find(%struct.hashtable* %0, i32 %3, i8* %1)
ret %struct.hashtable_link* %4
}
/* Variables and functions */
double pow(int, int);
double ldexp(double x, int i) { return x * pow(2, i); }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
push   %rax
mov    %edi,%esi
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call double @pow(i32 2, i32 %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = tail call double @pow(i32 2, i32 %1)
%4 = fmul double %3, %0
ret double %4
}
int test_imm_FBint8_reg(signed char val) {
  return ((val) & (-0xFB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FBint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -251
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int do_899() { return 899; }


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

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

LLVM IR (-O0):
define i32 @do_899() {
ret i32 899
}

LLVM IR (-O2):
define i32 @do_899() {
ret i32 899
}
/* Variables and functions */
int strlen(const char *s) {
  const char *c;
  for (c = s; *c; ++c)
    continue;
  return (c - s);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int qsort_cmp_WEIGHT(const void *x, const void *y) {
  if (*((int *)x) < *((int *)y))
    return (-1);
  else
    return (*((int *)x) > *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_WEIGHT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <qsort_cmp_WEIGHT+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp_WEIGHT+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_WEIGHT>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp_WEIGHT(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void error2(a, b) char *a, *b;
{ error("%s: %s", a, b); }


x86 assembly (clang, -O0):
<error2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error2>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
define void @error2(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
double M_PI;
double cos(double);
double Q_rho_time(double Lt, double a_rhot, double rho_t, double t) {
  return M_PI * a_rhot * rho_t * cos(M_PI * a_rhot * t / Lt) / Lt;
}


x86 assembly (clang, -O0):
<Q_rho_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e9b(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_rho_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mulsd  (%rax),%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <cos@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @Q_rho_time(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = load double, double* @M_PI
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = load double, double* %8
%18 = fmul double %16, %17
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = call double @cos(double %20)
%22 = fmul double %13, %21
%23 = load double, double* %5
%24 = fdiv double %22, %23
ret double %24
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @Q_rho_time(double %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fmul double %5, %1
%7 = fmul double %6, %2
%8 = fmul double %6, %3
%9 = fdiv double %8, %0
%10 = tail call double @cos(double %9)
%11 = fmul double %10, %7
%12 = fdiv double %11, %0
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ PWM3_3_DriverIRQHandler();
__attribute__((weak)) void PWM3_3_IRQHandler(void) {
  PWM3_3_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM3_3_IRQHandler() {
%1 = call i32 (...) @PWM3_3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM3_3_IRQHandler() {
%1 = tail call i32 (...) @PWM3_3_DriverIRQHandler()
ret void
}
int test_imm_E2uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xE2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E2uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14811136
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rte_prefetch0(volatile void *p) {
  asm volatile("prefetcht0 %[p]" : [p] "+m"(*(volatile char *)p));
}


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

x86 assembly (clang, -O2):
<rte_prefetch0>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @rte_prefetch0(i8* %0) {
tail call void asm sideeffect "prefetcht0 $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigintHandler(int sigI) { exit(1); }


x86 assembly (clang, -O0):
<sigintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigintHandler>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigintHandler(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_C3int16_reg(short val) {
  return ((val) & (-0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff3d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C3int16_reg(i16 signext %0) {
%2 = and i16 %0, -195
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ a;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
void copy_content(FILE *src, FILE *dst) {
  int a = 0;
  int read_a = 0;
  while (1) {
    read_a = (int)fread(&a, sizeof(a), 1, src);
    if (!read_a) {
      break;
    }
    fwrite(&a, sizeof(a), 1, dst);
  }
}


x86 assembly (clang, -O0):
<copy_content>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1167 <copy_content+0x47>
jmp    1183 <copy_content+0x63>
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
jmp    113e <copy_content+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_content>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
test   %eax,%eax
je     118e <copy_content+0x6e>
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
test   %eax,%eax
jne    1160 <copy_content+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @copy_content(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %2, %14
%8 = load i32*, i32** %3
%9 = call i64 @fread(i32* %5, i32 4, i32 1, i32* %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %7
br label %17
14: ; preds = %7
%15 = load i32*, i32** %4
%16 = call i32 @fwrite(i32* %5, i32 4, i32 1, i32* %15)
br label %7
17: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @copy_content(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i64 @fread(i32* %3, i32 4, i32 1, i32* %0)
%6 = trunc i64 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %1)
%10 = call i64 @fread(i32* %3, i32 4, i32 1, i32* %0)
%11 = trunc i64 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ REG_UART_BASE(scalar_t__);
__attribute__((always_)) __attribute__((flatten)) uint32_t
UART_CONF1(uint32_t i) {
  return (REG_UART_BASE(i) + 0x24);
}


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

x86 assembly (clang, -O2):
<UART_CONF1>:
push   %rax
call   1030 <REG_UART_BASE@plt>
add    $0x24,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @UART_CONF1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @REG_UART_BASE(i64 %3)
%5 = add nsw i64 %4, 36
ret i64 %5
}

LLVM IR (-O2):
define i64 @UART_CONF1(i64 %0) {
%2 = tail call i64 @REG_UART_BASE(i64 %0)
%3 = add nsw i64 %2, 36
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello, world\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ dowhileloop(int /*<<< orphan*/);
int /*<<< orphan*/ forloop();
int /*<<< orphan*/ whileloop(int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  forloop();
  dowhileloop(0);
  whileloop(0);
  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    $0x0,%al
call   1040 <forloop@plt>
xor    %edi,%edi
call   1050 <dowhileloop@plt>
xor    %edi,%edi
call   1030 <whileloop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <forloop@plt>
xor    %edi,%edi
call   1050 <dowhileloop@plt>
xor    %edi,%edi
call   1030 <whileloop@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 (...) @forloop()
%7 = call i32 @dowhileloop(i32 0)
%8 = call i32 @whileloop(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @forloop()
%4 = tail call i32 @dowhileloop(i32 0)
%5 = tail call i32 @whileloop(i32 0)
ret i32 0
}