xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void donothing() {
  int local;
  printf("\nAddress of integer local is 0x%lx\n", &local);
  return;
}


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

x86 assembly (clang, -O2):
<donothing>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0AAddress of integer local is 0x%lx\0A\00"
define void @donothing() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0AAddress of integer local is 0x%lx\0A\00"
define void @donothing() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void getFormattedTime(char *buffer, int bufferSize) {
  time_t curTime = time(NULL);
  strftime(buffer, bufferSize, "Date: %a, %d %b %Y %H:%M:%S %Z",
           localtime(&curTime));
}


x86 assembly (clang, -O0):
<getFormattedTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%ecx
lea    0xe8e(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFormattedTime>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Date: %a, %d %b %Y %H:%M:%S %Z\00"
define void @getFormattedTime(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @time(i32* null)
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @localtime(i32* %5)
%10 = call i32 @strftime(i8* %7, i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Date: %a, %d %b %Y %H:%M:%S %Z\00"
define void @getFormattedTime(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
int int_pow(int base, int exp) {
  int result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp /= 2;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<int_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1151 <int_pow+0x51>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <int_pow+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <int_pow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_pow>:
test   %esi,%esi
je     1142 <int_pow+0x42>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
imul   %edi,%edi
add    $0x1,%esi
cmp    $0x2,%esi
mov    %edx,%esi
ja     1120 <int_pow+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @int_pow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = mul nsw i32 %15, %14
store i32 %16, i32* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 2
store i32 %19, i32* %4
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = mul nsw i32 %21, %20
store i32 %22, i32* %3
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @int_pow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul nsw i32 %10, %5
%12 = sdiv i32 %6, 2
%13 = mul nsw i32 %7, %7
%14 = add i32 %6, 1
%15 = icmp ult i32 %14, 3
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %17
}
/* Type definitions */
struct MinHeapNode {
  int dummy;
};

/* Variables and functions */
struct MinHeapNode *buildHuffmanTree(char *, int *, int);
int /*<<< orphan*/ printCodes(struct MinHeapNode *, int *, int);
void HUFFMAN(char data[], int freq[], int size) {
  struct MinHeapNode *root = buildHuffmanTree(data, freq, size);
  int arr[1000000], top = 0;
  printCodes(root, arr, top);
}


x86 assembly (clang, -O0):
<HUFFMAN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0930,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <buildHuffmanTree@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x3d0924(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x3d0920(%rbp),%rsi
mov    -0x3d0924(%rbp),%edx
call   1030 <printCodes@plt>
add    $0x3d0930,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HUFFMAN>:
sub    $0x3d0908,%rsp
call   1040 <buildHuffmanTree@plt>
mov    %rsp,%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1030 <printCodes@plt>
add    $0x3d0908,%rsp
ret

LLVM IR (-O0):
%struct.MinHeapNode = type { i32 }
define void @HUFFMAN(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca %struct.MinHeapNode*
%8 = alloca [1000000 x i32]
%9 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = call %struct.MinHeapNode* @buildHuffmanTree(i8* %10, i32* %11, i32 %12)
store %struct.MinHeapNode* %13, %struct.MinHeapNode** %7
store i32 0, i32* %9
%14 = load %struct.MinHeapNode*, %struct.MinHeapNode** %7
%15 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %8, i64 0, i64 0
%16 = load i32, i32* %9
%17 = call i32 @printCodes(%struct.MinHeapNode* %14, i32* %15, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.MinHeapNode = type { i32 }
define void @HUFFMAN(i8* %0, i32* %1, i32 %2) {
%4 = alloca [1000000 x i32]
%5 = tail call %struct.MinHeapNode* @buildHuffmanTree(i8* %0, i32* %1, i32 %2)
%6 = bitcast [1000000 x i32]* %4 to i8*
%7 = getelementptr inbounds [1000000 x i32], [1000000 x i32]* %4, i64 0, i64 0
%8 = call i32 @printCodes(%struct.MinHeapNode* %5, i32* %7, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g();
int /*<<< orphan*/ h();
main() {
  g();
  h();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @g()
%2 = tail call i32 (...) @h()
ret i32 0
}
int getkey(char c) {
  if (c == '\'')
    return 26;
  return (c - 'a');
}


x86 assembly (clang, -O0):
<getkey>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x27,%eax
jne    1123 <getkey+0x23>
movl   $0x1a,-0x4(%rbp)
jmp    112d <getkey+0x2d>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkey>:
lea    -0x61(%rdi),%ecx
cmp    $0x27,%dil
mov    $0x1a,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getkey(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 39
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 26, i32* %2
br label %12
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %10, 97
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @getkey(i8 signext %0) {
%2 = icmp eq i8 %0, 39
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -97
%5 = select i1 %2, i32 26, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sync();
int main(void) {
  sync();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sync()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler1(int signo) { printf("recieve signal : %d\n", signo); }


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

x86 assembly (clang, -O2):
<handler1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"recieve signal : %d\0A\00"
define void @handler1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void put2le(unsigned char **upp, int val) {
  *(*upp)++ = val;
  *(*upp)++ = val >> 8;
}


x86 assembly (clang, -O0):
<put2le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put2le>:
mov    %esi,%eax
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %ah,(%rcx)
ret

LLVM IR (-O0):
define void @put2le(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %7
store i8 %6, i8* %8
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %13
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @put2le(i8** nocapture %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
store i8 %3, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
store i8 %7, i8* %8
ret void
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int *, int, int, int *, int /*<<< orphan*/);
void test_second_base_is_one(void) {
  int8_t input[] = {1, 0, 1, 0, 1, 0};
  int8_t expected[] = {0};
  test_rebase(2, input, (sizeof(input) / sizeof(input[0])), 1, expected, 0);
}


x86 assembly (clang, -O0):
<test_second_base_is_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x24(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%r8
mov    $0x2,%edi
mov    $0x6,%edx
mov    $0x1,%ecx
xor    %r9d,%r9d
call   1040 <test_rebase@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_second_base_is_one>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%r8
mov    $0x2,%edi
mov    $0x6,%edx
mov    $0x1,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_second_base_is_one.input = [6 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0]
define void @test_second_base_is_one() {
%1 = alloca [6 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 2, i32* %5, i32 6, i32 1, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
@__const.test_second_base_is_one.input = [6 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0]
define void @test_second_base_is_one() {
%1 = alloca [6 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %5
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%7 = call i32 @test_rebase(i32 2, i32* %6, i32 6, i32 1, i32* %5, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_config_usage(void) {
  printf("\nUsage : wfd_config [CONFIG_FILE]\n");
  printf("\nIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is "
         "performed.\n");
  printf("CONFIG_FILE contains all WFD parameters.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"\0AUsage : wfd_config [CONFIG_FILE]\0A\00"
@.str.1 = [79 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
@.str.2 = [42 x i8] c"CONFIG_FILE contains all WFD parameters.\0A\00"
define void @print_wfd_config_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"\0AUsage : wfd_config [CONFIG_FILE]\00"
@str.3 = [78 x i8] c"\0AIf CONFIG_FILE is provided, a 'set' is performed, else a 'get' is performed.\00"
@str.4 = [41 x i8] c"CONFIG_FILE contains all WFD parameters.\00"
define void @print_wfd_config_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct packed_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pd_add_lstr(struct packed_data *, char const *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void pd_add_str(struct packed_data *pd, const char *s) {
  pd_add_lstr(pd, s, strlen(s));
}


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

x86 assembly (clang, -O2):
<pd_add_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pd_add_lstr@plt>

LLVM IR (-O0):
%struct.packed_data = type { i32 }
define void @pd_add_str(%struct.packed_data* %0, i8* %1) {
%3 = alloca %struct.packed_data*
%4 = alloca i8*
store %struct.packed_data* %0, %struct.packed_data** %3
store i8* %1, i8** %4
%5 = load %struct.packed_data*, %struct.packed_data** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @pd_add_lstr(%struct.packed_data* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.packed_data = type { i32 }
define void @pd_add_str(%struct.packed_data* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @pd_add_lstr(%struct.packed_data* %0, i8* %1, i32 %3)
ret void
}
RX0RX1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     114a <RX0RX1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <RX0RX1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0RX1>:
movslq %edx,%rax
mov    (%r8,%rax,1),%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,1),%dl
setle  %al
ret

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

LLVM IR (-O2):
define i32 @RX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = load i8, i8* %11
%13 = icmp sle i8 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
int test_imm_1Cuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x1C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Cuint64_highword_reg>:
movabs $0x1c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Cuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 28
%6 = icmp ne i64 %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_1Cuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 120259084288
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rtp2435q_set_length(uint8_t *header, uint16_t length) {
  header[2] = (length & 0xFF00) >> 8;
  header[3] = length & 0xFF;
}


x86 assembly (clang, -O0):
<rtp2435q_set_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435q_set_length>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x8(%rdi)
movzbl %al,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @rtp2435q_set_length(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 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @rtp2435q_set_length(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %4, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 0;
  printf("a = 0; a = %d\n", a);
  a++;
  printf("a++; a = %d\n", a);
  ++a;
  printf("++a; a = %d\n", a);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"a = 0; a = %d\0A\00"
@.str.1 = [13 x i8] c"a++; a = %d\0A\00"
@.str.2 = [13 x i8] c"++a; a = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"a = 0; a = %d\0A\00"
@.str.1 = [13 x i8] c"a++; a = %d\0A\00"
@.str.2 = [13 x i8] c"++a; a = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 2)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _main(long, char **);
int open(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void __attribute__((section(".init"))) _start() {
  long argc = 0;
  char *argv[1] = {0};
  int stdin = open("/obj/console", NULL, NULL);
  _main(argc, argv);
  int count = 0;
  for (;;) {
    count++;
  }
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
lea    0xfb9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   10b0 <_main@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x18(%rbp)
jmp    106a <_start+0x4a>
add    $0x8,%rsp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
movq   $0x0,(%rsp)
lea    0xfd0(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <open@plt>
mov    %rsp,%rsi
xor    %edi,%edi
call   1080 <_main@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1050 <_start+0x30>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/obj/console\00"
define void @_start() section ".init" {
%1 = alloca i64
%2 = alloca [1 x i8*]
%3 = alloca i32
%4 = alloca i32
store i64 0, i64* %1
%5 = bitcast [1 x i8*]* %2 to i8*
%6 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
store i32 %6, i32* %3
%7 = load i64, i64* %1
%8 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%9 = call i32 @_main(i64 %7, i8** %8)
store i32 0, i32* %4
br label %10
10: ; preds = %10, %0
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"/obj/console\00"
define void @_start() section ".init" {
%1 = alloca [1 x i8*]
%2 = bitcast [1 x i8*]* %1 to i8*
%3 = bitcast [1 x i8*]* %1 to i64*
store i64 0, i64* %3
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
%5 = getelementptr inbounds [1 x i8*], [1 x i8*]* %1, i64 0, i64 0
%6 = call i32 @_main(i64 0, i8** %5)
br label %7
7: ; preds = %7, %0
br label %7
}
/* Variables and functions */
int partition(int *, int, int);
void quicksort(int a[], int low, int high) {
  int mid;
  if (low < high) {
    mid = partition(a, low, high);
    quicksort(a, low, mid - 1);
    quicksort(a, mid + 1, high);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
__attribute__((always_)) void account_system_vtime(struct task_struct *tsk) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @account_system_vtime(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @account_system_vtime(%struct.task_struct* nocapture %0) {
ret void
}
int test26(int a, int b, int c, int d) {
  int x = a != b;
  int y = c != 0;
  return x - y;
}


x86 assembly (clang, -O0):
<test26>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test26>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
cmp    $0x1,%edx
adc    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @test26(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp ne i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = sub nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test26(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = zext i1 %5 to i32
%7 = icmp ne i32 %2, 0
%8 = sext i1 %7 to i32
%9 = add nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  sleep(15);
  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    $0xf,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @sleep(i32 15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep(i32 15)
ret i32 0
}
void coor_from_tiled(int *x, int *y) {
  *x = *x + (*y + 1) / 2;
  *y = -*y;
}


x86 assembly (clang, -O0):
<coor_from_tiled>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    $0x2,%esi
cltd
idiv   %esi
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<coor_from_tiled>:
mov    (%rsi),%eax
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
add    %eax,(%rdi)
negl   (%rsi)
ret

LLVM IR (-O0):
define void @coor_from_tiled(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = sdiv i32 %9, 2
%11 = add nsw i32 %6, %10
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sub nsw i32 0, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @coor_from_tiled(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %5, 2
%7 = add nsw i32 %6, %3
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = sub nsw i32 0, %8
store i32 %9, i32* %1
ret void
}
int memunlockall(void) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @memunlockall() {
ret i32 -1
}
/* Variables and functions */
int Gcd(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int M = 50;
  int N = 15;
  printf("Gcd(%d,%d)=%d\n", M, N, Gcd(M, N));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <Gcd@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x32,%edi
mov    $0xf,%esi
call   1040 <Gcd@plt>
lea    0xec9(%rip),%rdi
mov    $0x32,%esi
mov    $0xf,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Gcd(%d,%d)=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @Gcd(i32 50, i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 50, i32 15, i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ realloc(char **, unsigned int);
char **increase_tokens_array(char **tokens, unsigned int *tokens_length) {
  *tokens_length = *tokens_length + 1;
  tokens = (char **)realloc(tokens, *tokens_length * sizeof(char *));
  tokens[*tokens_length - 1] = NULL;
  return tokens;
}


x86 assembly (clang, -O0):
<increase_tokens_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increase_tokens_array>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
lea    0x8(,%rax,8),%esi
call   1030 <realloc@plt>
mov    (%rbx),%ecx
add    $0xffffffff,%ecx
movq   $0x0,(%rax,%rcx,8)
pop    %rbx
ret

LLVM IR (-O0):
define i8** @increase_tokens_array(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = add i32 %6, 1
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i8**, i8*** %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = zext i32 %11 to i64
%13 = mul i64 %12, 8
%14 = trunc i64 %13 to i32
%15 = call i64 @realloc(i8** %9, i32 %14)
%16 = inttoptr i64 %15 to i8**
store i8** %16, i8*** %3
%17 = load i8**, i8*** %3
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = sub i32 %19, 1
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %17, i64 %21
store i8* null, i8** %22
%23 = load i8**, i8*** %3
ret i8** %23
}

LLVM IR (-O2):
define i8** @increase_tokens_array(i8** %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add i32 %3, 1
store i32 %4, i32* %1
%5 = shl i32 %4, 3
%6 = tail call i64 @realloc(i8** %0, i32 %5)
%7 = inttoptr i64 %6 to i8**
%8 = load i32, i32* %1
%9 = add i32 %8, -1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %7, i64 %10
store i8* null, i8** %11
ret i8** %7
}
int dgtpicom_run(char lr, char rr) { return 0; }


x86 assembly (clang, -O0):
<dgtpicom_run>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dgtpicom_run(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @dgtpicom_run(i8 signext %0, i8 signext %1) {
ret i32 0
}
int hex2number(unsigned char c) {
  if (c > 'f')
    return (-1);
  else if (c > 'F')
    return (10 + c - 'a');
  else if (c > '9')
    return (10 + c - 'A');
  else
    return (c - '0');
}


x86 assembly (clang, -O0):
<hex2number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jle    1123 <hex2number+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <hex2number+0x6b>
movzbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jle    1142 <hex2number+0x42>
movzbl -0x5(%rbp),%eax
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <hex2number+0x6b>
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1161 <hex2number+0x61>
movzbl -0x5(%rbp),%eax
add    $0xa,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <hex2number+0x6b>
movzbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2number>:
mov    $0xffffffff,%eax
cmp    $0x66,%dil
ja     1126 <hex2number+0x26>
cmp    $0x47,%dil
jb     1116 <hex2number+0x16>
add    $0xffffffa9,%edi
jmp    1124 <hex2number+0x24>
cmp    $0x3a,%dil
jb     1121 <hex2number+0x21>
add    $0xffffffc9,%edi
jmp    1124 <hex2number+0x24>
add    $0xffffffd0,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hex2number(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sgt i32 %5, 102
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %30
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp sgt i32 %10, 70
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = add nsw i32 10, %14
%16 = sub nsw i32 %15, 97
store i32 %16, i32* %2
br label %30
17: ; preds = %8
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = icmp sgt i32 %19, 57
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = add nsw i32 10, %23
%25 = sub nsw i32 %24, 65
store i32 %25, i32* %2
br label %30
26: ; preds = %17
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = sub nsw i32 %28, 48
store i32 %29, i32* %2
br label %30
30: ; preds = %26, %21, %12, %7
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @hex2number(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ugt i8 %0, 102
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = icmp ugt i8 %0, 70
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = add nsw i32 %2, -87
br label %14
8: ; preds = %4
%9 = icmp ugt i8 %0, 57
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = add nsw i32 %2, -55
br label %14
12: ; preds = %8
%13 = add nsw i32 %2, -48
br label %14
14: ; preds = %1, %12, %10, %6
%15 = phi i32 [ %7, %6 ], [ %11, %10 ], [ %13, %12 ], [ -1, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sub();
void bye() {
  printf("Bye");
  sub();
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"Bye\00"
define void @bye() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @sub()
ret void
}
void dfn_ai(i) int i;
{}


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

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

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

LLVM IR (-O2):
define void @dfn_ai(i32 %0) {
ret void
}
long kernel__Bool__object_id(short int self) {
  long var;
  long var1;
  var1 = (long)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Bool__object_id>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Bool__object_id>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @kernel__Bool__object_id(i16 signext %0) {
%2 = alloca i16
%3 = alloca i64
%4 = alloca i64
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = sext i16 %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @kernel__Bool__object_id(i16 signext %0) {
%2 = sext i16 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ l34stat_test(unsigned int, int);
void l3stat_test(unsigned int addr) { l34stat_test(addr, 1); }


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

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

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

LLVM IR (-O2):
define void @l3stat_test(i32 %0) {
%2 = tail call i32 @l34stat_test(i32 %0, i32 1)
ret void
}
int test_imm_7Fint8_reg(signed char val) {
  return ((val) & (-0x7F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Fint8_reg>:
test   $0x81,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Fint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -127
%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_7Fint8_reg(i8 signext %0) {
%2 = and i8 %0, -127
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}