xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
int /*<<< orphan*/ stderr;
void assertError(int condition, unsigned long int number) {
  if (condition != -1) {
    fprintf(stderr, "Should raise error: %ld\n", number);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<assertError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1160 <assertError+0x40>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertError>:
cmp    $0xffffffff,%edi
jne    1126 <assertError+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Should raise error: %ld\0A\00"
@EXIT_FAILURE = global i32 0
define void @assertError(i32 %0, i64 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
void child_empty_handler(int signum) {}


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

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

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

LLVM IR (-O2):
define void @child_empty_handler(i32 %0) {
ret void
}
int test_imm_42int8_mem(signed char *val) {
  return ((*val) & (-0x42 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_42int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -66
%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_42int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -66
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int square(int);
int main(void) {
  printf("%d\n", square(5));
  return 0;
}


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

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

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

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

/* Type definitions */
struct TYPE_2__ {
  unsigned long subwindow;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_subwindow(void *_p, unsigned long _v) {
  ((XKeyPressedEvent *)_p)->subwindow = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XKeyPressedEvent_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void get_label_y_right(int j, char y[]) {
  j++;
  y[0] = (char)(int)(j / 10 + 48);
  y[1] = (char)(j % 10 + 48);
  y[2] = '\0';
  if (y[0] == '0') {
    y[0] = y[1];
    y[1] = '\0';
  }
  return;
}


x86 assembly (clang, -O0):
<get_label_y_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    116e <get_label_y_right+0x6e>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_label_y_right>:
add    $0x1,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    0x30(%rcx),%edx
mov    %dl,(%rsi)
mov    %ecx,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%eax
add    $0x30,%al
mov    %al,0x1(%rsi)
movb   $0x0,0x2(%rsi)
test   %cl,%cl
je     1136 <get_label_y_right+0x36>
ret
mov    %al,(%rsi)
movb   $0x0,0x1(%rsi)
ret

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

LLVM IR (-O2):
define void @get_label_y_right(i32 %0, i8* nocapture %1) {
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %3, 10
%5 = trunc i32 %4 to i8
%6 = add i8 %5, 48
store i8 %6, i8* %1
%7 = srem i32 %3, 10
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 48
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 0, i8* %11
%12 = icmp eq i8 %5, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i8 %9, i8* %1
store i8 0, i8* %10
br label %14
14: ; preds = %13, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float x, y;
  scanf("%f", &x);
  y = x + 5.0;
  printf("%f", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0xeb9(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fadd double %6, 5.000000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fadd float %4, 5.000000e+00
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
int main() {
  char s[] = "will";
  char t[] = "well";
  printf("%d\n", strcmp(s, t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0xa(%rbp)
lea    -0x9(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"will\00"
@__const.main.t = [5 x i8] c"well\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
store i32 0, i32* %1
%4 = bitcast [5 x i8]* %2 to i8*
%5 = bitcast [5 x i8]* %3 to i8*
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcmp(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
unsigned long crc32(crc, buf, len)
unsigned long crc;
const unsigned char *buf;
unsigned len;
{ return crc32_generic(crc, buf, len); }


x86 assembly (clang, -O0):
<crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
mov    $0x0,%al
call   1030 <crc32_generic@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @crc32(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i64, i8*, i32, ...) bitcast (i32 (...)* @crc32_generic to i32 (i64, i8*, i32, ...)*)(i64 %7, i8* %8, i32 %9)
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @crc32(i64 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i64, i8*, i32, ...) bitcast (i32 (...)* @crc32_generic to i32 (i64, i8*, i32, ...)*)(i64 %0, i8* %1, i32 %2)
%5 = sext i32 %4 to i64
ret i64 %5
}
int main(void) {
  char result, value = 42;
  result = 42 | 89;
  result = 42 & 218;
  result = 42 ^ 89;
  result = 42 << 2;
  result = 42 >> 1;
  result = ~42;
  result = value | 89;
  result = result & 218;
  result = result ^ 89;
  result = result << 2;
  result = result >> 1;
  result = ~result;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x2a,-0x6(%rbp)
movb   $0x7b,-0x5(%rbp)
movb   $0xa,-0x5(%rbp)
movb   $0x73,-0x5(%rbp)
movb   $0xa8,-0x5(%rbp)
movb   $0x15,-0x5(%rbp)
movb   $0xd5,-0x5(%rbp)
movsbl -0x6(%rbp),%eax
or     $0x59,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0xda,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
xor    $0x59,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
shl    $0x2,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x5(%rbp)
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 i8
%3 = alloca i8
store i32 0, i32* %1
store i8 42, i8* %3
store i8 123, i8* %2
store i8 10, i8* %2
store i8 115, i8* %2
store i8 -88, i8* %2
store i8 21, i8* %2
store i8 -43, i8* %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 89
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = and i32 %9, 218
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = xor i32 %13, 89
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 2
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = ashr i32 %21, 1
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int *matrix1() {
  static int arr[][2] = {{11, 12}, {21, 22}, {31, 32}, {41, 42}, {51, 52}};
  return *arr;
}


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

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

LLVM IR (-O0):
@matrix1.arr = internal global [5 x [2 x i32]] [[2 x i32] [i32 11, i32 12], [2 x i32] [i32 21, i32 22], [2 x i32] [i32 31, i32 32], [2 x i32] [i32 41, i32 42], [2 x i32] [i32 51, i32 52]]
define i32* @matrix1() {
ret i32* getelementptr inbounds ([5 x [2 x i32]], [5 x [2 x i32]]* @matrix1.arr, i64 0, i64 0, i64 0)
}

LLVM IR (-O2):
@matrix1.arr = internal global [5 x [2 x i32]] [[2 x i32] [i32 11, i32 12], [2 x i32] [i32 21, i32 22], [2 x i32] [i32 31, i32 32], [2 x i32] [i32 41, i32 42], [2 x i32] [i32 51, i32 52]]
define i32* @matrix1() {
ret i32* getelementptr inbounds ([5 x [2 x i32]], [5 x [2 x i32]]* @matrix1.arr, i64 0, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ parse_line(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char buf[1024];
  while (fgets(buf, 1024, stdin) != NULL) {
    parse_line(buf);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     116e <main+0x4e>
lea    -0x410(%rbp),%rdi
call   1040 <parse_line@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    0x2eb7(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x400,%esi
call   1030 <fgets@plt>
test   %rax,%rax
je     116d <main+0x4d>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <parse_line@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <fgets@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %12, %2
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32* @fgets(i8* %8, i32 1024, i32 %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%14 = call i32 @parse_line(i8* %13)
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 1024, i32 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = call i32 @parse_line(i8* %4)
%10 = load i32, i32* @stdin
%11 = call i32* @fgets(i8* %4, i32 1024, i32 %10)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %8
13: ; preds = %8, %2
ret i32 0
}
char *test_myRand_large(const char **_ja_name) {
  int i;
  for (i = 0; i < 256; i++) {
    do {
      *_ja_name = __func__;
      if (!(myRand() == 5))
        return "myRand() == 5";
    } while (0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_myRand_large>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    117b <test_myRand_large+0x6b>
jmp    1135 <test_myRand_large+0x25>
mov    -0x10(%rbp),%rax
lea    0xec0(%rip),%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <myRand@plt>
cmp    $0x5,%eax
je     1163 <test_myRand_large+0x53>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1183 <test_myRand_large+0x73>
jmp    1168 <test_myRand_large+0x58>
jmp    116d <test_myRand_large+0x5d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <test_myRand_large+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_myRand_large>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x100,%ebp
lea    0xeda(%rip),%r15
lea    0xee5(%rip),%r14
nopl   (%rax)
mov    %r15,(%rbx)
xor    %eax,%eax
call   1030 <myRand@plt>
cmp    $0x5,%eax
jne    1147 <test_myRand_large+0x37>
add    $0xffffffff,%ebp
jne    1130 <test_myRand_large+0x20>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__func__.test_myRand_large = [18 x i8] c"test_myRand_large\00"
@.str = [14 x i8] c"myRand() == 5\00"
define i8* @test_myRand_large(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 256
br i1 %7, label %8, label %19
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i8**, i8*** %3
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_myRand_large, i64 0, i64 0), i8** %10
%11 = call i32 (...) @myRand()
%12 = icmp eq i32 %11, 5
br i1 %12, label %14, label %13
13: ; preds = %9
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %20
14: ; preds = %9
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i8* null, i8** %2
br label %20
20: ; preds = %19, %13
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
@__func__.test_myRand_large = [18 x i8] c"test_myRand_large\00"
@.str = [14 x i8] c"myRand() == 5\00"
define i8* @test_myRand_large(i8** nocapture writeonly %0) {
br label %5
2: ; preds = %5
%3 = add nuw nsw i32 %6, 1
%4 = icmp eq i32 %3, 256
br i1 %4, label %9, label %5
5: ; preds = %1, %2
%6 = phi i32 [ 0, %1 ], [ %3, %2 ]
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_myRand_large, i64 0, i64 0), i8** %0
%7 = tail call i32 (...) @myRand()
%8 = icmp eq i32 %7, 5
br i1 %8, label %2, label %9
9: ; preds = %2, %5
%10 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %5 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ scc_socket_send_modem_code(int, int, double);
void scc_socket_modem_hangup(int port, double dcycs) {
  scc_socket_send_modem_code(port, 3, dcycs);
}


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

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

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

LLVM IR (-O2):
define void @scc_socket_modem_hangup(i32 %0, double %1) {
%3 = tail call i32 @scc_socket_send_modem_code(i32 %0, i32 3, double %1)
ret void
}
void swap(int a[], int first, int second) {
  int temp;
  temp = a[first];
  a[first] = a[second];
  a[second] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int wps_validate_assoc_req(const struct wpabuf *wps_ie) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_assoc_req(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tolow(char *);
char *strlower(char *strung) {
  char *strindx;
  for (strindx = strung; *strindx != 0; strindx++) {
    tolow(strindx);
  }
  return strung;
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <strlower+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <tolow@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmpb   $0x0,(%rdi)
je     1132 <strlower+0x22>
mov    %r14,%rbx
nop
mov    %rbx,%rdi
call   1030 <tolow@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <strlower+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @tolow(i8* %5)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
unsigned char *cbor_write_type_size(unsigned char *, unsigned int, int,
                                    unsigned int);
unsigned char *cbor_write_map(unsigned char *data, unsigned int size,
                              unsigned int map_size) {
  return cbor_write_type_size(data, size, 5, map_size);
}


x86 assembly (clang, -O0):
<cbor_write_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    $0x5,%edx
call   1030 <cbor_write_type_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_write_map>:
mov    %edx,%ecx
mov    $0x5,%edx
jmp    1030 <cbor_write_type_size@plt>

LLVM IR (-O0):
define i8* @cbor_write_map(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i8* @cbor_write_type_size(i8* %7, i32 %8, i32 5, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @cbor_write_map(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @cbor_write_type_size(i8* %0, i32 %1, i32 5, i32 %2)
ret i8* %4
}
int check_header(char *header, char *firstline) {
  if (*header == *firstline)
    return 1;
  else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<check_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    112e <check_header+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <check_header+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_header>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_header(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
char *allones_zero_OK() {
  static char *const base = (char *)-1;
  static const unsigned long offset = 0;
  return base + offset;
}


x86 assembly (clang, -O0):
<allones_zero_OK>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allones_zero_OK>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@allones_zero_OK.base = internal constant i8* inttoptr (i64 -1 to i8*)
@allones_zero_OK.offset = internal constant i64 0
define i8* @allones_zero_OK() {
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @allones_zero_OK() {
ret i8* inttoptr (i64 -1 to i8*)
}
/* Type definitions */
struct section_t {
  int dummy;
};

/* Variables and functions */
int config_parse_tag_hostlist(char *, struct section_t *);
int config_parse_tag_proxyip(char *line, struct section_t *section) {
  return config_parse_tag_hostlist(line, section);
}


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

x86 assembly (clang, -O2):
<config_parse_tag_proxyip>:
jmp    1030 <config_parse_tag_hostlist@plt>

LLVM IR (-O0):
%struct.section_t = type { i32 }
define i32 @config_parse_tag_proxyip(i8* %0, %struct.section_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.section_t*
store i8* %0, i8** %3
store %struct.section_t* %1, %struct.section_t** %4
%5 = load i8*, i8** %3
%6 = load %struct.section_t*, %struct.section_t** %4
%7 = call i32 @config_parse_tag_hostlist(i8* %5, %struct.section_t* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.section_t = type { i32 }
define i32 @config_parse_tag_proxyip(i8* %0, %struct.section_t* %1) {
%3 = tail call i32 @config_parse_tag_hostlist(i8* %0, %struct.section_t* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strindex(char *, char *);
int main(void) {
  char *s = "This is a line";
  char *t = "is";
  int ret;
  ret = strindex(s, t);
  printf("%d", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strindex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1040 <strindex@plt>
lea    0xed7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"This is a line\00"
@.str.1 = [3 x i8] c"is\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @strindex(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
float ftg__get_max(float a, float b, float c) {
  float r = a;
  if (r < b)
    r = b;
  if (r < c)
    r = c;
  return r;
}


x86 assembly (clang, -O0):
<ftg__get_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <ftg__get_max+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1157 <ftg__get_max+0x57>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftg__get_max>:
maxss  %xmm0,%xmm1
maxss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @ftg__get_max(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = select i1 %4, float %1, float %0
%6 = fcmp olt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ setsid();
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, scalar_t__);
void do_session(pid_t *sid) {
  *sid = setsid();
  if (*sid < 0) {
    syslog(LOG_ERR, "Can't create a session. sid=%d", *sid);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<do_session>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <setsid@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jge    1185 <do_session+0x55>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xe8e(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_session>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <setsid@plt>
mov    %rax,(%rbx)
test   %rax,%rax
js     1145 <do_session+0x15>
pop    %rbx
ret
mov    0x2e84(%rip),%rcx
mov    (%rcx),%edi
lea    0xeab(%rip),%rsi
mov    %rax,%rdx
call   1040 <syslog@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [31 x i8] c"Can't create a session. sid=%d\00"
@EXIT_FAILURE = global i32 0
define void @do_session(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @setsid()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
%5 = load i64*, i64** %2
%6 = load i64, i64* %5
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* @LOG_ERR
%10 = load i64*, i64** %2
%11 = load i64, i64* %10
%12 = call i32 @syslog(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %1
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [31 x i8] c"Can't create a session. sid=%d\00"
@EXIT_FAILURE = global i32 0
define void @do_session(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @setsid()
store i64 %2, i64* %0
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @LOG_ERR
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %2)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reverse(char *);
int main() {
  char myStr[] =
      "   01234566789 The   quick  brown fox   jumps over the lazy dog.";
  printf("orig:\n%s\n", myStr);
  printf("reverse:\n");
  reverse(myStr);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x41,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <reverse@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x40(%rsp)
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.myStr = [65 x i8] c" 01234566789 The quick brown fox jumps over the lazy dog.\00"
@.str = [10 x i8] c"orig:\0A%s\0A\00"
@.str.1 = [10 x i8] c"reverse:\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [65 x i8]
%2 = bitcast [65 x i8]* %1 to i8*
%3 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%7 = call i32 @reverse(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.myStr = [65 x i8] c" 01234566789 The quick brown fox jumps over the lazy dog.\00"
@.str = [10 x i8] c"orig:\0A%s\0A\00"
@str = [9 x i8] c"reverse:\00"
define i32 @main() {
%1 = alloca [65 x i8]
%2 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%5 = call i32 @reverse(i8* %2)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FlightPlanSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FlightPlanSettingsLogging() { UAVObjLogging(FlightPlanSettingsHandle()); }


x86 assembly (clang, -O0):
<FlightPlanSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <FlightPlanSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlightPlanSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <FlightPlanSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @FlightPlanSettingsLogging() {
%1 = call i32 (...) @FlightPlanSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightPlanSettingsLogging() {
%1 = tail call i32 (...) @FlightPlanSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void FanChannelConfigManual(unsigned long ulBase, unsigned long ulChannel,
                            unsigned long ulConfig) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010 + (ulChannel * 0x10)))) =
      0x00000001 | ulConfig;
}


x86 assembly (clang, -O0):
<FanChannelConfigManual>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
or     $0x1,%rcx
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    -0x10(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelConfigManual>:
or     $0x1,%rdx
shl    $0x4,%rsi
mov    %rdx,0x10(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @FanChannelConfigManual(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = or i64 1, %7
%9 = load i64, i64* %4
%10 = add i64 %9, 16
%11 = load i64, i64* %5
%12 = mul i64 %11, 16
%13 = add i64 %10, %12
%14 = inttoptr i64 %13 to i64*
store volatile i64 %8, i64* %14
ret void
}

LLVM IR (-O2):
define void @FanChannelConfigManual(i64 %0, i64 %1, i64 %2) {
%4 = or i64 %2, 1
%5 = add i64 %0, 16
%6 = shl i64 %1, 4
%7 = add i64 %5, %6
%8 = inttoptr i64 %7 to i64*
store volatile i64 %4, i64* %8
ret void
}
/* Type definitions */
struct fortran_stream {
  int dummy;
};

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


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

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

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

LLVM IR (-O2):
%struct.fortran_stream = type { i32 }
define void @fortran_stream_destroy(%struct.fortran_stream* nocapture %0) {
%2 = tail call i32 @free(%struct.fortran_stream* %0)
ret void
}
/* Variables and functions */
int fb_ConsoleGetTopRow();
int /*<<< orphan*/ fb_ConsoleLocate(int, int, int);
void fb_ConsoleViewUpdate(void) {
  int top = fb_ConsoleGetTopRow();
  if (top >= 0)
    ++top;
  else
    top = 1;
  fb_ConsoleLocate(top, 1, -1);
}


x86 assembly (clang, -O0):
<fb_ConsoleViewUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fb_ConsoleGetTopRow@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     114a <fb_ConsoleViewUpdate+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <fb_ConsoleViewUpdate+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <fb_ConsoleLocate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_ConsoleViewUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <fb_ConsoleGetTopRow@plt>
lea    0x1(%rax),%edi
test   %eax,%eax
mov    $0x1,%eax
cmovs  %eax,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
pop    %rax
jmp    1030 <fb_ConsoleLocate@plt>

LLVM IR (-O0):
define void @fb_ConsoleViewUpdate() {
%1 = alloca i32
%2 = call i32 (...) @fb_ConsoleGetTopRow()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %1
%11 = call i32 @fb_ConsoleLocate(i32 %10, i32 1, i32 -1)
ret void
}

LLVM IR (-O2):
define void @fb_ConsoleViewUpdate() {
%1 = tail call i32 (...) @fb_ConsoleGetTopRow()
%2 = icmp sgt i32 %1, -1
%3 = add nsw i32 %1, 1
%4 = select i1 %2, i32 %3, i32 1
%5 = tail call i32 @fb_ConsoleLocate(i32 %4, i32 1, i32 -1)
ret void
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int b_yellow() { return fputs("[43m", stdout); }


x86 assembly (clang, -O0):
<b_yellow>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_yellow>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[43m\00"
@stdout = global i32 0
define i32 @b_yellow() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[43m\00"
@stdout = global i32 0
define i32 @b_yellow() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
void nseel_asm_stack_peek_top(void) {
  __asm__("movl $0xfefefefe, %edi\n"
          "movl (%edi), %eax\n");
}


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

x86 assembly (clang, -O2):
<nseel_asm_stack_peek_top>:
mov    $0xfefefefe,%edi
mov    (%edi),%eax
ret

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

LLVM IR (-O2):
define void @nseel_asm_stack_peek_top() {
tail call void asm sideeffect "movl $$0xfefefefe, %edi\0Amovl (%edi), %eax\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int tgetent(char *buffer, char *termtype) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @tgetent(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}