xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ roadmap_trip_resume();
void roadmap_start_trip_resume(void) { roadmap_trip_resume(); }


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

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

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

LLVM IR (-O2):
define void @roadmap_start_trip_resume() {
%1 = tail call i32 (...) @roadmap_trip_resume()
ret void
}
unsigned char ascii_to_ch(unsigned char c) {
  if (c < 32)
    return 0;
  if (c > 63)
    return 0;
  return (c - 32);
}


x86 assembly (clang, -O0):
<ascii_to_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jge    1120 <ascii_to_ch+0x20>
movb   $0x0,-0x1(%rbp)
jmp    1140 <ascii_to_ch+0x40>
movzbl -0x2(%rbp),%eax
cmp    $0x3f,%eax
jle    1136 <ascii_to_ch+0x36>
movb   $0x0,-0x1(%rbp)
jmp    1140 <ascii_to_ch+0x40>
movzbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_to_ch>:
mov    %edi,%eax
and    $0xe0,%al
add    $0xe0,%dil
xor    %ecx,%ecx
cmp    $0x20,%al
movzbl %dil,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @ascii_to_ch(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %2
br label %18
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp sgt i32 %10, 63
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 0, i8* %2
br label %18
13: ; preds = %8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = sub nsw i32 %15, 32
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %13, %12, %7
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @ascii_to_ch(i8 zeroext %0) {
%2 = and i8 %0, -32
%3 = icmp eq i8 %2, 32
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ sayHello(char *);
int main(int argc, char *argv[]) {
  sayHello(argv[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    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <sayHello@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <sayHello@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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @sayHello(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @sayHello(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 10;
  int height;
  printf("I am %d years old. \n");
  printf("I am %d inche tall. \n", height);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"I am %d years old. \0A\00"
@.str.1 = [22 x i8] c"I am %d inche tall. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"I am %d years old. \0A\00"
@.str.1 = [22 x i8] c"I am %d inche tall. \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
void foo260() {}


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

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

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

LLVM IR (-O2):
define void @foo260() {
ret void
}
int test_imm_C3int16_mem(short *val) {
  return ((*val) & (0xC3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C3int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 195
%7 = icmp ne i32 %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_C3int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 195
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("foo1\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"foo1\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
int main(void) {
  int a = 6, b = 9, c = 14, flag = 1;
  c == a + b || !flag;
  a != 7 && flag || c >= 6;
  !(b <= 12) && a % 2 == 0;
  !(a > 5 || c < a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0xe,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
je     1149 <main+0x49>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
cmpl   $0x7,-0x8(%rbp)
je     1165 <main+0x65>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x16(%rbp)
jne    116f <main+0x6f>
cmpl   $0x6,-0x10(%rbp)
setge  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
xor    %eax,%eax
cmpl   $0xc,-0xc(%rbp)
mov    %al,-0x17(%rbp)
jle    1195 <main+0x95>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x17(%rbp)
mov    -0x17(%rbp),%al
mov    $0x1,%al
cmpl   $0x5,-0x8(%rbp)
mov    %al,-0x18(%rbp)
jg     11b8 <main+0xb8>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x18(%rbp)
mov    -0x18(%rbp),%al
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
store i32 9, i32* %3
store i32 14, i32* %4
store i32 1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = icmp eq i32 %6, %9
br i1 %10, label %15, label %11
11: ; preds = %0
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %11, %0
%16 = phi i1 [ true, %0 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 7
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20, %15
%24 = load i32, i32* %4
%25 = icmp sge i32 %24, 6
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ true, %20 ], [ %25, %23 ]
%28 = zext i1 %27 to i32
%29 = load i32, i32* %3
%30 = icmp sle i32 %29, 12
br i1 %30, label %35, label %31
31: ; preds = %26
%32 = load i32, i32* %2
%33 = srem i32 %32, 2
%34 = icmp eq i32 %33, 0
br label %35
35: ; preds = %31, %26
%36 = phi i1 [ false, %26 ], [ %34, %31 ]
%37 = zext i1 %36 to i32
%38 = load i32, i32* %2
%39 = icmp sgt i32 %38, 5
br i1 %39, label %46, label %40
40: ; preds = %35
%41 = load i32, i32* %4
%42 = load i32, i32* %2
%43 = load i32, i32* %3
%44 = add nsw i32 %42, %43
%45 = icmp slt i32 %41, %44
br label %46
46: ; preds = %40, %35
%47 = phi i1 [ true, %35 ], [ %45, %40 ]
%48 = xor i1 %47, true
%49 = zext i1 %48 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int skip_atoi(const char **s) {
  int i = 0;
  while (((**s) >= '0' && (**s) <= '9'))
    i = i * 10 + *((*s)++) - '0';
  return i;
}


x86 assembly (clang, -O0):
<skip_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     113a <skip_atoi+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <skip_atoi+0x4a>
jmp    116f <skip_atoi+0x6f>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <skip_atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_atoi>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
add    $0xd0,%dl
xor    %eax,%eax
cmp    $0x9,%dl
ja     113f <skip_atoi+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rax,%rax,4),%eax
mov    %rcx,(%rdi)
movsbl -0x1(%rcx),%edx
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rcx),%edx
add    $0xd0,%dl
add    $0x1,%rcx
cmp    $0xa,%dl
jb     1120 <skip_atoi+0x20>
ret

LLVM IR (-O0):
define i32 @skip_atoi(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %10, %4
%17 = phi i1 [ false, %4 ], [ %15, %10 ]
br i1 %17, label %18, label %28
18: ; preds = %16
%19 = load i32, i32* %3
%20 = mul nsw i32 %19, 10
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %21
%24 = load i8, i8* %22
%25 = sext i8 %24 to i32
%26 = add nsw i32 %20, %25
%27 = sub nsw i32 %26, 48
store i32 %27, i32* %3
br label %4
28: ; preds = %16
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @skip_atoi(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %2, %1 ]
%8 = phi i32 [ %14, %6 ], [ 0, %1 ]
%9 = mul nsw i32 %8, 10
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %10, i8** %0
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = add i32 %9, -48
%14 = add i32 %13, %12
%15 = load i8, i8* %10
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %14, %6 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_max_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test28(__m64 a, __m64 b) { return _mm_max_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test28>:
jmp    1030 <_mm_max_pu8@plt>

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

LLVM IR (-O2):
define i32 @test28(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_pu8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_50() {
  Assert_real((isqrt(50) == 7),
              "/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/stdlib/isqrt.c",
              255, ("Integer square root of 50 should be 7"));
}


x86 assembly (clang, -O0):
<t_sqrt_50>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1030 <isqrt@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xff,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_50>:
push   %rax
mov    $0x32,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xff,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 50 should be 7\00"
define void @t_sqrt_50() {
%1 = call i32 @isqrt(i32 50)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 50 should be 7\00"
define void @t_sqrt_50() {
%1 = tail call i32 @isqrt(i32 50)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void free_parameters_II(int num_parameters, char ***parameters) {
  int i = 0;
  for (i = 0; i < num_parameters; i++)
    free((*parameters)[i]);
  free((*parameters));
}


x86 assembly (clang, -O0):
<free_parameters_II>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <free_parameters_II+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <free_parameters_II+0x1d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_parameters_II>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1145 <free_parameters_II+0x35>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_parameters_II+0x20>
mov    (%r14),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_parameters_II(i32 %0, i8*** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = load i8**, i8*** %1
%9 = getelementptr inbounds i8*, i8** %8, i64 %7
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i8*** %1 to i8**
%15 = load i8*, i8** %14
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__8__GeneralIO__set();
void LedsP__Led1__set(void) { Msp430GpioC__8__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__set() {
%1 = tail call i32 (...) @Msp430GpioC__8__GeneralIO__set()
ret void
}
int isgraph(const int c) { return c >= 0x21 && c <= 0x7E; }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isgraph+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double atan(double);
double hl_math_atan(double a) { return atan(a); }


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

x86 assembly (clang, -O2):
<hl_math_atan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @hl_math_atan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char const *);
double strtod(char const *, char **);
double parse_double(const char *string) {
  double val;
  char *parse_end;
  val = strtod(string, &parse_end);
  if (parse_end == string)
    fatal_error("Invalid number: %s", string);
  return val;
}


x86 assembly (clang, -O0):
<parse_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    115c <parse_double+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <fatal_error@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_double>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <strtod@plt>
cmp    %rbx,0x8(%rsp)
jne    1152 <parse_double+0x32>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
movsd  %xmm0,(%rsp)
call   1040 <fatal_error@plt>
movsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Invalid number: %s\00"
define double @parse_double(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call double @strtod(i8* %5, i8** %4)
store double %6, double* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %2
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @fatal_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %1
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"Invalid number: %s\00"
define double @parse_double(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call double @strtod(i8* %0, i8** %2)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @fatal_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
ret double %4
}
/* Variables and functions */
unsigned int toint(int /*<<< orphan*/);
unsigned int htoi(char *s) {
  unsigned int sum = 0;
  while (*s) {
    sum = sum * 16 + toint(*s++);
  }
  return (sum);
}


x86 assembly (clang, -O0):
<htoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <htoi+0x4f>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <toint@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <htoi+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htoi>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114a <htoi+0x3a>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
shl    $0x4,%ebp
movsbl %al,%edi
call   1030 <toint@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <htoi+0x20>
jmp    114c <htoi+0x3c>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @htoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 4
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = tail call i32 @toint(i32 %10)
%12 = add i32 %11, %8
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long long f4(unsigned long long x,
                                                   unsigned long long y) {
  unsigned long long r = x + y;
  if (x >= r)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1141 <f4+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rbx
mov    %rsi,%rbx
add    %rdi,%rbx
cmp    %rdi,%rbx
ja     1123 <f4+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f4(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ugt i64 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
void Controls() {}


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

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

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

LLVM IR (-O2):
define void @Controls() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setbitu(unsigned char *, int, int, unsigned int);
extern void setbits(unsigned char *buff, int pos, int len, int data) {
  if (data < 0)
    data |= 1 << (len - 1);
  else
    data &= ~(1 << (len - 1));
  setbitu(buff, pos, len, (unsigned int)data);
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1147 <setbits+0x37>
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    115d <setbits+0x4d>
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <setbitu@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
lea    -0x1(%rdx),%r8d
mov    %ecx,%r9d
bts    %r8d,%r9d
mov    %ecx,%eax
btr    %r8d,%eax
test   %ecx,%ecx
cmovs  %r9d,%eax
mov    %eax,%ecx
jmp    1030 <setbitu@plt>

LLVM IR (-O0):
define void @setbits(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load i32, i32* %7
%13 = sub nsw i32 %12, 1
%14 = shl i32 1, %13
%15 = load i32, i32* %8
%16 = or i32 %15, %14
store i32 %16, i32* %8
br label %24
17: ; preds = %4
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = shl i32 1, %19
%21 = xor i32 %20, -1
%22 = load i32, i32* %8
%23 = and i32 %22, %21
store i32 %23, i32* %8
br label %24
24: ; preds = %17, %11
%25 = load i8*, i8** %5
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = call i32 @setbitu(i8* %25, i32 %26, i32 %27, i32 %28)
ret void
}

LLVM IR (-O2):
define void @setbits(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, 0
%6 = add nsw i32 %2, -1
%7 = shl nuw i32 1, %6
%8 = or i32 %7, %3
%9 = xor i32 %7, -1
%10 = and i32 %9, %3
%11 = select i1 %5, i32 %8, i32 %10
%12 = tail call i32 @setbitu(i8* %0, i32 %1, i32 %2, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: ... | cts [-l]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: ... | cts [-l]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: ... | cts [-l]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_mday;
  int tm_mon;
  int tm_year;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t mytime;
  mytime = time(NULL);
  struct tm tm = *localtime(&mytime);
  printf("Data: %d/%d/%d\n", tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
add    $0x76c,%ecx
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
add    $0x1,%edx
mov    $0x76c,%ecx
add    0x8(%rax),%ecx
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"Data: %d/%d/%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = bitcast %struct.tm* %2 to i8*
%6 = bitcast %struct.tm* %4 to i8*
%7 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
%12 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 2
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1900
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11, i32 %14)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"Data: %d/%d/%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%10 = load i32, i32* %9
%11 = add nsw i32 %8, 1
%12 = add nsw i32 %10, 1900
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %11, i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ym_free(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<ym_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ym_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ym_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NW_ShellExc(char *);
void NW_InquireNat(void) { NW_ShellExc("cat /proc/net/ip_conntrack"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"cat /proc/net/ip_conntrack\00"
define void @NW_InquireNat() {
%1 = call i32 @NW_ShellExc(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"cat /proc/net/ip_conntrack\00"
define void @NW_InquireNat() {
%1 = tail call i32 @NW_ShellExc(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
void INT_Excep_TPU6_TGI6A(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU6_TGI6A() {
ret void
}
int map_value(int value, int levels) {
  int factor = 256 / levels;
  int mapped_value = value / factor;
  return mapped_value;
}


x86 assembly (clang, -O0):
<map_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x100,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_value>:
mov    $0x100,%eax
xor    %edx,%edx
idiv   %esi
mov    %eax,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @map_value(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
%7 = load i32, i32* %4
%8 = sdiv i32 256, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = sdiv i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @map_value(i32 %0, i32 %1) {
%3 = sdiv i32 256, %1
%4 = sdiv i32 %0, %3
ret i32 %4
}
/* Variables and functions */
int rand();
int RandomInt(int min, int max) {
  if (min > max) {
    return 0;
  } else {
    return min + rand() % ((max + 1) - min);
  }
}


x86 assembly (clang, -O0):
<RandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1136 <RandomInt+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1157 <RandomInt+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInt>:
xor    %eax,%eax
cmp    %esi,%edi
jg     1136 <RandomInt+0x26>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
mov    %edx,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RandomInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 (...) @rand()
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = srem i32 %12, %16
%18 = add nsw i32 %11, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %10, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @RandomInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 (...) @rand()
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = srem i32 %5, %7
%9 = add nsw i32 %8, %0
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
int unknown1() {
  int x;
  return x;
}


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

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

LLVM IR (-O0):
define i32 @unknown1() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @unknown1() {
ret i32 undef
}
/* Type definitions */
struct timeb {
  int time;
  unsigned int millitm;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
unsigned int epoch_millitm(void) {
  struct timeb t;
  ftime(&t);
  return (t.time * 1000) + t.millitm;
}


x86 assembly (clang, -O0):
<epoch_millitm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <ftime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoch_millitm>:
push   %rax
mov    %rsp,%rdi
call   1030 <ftime@plt>
imul   $0x3e8,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeb = type { i32, i32 }
define i32 @epoch_millitm() {
%1 = alloca %struct.timeb
%2 = call i32 @ftime(%struct.timeb* %1)
%3 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeb = type { i32, i32 }
define i32 @epoch_millitm() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add i32 %6, %8
ret i32 %9
}
/* Variables and functions */
char *strchr(char *, char);
void replace_backslash_with_slash(char *s1) {
  char *ptr;
  if (!s1)
    return;
  while ((ptr = strchr(s1, '\\'))) {
    ptr[0] = '/';
    s1 = &ptr[1];
  }
  return;
}


x86 assembly (clang, -O0):
<replace_backslash_with_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <replace_backslash_with_slash+0x1c>
jmp    116a <replace_backslash_with_slash+0x5a>
jmp    1131 <replace_backslash_with_slash+0x21>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1165 <replace_backslash_with_slash+0x55>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <replace_backslash_with_slash+0x21>
jmp    116a <replace_backslash_with_slash+0x5a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_backslash_with_slash>:
push   %rax
test   %rdi,%rdi
je     113b <replace_backslash_with_slash+0x2b>
cs nopw 0x0(%rax,%rax,1)
mov    $0x5c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <replace_backslash_with_slash+0x2b>
movb   $0x2f,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
jmp    1120 <replace_backslash_with_slash+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @replace_backslash_with_slash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %18
7: ; preds = %1
br label %8
8: ; preds = %12, %7
%9 = load i8*, i8** %2
%10 = call i8* @strchr(i8* %9, i8 signext 92)
store i8* %10, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 47, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %8
17: ; preds = %8
br label %18
18: ; preds = %17, %6
ret void
}

LLVM IR (-O2):
define void @replace_backslash_with_slash(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 92)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %4, %3 ]
store i8 47, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %8, i8 signext 92)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
void *test_anti_range_113(int n) {
  extern void *alloc_anti_range_113(int) __attribute__((alloc_size(1)));
  if ((-0x7fffffff - 1) + 2 <= n && n <= -1)
    n = (-0x7fffffff - 1) + 2 - 1;
  return alloc_anti_range_113(n);
}


x86 assembly (clang, -O0):
<test_anti_range_113>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000002,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_113+0x2a>
cmpl   $0xffffffff,-0x4(%rbp)
jg     113a <test_anti_range_113+0x2a>
movl   $0x80000001,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_113@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_113>:
cmp    $0x80000001,%edi
mov    $0x80000001,%eax
cmovae %eax,%edi
jmp    1030 <alloc_anti_range_113@plt>

LLVM IR (-O0):
define i8* @test_anti_range_113(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -2147483647, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_113(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_113(i32 %0) {
%2 = icmp ult i32 %0, -2147483647
%3 = select i1 %2, i32 %0, i32 -2147483647
%4 = tail call i8* @alloc_anti_range_113(i32 %3)
ret i8* %4
}
void sgx_ocall() {}


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

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

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

LLVM IR (-O2):
define void @sgx_ocall() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearIntegerArray(int *, int);
int /*<<< orphan*/ CountLetters(int *);
int /*<<< orphan*/ DisplayLetterCounts(int *);
int /*<<< orphan*/ printf(char *);
main() {
  int letterCounts[26];
  printf("This program counts letter frequencies.\n");
  printf("Enter a blank line to signal end of input.\n");
  ClearIntegerArray(letterCounts, 26);
  CountLetters(letterCounts);
  DisplayLetterCounts(letterCounts);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x1a,%esi
call   1040 <ClearIntegerArray@plt>
lea    -0x70(%rbp),%rdi
call   1060 <CountLetters@plt>
lea    -0x70(%rbp),%rdi
call   1050 <DisplayLetterCounts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1a,%esi
call   1040 <ClearIntegerArray@plt>
mov    %rbx,%rdi
call   1060 <CountLetters@plt>
mov    %rbx,%rdi
call   1050 <DisplayLetterCounts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"This program counts letter frequencies.\0A\00"
@.str.1 = [44 x i8] c"Enter a blank line to signal end of input.\0A\00"
define i32 @main() {
%1 = alloca [26 x i32]
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 0
%5 = call i32 @ClearIntegerArray(i32* %4, i32 26)
%6 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 0
%7 = call i32 @CountLetters(i32* %6)
%8 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 0
%9 = call i32 @DisplayLetterCounts(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@str = [40 x i8] c"This program counts letter frequencies.\00"
@str.2 = [43 x i8] c"Enter a blank line to signal end of input.\00"
define i32 @main() {
%1 = alloca [26 x i32]
%2 = bitcast [26 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0))
%5 = getelementptr inbounds [26 x i32], [26 x i32]* %1, i64 0, i64 0
%6 = call i32 @ClearIntegerArray(i32* %5, i32 26)
%7 = call i32 @CountLetters(i32* %5)
%8 = call i32 @DisplayLetterCounts(i32* %5)
ret i32 0
}
extern long long PassLongLong(long long *llg) { return *llg; }


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

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

LLVM IR (-O0):
define i64 @PassLongLong(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @PassLongLong(i64* nocapture %0) {
%2 = load i64, i64* %0
ret i64 %2
}
int Max(int ln, int rn) { return ln > rn ? ln : rn; }


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <Max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}