xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ inplace_reverse(char *);
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *palindrome5(char *s) {
  int n = strlen(s);
  char *dest = malloc((2 * n + 1) * sizeof(char));
  strcpy(dest, s);
  inplace_reverse(s);
  strcat(dest, s);
  return dest;
}


x86 assembly (clang, -O0):
<palindrome5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1070 <inplace_reverse@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palindrome5>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    (%rax,%rax,1),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <inplace_reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @palindrome5(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i8* @malloc(i32 %12)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %2
%18 = call i32 @inplace_reverse(i8* %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %2
%21 = call i32 @strcat(i8* %19, i8* %20)
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @palindrome5(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = shl nsw i32 %2, 1
%4 = or i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = tail call i32 @inplace_reverse(i8* %0)
%8 = tail call i32 @strcat(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello World in Windows Server 2012"); }


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

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

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

LLVM IR (-O2):
@.str = [35 x i8] c"Hello World in Windows Server 2012\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strnlen(char *, int);
void strnlen_constant0() { clang_analyzer_eval(strnlen("123", 10) == 3); }


x86 assembly (clang, -O0):
<strnlen_constant0>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0xa,%esi
call   1030 <strnlen@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen_constant0>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
call   1030 <strnlen@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strnlen_constant0() {
%1 = call i32 @strnlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strnlen_constant0() {
%1 = tail call i32 @strnlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
int isRudolf(int a[], int n, int element) {
  int k = 0, i;
  for (i = 0; i < n; i++) {
    if (a[i] == element)
      k++;
    if (k == 2)
      break;
  }
  return k;
}


x86 assembly (clang, -O0):
<isRudolf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <isRudolf+0x67>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    1145 <isRudolf+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    1154 <isRudolf+0x54>
jmp    1167 <isRudolf+0x67>
jmp    1159 <isRudolf+0x59>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <isRudolf+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRudolf>:
test   %esi,%esi
jle    112b <isRudolf+0x2b>
mov    %esi,%r8d
xor    %esi,%esi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %eax,%ecx
xor    %eax,%eax
cmp    %edx,(%rdi,%rsi,4)
sete   %al
add    %ecx,%eax
cmp    $0x2,%eax
je     112e <isRudolf+0x2e>
add    $0x1,%rsi
cmp    %rsi,%r8
jne    1110 <isRudolf+0x10>
ret
xor    %eax,%eax
ret
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @isRudolf(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %18, %6
br i1 %8, label %19, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %18, %7 ]
%11 = phi i32 [ 0, %5 ], [ %16, %7 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %10
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, %2
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %11, %15
%17 = icmp eq i32 %16, 2
%18 = add nuw nsw i64 %10, 1
br i1 %17, label %19, label %7
19: ; preds = %7, %9, %3
%20 = phi i32 [ 0, %3 ], [ 2, %9 ], [ %16, %7 ]
ret i32 %20
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
void reset(struct timeval *timer) { gettimeofday(timer, 0); }


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

x86 assembly (clang, -O2):
<reset>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @reset(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @reset(%struct.timeval* %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AtmegaCounterP__0__Counter__overflow();
void AtmegaCounterP__0__AtmegaCounter__overflow(void) {
  AtmegaCounterP__0__Counter__overflow();
}


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

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

LLVM IR (-O0):
define void @AtmegaCounterP__0__AtmegaCounter__overflow() {
%1 = call i32 (...) @AtmegaCounterP__0__Counter__overflow()
ret void
}

LLVM IR (-O2):
define void @AtmegaCounterP__0__AtmegaCounter__overflow() {
%1 = tail call i32 (...) @AtmegaCounterP__0__Counter__overflow()
ret void
}
int intel_msic_check_battery_present(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intel_msic_check_battery_present() {
ret i32 0
}
/* Type definitions */
struct xroute_stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct xroute_stream *);
void xroute_stream_done(struct xroute_stream *stream) { free(stream); }


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

x86 assembly (clang, -O2):
<xroute_stream_done>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.xroute_stream = type { i32 }
define void @xroute_stream_done(%struct.xroute_stream* %0) {
%2 = alloca %struct.xroute_stream*
store %struct.xroute_stream* %0, %struct.xroute_stream** %2
%3 = load %struct.xroute_stream*, %struct.xroute_stream** %2
%4 = call i32 @free(%struct.xroute_stream* %3)
ret void
}

LLVM IR (-O2):
%struct.xroute_stream = type { i32 }
define void @xroute_stream_done(%struct.xroute_stream* nocapture %0) {
%2 = tail call i32 @free(%struct.xroute_stream* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_cleanup(int);
void event_cleanup_all(void) { event_cleanup(-666); }


x86 assembly (clang, -O0):
<event_cleanup_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffd66,%edi
call   1030 <event_cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_cleanup_all>:
mov    $0xfffffd66,%edi
jmp    1030 <event_cleanup@plt>

LLVM IR (-O0):
define void @event_cleanup_all() {
%1 = call i32 @event_cleanup(i32 -666)
ret void
}

LLVM IR (-O2):
define void @event_cleanup_all() {
%1 = tail call i32 @event_cleanup(i32 -666)
ret void
}
int test_imm_73int32_mem(int *val) {
  return ((*val) & (0x73 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_73int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 115
%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_73int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 115
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
void pc2str(long pc, char *pcstr) {
  int a;
  int b;
  int c;
  c = pc & 0x07;
  b = (pc >> 3) & 0xFF;
  a = (pc >> 11) & 0x07;
  sprintf(pcstr, "%01d-%03d-%01d", a, b, c);
}


x86 assembly (clang, -O0):
<pc2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x3,%rax
and    $0xff,%rax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sar    $0xb,%rax
and    $0x7,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xea0(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc2str>:
mov    %rsi,%rax
mov    %rdi,%rdx
mov    %edx,%r8d
and    $0x7,%r8d
mov    %edx,%ecx
shr    $0x3,%ecx
movzbl %cl,%ecx
shr    $0xb,%edx
and    $0x7,%edx
lea    0xece(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%01d-%03d-%01d\00"
define void @pc2str(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i64 %0, i64* %3
store i8* %1, i8** %4
%8 = load i64, i64* %3
%9 = and i64 %8, 7
%10 = trunc i64 %9 to i32
store i32 %10, i32* %7
%11 = load i64, i64* %3
%12 = ashr i64 %11, 3
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i32
store i32 %14, i32* %6
%15 = load i64, i64* %3
%16 = ashr i64 %15, 11
%17 = and i64 %16, 7
%18 = trunc i64 %17 to i32
store i32 %18, i32* %5
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%01d-%03d-%01d\00"
define void @pc2str(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i32
%4 = and i32 %3, 7
%5 = lshr i32 %3, 3
%6 = and i32 %5, 255
%7 = lshr i32 %3, 11
%8 = and i32 %7, 7
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %6, i32 %4)
ret void
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_toggle_26() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 0;
  unsigned int d = exynos_5410_gpio_read(bank_offset);
  d ^= (1U << bit_index);
  exynos_5410_gpio_write_mask(bank_offset, d, (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_toggle_26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exynos_5410_gpio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_toggle_26>:
push   %rax
mov    $0xc40,%edi
call   1040 <exynos_5410_gpio_read@plt>
xor    $0x1,%eax
mov    $0xc40,%edi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_toggle_26() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3136, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @exynos_5410_gpio_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = call i32 @exynos_5410_gpio_write_mask(i32 %10, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_toggle_26() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = xor i32 %1, 1
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_cfg_presence_req_params_usage(void) {
  printf(
      "Usage : wfd_cfg_presence_req_params [<type> <duration> <interval>]\n");
  printf("      : Type 1: preferred values, 2: acceptable values.\n");
  printf("If presence request parameters are provided, "
         " 'set' is performed otherwise 'get' is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wfd_cfg_presence_req_params_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Usage : wfd_cfg_presence_req_params [<type> <duration> <interval>]\0A\00"
@.str.1 = [57 x i8] c" : Type 1: preferred values, 2: acceptable values.\0A\00"
@.str.2 = [96 x i8] c"If presence request parameters are provided, 'set' is performed otherwise 'get' is performed.\0A\00"
define void @print_wfd_cfg_presence_req_params_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"Usage : wfd_cfg_presence_req_params [<type> <duration> <interval>]\00"
@str.3 = [56 x i8] c" : Type 1: preferred values, 2: acceptable values.\00"
@str.4 = [95 x i8] c"If presence request parameters are provided, 'set' is performed otherwise 'get' is performed.\00"
define void @print_wfd_cfg_presence_req_params_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str.4, i64 0, i64 0))
ret void
}
unsigned short int f29(unsigned short int x, unsigned int y) {
  return (x >> ((-y) & (8 * sizeof(unsigned short) - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f29>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,%ecx
and    $0xf,%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f29>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f29(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 0, %7
%9 = zext i32 %8 to i64
%10 = and i64 %9, 15
%11 = trunc i64 %10 to i32
%12 = ashr i32 %6, %11
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = load i32, i32* %4
%16 = shl i32 %14, %15
%17 = xor i32 %12, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f29(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub i32 0, %1
%5 = and i32 %4, 15
%6 = lshr i32 %3, %5
%7 = shl i32 %3, %1
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
int chkdigit(c)
int c;
{ return ((c >= '0') && (c <= '9')) ? 1 : 0; }


x86 assembly (clang, -O0):
<chkdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <chkdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @chkdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @chkdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int V1 = 9 + 7;
  printf("%d\n", V1);
}


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

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

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

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

/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void copyString(char *dest, const char *src) {
  int dest_size = sizeof(dest);
  bool null_ending_needed = (dest_size <= (strlen(src) + 1));
  strncpy(dest, src, dest_size);
  if (true == null_ending_needed)
    dest[dest_size - 1] = '\0';
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    $0x1,%eax
cmp    -0x18(%rbp),%eax
jne    118a <copyString+0x6a>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
cmp    $0x7,%ebp
jl     114e <copyString+0x2e>
movb   $0x0,0x7(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @copyString(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp sgt i32 %3, 6
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i32 8)
br i1 %4, label %6, label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 7
store i8 0, i8* %7
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, float, float);
int /*<<< orphan*/ printfail();
void expectf(float a, float b) {
  if (!(a == b)) {
    printfail();
    printf("\n  %f expected, but got %f\n", a, b);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<expectf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    115c <expectf+0x2c>
jp     115c <expectf+0x2c>
jmp    1183 <expectf+0x53>
mov    $0x0,%al
call   1040 <printfail@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expectf>:
ucomiss %xmm1,%xmm0
jne    1138 <expectf+0x8>
jp     1138 <expectf+0x8>
ret
push   %rax
xor    %eax,%eax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
call   1040 <printfail@plt>
lea    0xeae(%rip),%rdi
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0A %f expected, but got %f\0A\00"
define void @expectf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = call i32 (...) @printfail()
%10 = load float, float* %3
%11 = load float, float* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float %10, float %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A %f expected, but got %f\0A\00"
define void @expectf(float %0, float %1) {
%3 = fcmp oeq float %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (...) @printfail()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float %0, float %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, char *, int);
void assert_failed(char *file, int line) {
  const char ASSERT_FAILED_STR[] = "Assertion failed in %s at line %d\n";
  printf(ASSERT_FAILED_STR, file, line);
}


x86 assembly (clang, -O0):
<assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x23,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_failed>:
sub    $0x28,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xa6425,0x1f(%rsp)
mov    %rsp,%rdi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.assert_failed.ASSERT_FAILED_STR = [35 x i8] c"Assertion failed in %s at line %d\0A\00"
define void @assert_failed(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [35 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [35 x i8]* %5 to i8*
%7 = getelementptr inbounds [35 x i8], [35 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@__const.assert_failed.ASSERT_FAILED_STR = [35 x i8] c"Assertion failed in %s at line %d\0A\00"
define void @assert_failed(i8* %0, i32 %1) {
%3 = alloca [35 x i8]
%4 = getelementptr inbounds [35 x i8], [35 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* %4, i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_regularfile(const char *path) {
  struct stat info;
  if (stat(path, &info) != 0)
    return 0;
  return S_ISREG(info.st_mode);
}


x86 assembly (clang, -O0):
<is_regularfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     114f <is_regularfile+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_regularfile+0x3a>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_regularfile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_regularfile+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_regularfile(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ U3_TxPutsf(char *);
int Restart(char *buf) {
  U3_TxPutsf("restart\r\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<Restart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <U3_TxPutsf@plt>
jmp    1128 <Restart+0x18>

x86 assembly (clang, -O2):
<Restart>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <U3_TxPutsf@plt>
nopl   (%rax)
jmp    1120 <Restart+0x10>

LLVM IR (-O0):
@.str = [10 x i8] c"restart\0D\0A\00"
define i32 @Restart(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @U3_TxPutsf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"restart\0D\0A\00"
define i32 @Restart(i8* nocapture readnone %0) {
%2 = tail call i32 @U3_TxPutsf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
double d2d(double);
__attribute__((__visibility__("default"))) __attribute__((used)) double
rd2d(double *x) {
  return d2d(*x);
}


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

x86 assembly (clang, -O2):
<rd2d>:
movsd  (%rdi),%xmm0
jmp    1030 <d2d@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (double (double*)* @rd2d to i8*)], section "llvm.metadata"
define double @rd2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @d2d(double %4)
ret double %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (double (double*)* @rd2d to i8*)], section "llvm.metadata"
define double @rd2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @d2d(double %2)
ret double %3
}
const char *Exception_Name(void) { return "Exception"; }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Exception\00"
define i8* @Exception_Name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
float power(float a, float b) {
  float x = a;
  for (float i = 1; i < b; i++) {
    a = a * x;
  }
  return a;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    115e <power+0x5e>
movss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xeb1(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1125 <power+0x25>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
ucomiss 0xef9(%rip),%xmm1
jbe    1131 <power+0x31>
movss  0xeef(%rip),%xmm3
movaps %xmm3,%xmm4
movaps %xmm0,%xmm2
nopw   0x0(%rax,%rax,1)
mulss  %xmm0,%xmm2
addss  %xmm3,%xmm4
ucomiss %xmm4,%xmm1
ja     1120 <power+0x20>
movaps %xmm2,%xmm0
ret
movaps %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @power(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
store float %7, float* %5
store float 1.000000e+00, float* %6
br label %8
8: ; preds = %16, %2
%9 = load float, float* %6
%10 = load float, float* %4
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load float, float* %3
%14 = load float, float* %5
%15 = fmul float %13, %14
store float %15, float* %3
br label %16
16: ; preds = %12
%17 = load float, float* %6
%18 = fadd float %17, 1.000000e+00
store float %18, float* %6
br label %8
19: ; preds = %8
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @power(float %0, float %1) {
%3 = fcmp ogt float %1, 1.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi float [ %0, %2 ], [ %9, %6 ]
ret float %5
6: ; preds = %2, %6
%7 = phi float [ %10, %6 ], [ 1.000000e+00, %2 ]
%8 = phi float [ %9, %6 ], [ %0, %2 ]
%9 = fmul float %8, %0
%10 = fadd float %7, 1.000000e+00
%11 = fcmp olt float %10, %1
br i1 %11, label %6, label %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int write(int, char *, int);
void putblk(char *blk, int len) {
  int rslt;
  rslt = write(1, blk, len);
  if (rslt != len) {
    fprintf(stderr, "putblk: write error\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<putblk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     117e <putblk+0x4e>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putblk>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
mov    $0x1,%edi
mov    %ebx,%edx
call   1030 <write@plt>
cmp    %ebx,%eax
jne    1148 <putblk+0x18>
pop    %rbx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"putblk: write error\0A\00"
define void @putblk(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @write(i32 1, i8* %0, i32 %1)
%4 = icmp eq i32 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int command(char *);
int /*<<< orphan*/ pop_done();
int pop_quit(void) {
  int i;
  i = command("QUIT");
  pop_done();
  return i;
}


x86 assembly (clang, -O0):
<pop_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <command@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pop_done@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_quit>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <command@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <pop_done@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"QUIT\00"
define i32 @pop_quit() {
%1 = tail call i32 @command(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @pop_done()
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
double get_user_time() {
  struct rusage ru;
  getrusage(RUSAGE_SELF, &ru);
  return ((double)ru.ru_utime.tv_sec) +
         ((double)ru.ru_utime.tv_usec) / 1000000.0;
}


x86 assembly (clang, -O0):
<get_user_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_time>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <getrusage@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
@RUSAGE_SELF = global i32 0
define double @get_user_time() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+06
%13 = fadd double %7, %12
ret double %13
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
@RUSAGE_SELF = global i32 0
define double @get_user_time() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %11, %7
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ foo2();
void __attribute__((no)) bar2() {
  volatile int tmp = 42;
  (void)tmp;
  foo2();
}


x86 assembly (clang, -O0):
<bar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x0,%al
call   1030 <foo2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar2>:
movl   $0x2a,-0x4(%rsp)
mov    -0x4(%rsp),%eax
xor    %eax,%eax
jmp    1030 <foo2@plt>

LLVM IR (-O0):
define void @bar2() {
%1 = alloca i32
store volatile i32 42, i32* %1
%2 = load volatile i32, i32* %1
%3 = call i32 (...) @foo2()
ret void
}

LLVM IR (-O2):
define void @bar2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 42, i32* %1
%3 = load volatile i32, i32* %1
%4 = tail call i32 (...) @foo2()
ret void
}
void page_tracker_set_tracker(struct page *page, int order) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @page_tracker_set_tracker(%struct.page* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int ULONG_MAX;
int /*<<< orphan*/ to_and_from_long(int);
int main() {
  to_and_from_long(0x8877665544332211);
  to_and_from_long(ULONG_MAX);
  return 0;
}


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

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

LLVM IR (-O0):
@ULONG_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @to_and_from_long(i32 1144201745)
%3 = load i32, i32* @ULONG_MAX
%4 = call i32 @to_and_from_long(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@ULONG_MAX = global i32 0
define i32 @main() {
%1 = tail call i32 @to_and_from_long(i32 1144201745)
%2 = load i32, i32* @ULONG_MAX
%3 = tail call i32 @to_and_from_long(i32 %2)
ret i32 0
}
void __attribute__((section(".after_vectors"))) NMI_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @NMI_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @NMI_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int tolower(char);
unsigned ichash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = tolower(*s) + 31 * hashval;
  return hashval % 101;
}


x86 assembly (clang, -O0):
<ichash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <ichash+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <ichash+0x13>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ichash>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     116e <ichash+0x5e>
mov    %rdi,%r14
add    $0x1,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %ebx,%ecx
shl    $0x5,%ecx
sub    %ebx,%ecx
mov    %ecx,%ebx
add    %eax,%ebx
movzbl (%r14),%eax
add    $0x1,%r14
test   %al,%al
jne    1130 <ichash+0x20>
mov    %ebx,%eax
imul   $0x446f8657,%rax,%rax
shr    $0x20,%rax
mov    %ebx,%ecx
sub    %eax,%ecx
shr    %ecx
add    %eax,%ecx
shr    $0x6,%ecx
imul   $0x65,%ecx,%eax
sub    %eax,%ebx
jmp    1170 <ichash+0x60>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ichash(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 i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = tail call i32 @tolower(i8 signext %5)
%9 = mul i32 %6, 31
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ rad(int);
int sin(int /*<<< orphan*/);
int degToClockY(int degree, int r) { return r * sin(rad(degree)); }


x86 assembly (clang, -O0):
<degToClockY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<degToClockY>:
push   %rbx
mov    %esi,%ebx
call   1040 <rad@plt>
mov    %eax,%edi
call   1030 <sin@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @degToClockY(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @rad(i32 %6)
%8 = call i32 @sin(i32 %7)
%9 = mul nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @degToClockY(i32 %0, i32 %1) {
%3 = tail call i32 @rad(i32 %0)
%4 = tail call i32 @sin(i32 %3)
%5 = mul nsw i32 %4, %1
ret i32 %5
}