xunge/DecIR huggingface dataset:
int precedence(char op) {
  int p = 0;
  switch (op) {
  case '+':
  case '-':
    p = 1;
    break;
  case '*':
  case '/':
    p = 2;
    break;
  case '%':
    p = 3;
    break;
  default:
    p = -1;
  }
  return p;
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffdb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xa,%eax
ja     115f <precedence+0x5f>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1166 <precedence+0x66>
movl   $0x2,-0x8(%rbp)
jmp    1166 <precedence+0x66>
movl   $0x3,-0x8(%rbp)
jmp    1166 <precedence+0x66>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
add    $0xffffffdb,%edi
mov    $0xffffffff,%eax
cmp    $0xa,%edi
ja     111a <precedence+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @precedence(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 37, label %8
]
6: ; preds = %1, %1
store i32 1, i32* %3
br label %10
7: ; preds = %1, %1
store i32 2, i32* %3
br label %10
8: ; preds = %1
store i32 3, i32* %3
br label %10
9: ; preds = %1
store i32 -1, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@switch.table.precedence = [11 x i32] [i32 3, i32 -1, i32 -1, i32 -1, i32 -1, i32 2, i32 1, i32 -1, i32 1, i32 -1, i32 2]
define i32 @precedence(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -37
%4 = icmp ult i32 %3, 11
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.precedence, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ CAN0_DriverIRQHandler();
__attribute__((weak)) void CAN0_Bus_Off_IRQHandler(void) {
  CAN0_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @CAN0_Bus_Off_IRQHandler() {
%1 = tail call i32 (...) @CAN0_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void crc_le_cycle(uint32_t *table, uint32_t *remainder, uint8_t c) {
  const uint8_t i = (*remainder & 0xFF) ^ c;
  *remainder = (*remainder >> 8) ^ table[i];
}


x86 assembly (clang, -O0):
<crc_le_cycle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rdx
xor    (%rax,%rdx,4),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_le_cycle>:
mov    (%rsi),%eax
movzbl %al,%ecx
xor    %edx,%ecx
sar    $0x8,%eax
movslq %ecx,%rcx
xor    (%rdi,%rcx,4),%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @crc_le_cycle(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = and i32 %4, 255
%6 = xor i32 %5, %2
%7 = ashr i32 %4, 8
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = xor i32 %7, %10
store i32 %11, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ y;
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ t1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  struct test {
    char c;
    int y;
  } t1;
  int x;
  char y;
  printf("int=%d    char = %d \n", sizeof(x), sizeof(y));
  printf("%d %d\n", sizeof(t1), sizeof(t1.c));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
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    $0x4,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.test = type { i8, i32 }
@.str = [22 x i8] c"int=%d char = %d \0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 1)
ret i32 0
}
void do_some_work() {
  int i;
  for (i = 0; i < 0x2000; i++)
    i = i * 10.0 / 5 / 2;
  return;
}


x86 assembly (clang, -O0):
<do_some_work>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2000,-0x4(%rbp)
jge    1156 <do_some_work+0x56>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeeb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <do_some_work+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_some_work() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 8192
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+01
%9 = fdiv double %8, 5.000000e+00
%10 = fdiv double %9, 2.000000e+00
%11 = fptosi double %10 to i32
store i32 %11, i32* %1
br label %12
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @do_some_work() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ captcha1hash(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
char *readable(char *);
int main(int argc, char *argv[]) {
  int i;
  char buf[16];
  captcha1hash(atoi(argv[1]), buf);
  printf("%s\n", readable(buf));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
lea    -0x30(%rbp),%rsi
call   1050 <captcha1hash@plt>
lea    -0x30(%rbp),%rdi
call   1040 <readable@plt>
mov    %rax,%rsi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %rsp,%rbx
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <captcha1hash@plt>
mov    %rbx,%rdi
call   1040 <readable@plt>
lea    0xe96(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = call i32 @captcha1hash(i32 %11, i8* %12)
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%15 = call i8* @readable(i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = call i32 @captcha1hash(i32 %7, i8* %4)
%9 = call i8* @readable(i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ tx_bytes(unsigned char *, int);
void get_version() {
  unsigned char d[2];
  d[0] = (7 << 5) + 0x1F;
  d[1] = 0x0B;
  tx_bytes(d, sizeof(d));
}


x86 assembly (clang, -O0):
<get_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x2(%rbp)
movb   $0xb,-0x1(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <tx_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_version>:
push   %rax
movw   $0xbff,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <tx_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @get_version() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 -1, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 11, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @tx_bytes(i8* %4, i32 2)
ret void
}

LLVM IR (-O2):
define void @get_version() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 -1, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 11, i8* %3
%4 = call i32 @tx_bytes(i8* %2, i32 2)
ret void
}
void delay() {
  long i;
  for (i = 0; i < 500; i++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
cmpq   $0x1f4,-0x8(%rbp)
jge    1130 <delay+0x30>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <delay+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %6, %0
%3 = load i64, i64* %1
%4 = icmp slt i64 %3, 500
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i64, i64* %1
%8 = add nsw i64 %7, 1
store i64 %8, i64* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD5_Update(int /*<<< orphan*/ *, char *, int);
void ssl_md5_transform(void *md5_info, char *data, int len) {
  MD5_Update((MD5_CTX *)md5_info, data, len);
}


x86 assembly (clang, -O0):
<ssl_md5_transform>:
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
call   1030 <MD5_Update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_md5_transform>:
jmp    1030 <MD5_Update@plt>

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

LLVM IR (-O2):
define void @ssl_md5_transform(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @MD5_Update(i32* %4, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void html_end(void) {
  puts("</BODY>");
  puts("</HTML>");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"</BODY>\00"
@.str.1 = [8 x i8] c"</HTML>\00"
define void @html_end() {
%1 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"</BODY>\00"
@.str.1 = [8 x i8] c"</HTML>\00"
define void @html_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int is_alphanum(c)
char c;
{
  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '_') ||
          (c >= '0' && c <= '9'));
}


x86 assembly (clang, -O0):
<is_alphanum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <is_alphanum+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    117f <is_alphanum+0x7f>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_alphanum+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    117f <is_alphanum+0x7f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     117f <is_alphanum+0x7f>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1179 <is_alphanum+0x79>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphanum>:
shl    $0x18,%edi
lea    -0x40000001(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1affffff,%ecx
jb     113d <is_alphanum+0x3d>
cmp    $0x5f000000,%edi
je     113d <is_alphanum+0x3d>
lea    -0x60000001(%rdi),%ecx
cmp    $0x1affffff,%ecx
jb     113d <is_alphanum+0x3d>
add    $0xd0ffffff,%edi
xor    %eax,%eax
cmp    $0xaffffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alphanum(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %33, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %33, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 95
br i1 %22, label %33, label %23
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sge i32 %25, 48
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp sle i32 %29, 57
br label %31
31: ; preds = %27, %23
%32 = phi i1 [ false, %23 ], [ %30, %27 ]
br label %33
33: ; preds = %31, %19, %15, %7
%34 = phi i1 [ true, %19 ], [ true, %15 ], [ true, %7 ], [ %32, %31 ]
%35 = zext i1 %34 to i32
ret i32 %35
}

LLVM IR (-O2):
define i32 @is_alphanum(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = add i32 %2, -1610612737
%7 = icmp ult i32 %6, 452984831
%8 = icmp eq i32 %2, 1593835520
%9 = or i1 %8, %7
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = add i32 %2, -788529153
%12 = icmp ult i32 %11, 184549375
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %5, %1, %10
%15 = phi i32 [ %13, %10 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf(("NAME")); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"NAME\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void smp_test_file_main() {}


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

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

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

LLVM IR (-O2):
define void @smp_test_file_main() {
ret void
}
void UNDEF_ISR(void) {
  for (;;) {
    ;
  }
}


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

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

LLVM IR (-O0):
define void @UNDEF_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @UNDEF_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void printinfo(char *text, int verbose, FILE *file_handle) {
  if (verbose < 2)
    printf("%s\n", text);
  if (verbose > 0)
    fprintf(file_handle, "%s\n", text);
}


x86 assembly (clang, -O0):
<printinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    114d <printinfo+0x2d>
mov    -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    116b <printinfo+0x4b>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printinfo>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
cmp    $0x1,%esi
jg     1145 <printinfo+0x25>
mov    %esi,%ebp
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
cmp    $0x1,%ebp
jne    115b <printinfo+0x3b>
lea    0xeb4(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fprintf@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @printinfo(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 i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %3
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32*, i32** %6
%17 = load i8*, i8** %4
%18 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printinfo(i8* %0, i32 %1, i32* nocapture %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = icmp eq i32 %1, 1
br i1 %7, label %8, label %10
8: ; preds = %3, %5
%9 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %5
ret void
}
void GPMCClkActivationTimeConfig(unsigned int baseAddr, unsigned int csNum,
                                 unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) &=
      ~(0x06000000u);
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) |=
      ((flag << (0x00000019u)) & (0x06000000u));
}


x86 assembly (clang, -O0):
<GPMCClkActivationTimeConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xf9ffffff,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x19,%edx
and    $0x6000000,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCClkActivationTimeConfig>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x60,%eax
andl   $0xf9ffffff,(%rax)
and    $0x3,%edx
shl    $0x19,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCClkActivationTimeConfig(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 96, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -100663297
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 25
%18 = and i32 %17, 100663296
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 96, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCClkActivationTimeConfig(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 96
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -100663297
store volatile i32 %10, i32* %8
%11 = shl i32 %2, 25
%12 = and i32 %11, 100663296
%13 = load volatile i32, i32* %8
%14 = or i32 %13, %12
store volatile i32 %14, i32* %8
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ const uint16_t;

/* Variables and functions */
int rdd08sdp_get_length(int /*<<< orphan*/ const *);
uint16_t rdd08sdp_get_footer(const uint16_t *p_rdd08) {
  uint8_t i_length = rdd08sdp_get_length(p_rdd08);
  return p_rdd08[i_length - 4];
}


x86 assembly (clang, -O0):
<rdd08sdp_get_footer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rdd08sdp_get_length@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdd08sdp_get_footer>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rdd08sdp_get_length@plt>
cltq
mov    -0x10(%rbx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rdd08sdp_get_footer(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @rdd08sdp_get_length(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rdd08sdp_get_footer(i32* %0) {
%2 = tail call i32 @rdd08sdp_get_length(i32* %0)
%3 = add nsw i32 %2, -4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pthread_self();
void *func(void *arg) {
  printf("%u\n", pthread_self());
  return NULL;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define noalias i8* @func(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* null
}
/* Variables and functions */
scalar_t__ strcmp(void const *, void const *);
int hmap_compare_nullterminated(const void *a, const void *b) {
  return strcmp(a, b) == 0;
}


x86 assembly (clang, -O0):
<hmap_compare_nullterminated>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmap_compare_nullterminated>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hmap_compare_nullterminated(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @hmap_compare_nullterminated(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
char *getCompleteYear(const char *year) {
  char *result = malloc(sizeof(char) * 4);
  if (year[0] > 52) {
    strcpy(result, "19");
  } else {
    strcpy(result, "20");
  }
  strcat(result, year);
  return result;
}


x86 assembly (clang, -O0):
<getCompleteYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x34,%eax
jle    116f <getCompleteYear+0x3f>
mov    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    117f <getCompleteYear+0x4f>
mov    -0x10(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCompleteYear>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
cmpb   $0x35,(%r14)
lea    0xeb1(%rip),%rax
lea    0xead(%rip),%rsi
cmovge %rax,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"19\00"
@.str.1 = [3 x i8] c"20\00"
define i8* @getCompleteYear(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %8, 52
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %16
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %10
%17 = load i8*, i8** %3
%18 = load i8*, i8** %2
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"19\00"
@.str.1 = [3 x i8] c"20\00"
define i8* @getCompleteYear(i8* %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = load i8, i8* %0
%4 = icmp sgt i8 %3, 52
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @strcpy(i8* %2, i8* %5)
%7 = tail call i32 @strcat(i8* %2, i8* %0)
ret i8* %2
}
int caccess_read_array_int(int *address, int index) { return address[index]; }


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

x86 assembly (clang, -O2):
<caccess_read_array_int>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @caccess_read_array_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @caccess_read_array_int(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __putchar(int /*<<< orphan*/);
int puts(const char *str) {
  while (*str)
    __putchar(*str++);
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <__putchar@plt>
jmp    111c <puts+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <__putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @__putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
const char *loadavgwatch_impl_get_system(void) { return "bsd"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"bsd\00"
define i8* @loadavgwatch_impl_get_system() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(int);
int main() {
  free(malloc(10));
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc(i32 10)
%2 = tail call i32 @free(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
char *strtok(char *, char const *);
__attribute__((visibility("default"))) char *
trio_tokenize(char *string, const char *delimiters) {
  assert(delimiters);
  return strtok(string, delimiters);
}


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

x86 assembly (clang, -O2):
<trio_tokenize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strtok@plt>

LLVM IR (-O0):
define i8* @trio_tokenize(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @strtok(i8* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @trio_tokenize(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = tail call i8* @strtok(i8* %0, i8* %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
void f_names(char *name, char *text) {
  do {
    printf("%s", text);
    scanf("%s", name);
  } while (access(name, F_OK) < 0);
}


x86 assembly (clang, -O0):
<f_names>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
jl     1140 <f_names+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_names>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebb(%rip),%r15
mov    0x2e8c(%rip),%r12
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%r12),%esi
mov    %rbx,%rdi
call   1050 <access@plt>
test   %rax,%rax
js     1150 <f_names+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@F_OK = global i32 0
define void @f_names(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %10, %2
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i32, i32* @F_OK
%13 = call i64 @access(i8* %11, i32 %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %5, label %15
15: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@F_OK = global i32 0
define void @f_names(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @F_OK
%7 = tail call i64 @access(i8* %0, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int phSetSpeakerVolume(int cid, int volume) {
  char reqbuf[32];
  snprintf(reqbuf, sizeof(reqbuf), "SETVOL CID=%d V=%d", cid, volume);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phSetSpeakerVolume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x20,%esi
lea    0xebb(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phSetSpeakerVolume>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%r8d
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"SETVOL CID=%d V=%d\00"
define i32 @phSetSpeakerVolume(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @ph_rpc(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"SETVOL CID=%d V=%d\00"
define i32 @phSetSpeakerVolume(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @ph_rpc(i8* %4)
ret i32 %6
}
void perf_counters_init(void) {}


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

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

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

LLVM IR (-O2):
define void @perf_counters_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Testing();
int main() {
  Testing();
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Testing()
ret i32 1
}
void badbyte(c) int c;
{
  char buff[32];
  (void)sprintf(buff, "unexpected byte: 0x%02x", c);
  mferror(buff);
}


x86 assembly (clang, -O0):
<badbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <mferror@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badbyte>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <mferror@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"unexpected byte: 0x%02x\00"
define void @badbyte(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @mferror to i32 (i8*, ...)*)(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"unexpected byte: 0x%02x\00"
define void @badbyte(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @mferror to i32 (i8*, ...)*)(i8* %3)
ret void
}
int celsius2fahr(int degree) { return degree * 9 / 5 + 32; }


x86 assembly (clang, -O0):
<celsius2fahr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x9,-0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius2fahr>:
lea    (%rdi,%rdi,8),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x21,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @celsius2fahr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 9
%5 = sdiv i32 %4, 5
%6 = add nsw i32 %5, 32
ret i32 %6
}

LLVM IR (-O2):
define i32 @celsius2fahr(i32 %0) {
%2 = mul nsw i32 %0, 9
%3 = sdiv i32 %2, 5
%4 = add nsw i32 %3, 32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le64(int /*<<< orphan*/, void *);
void put_unaligned_le64(__u64 val, void *p) { __put_unaligned_le64(val, p); }


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

x86 assembly (clang, -O2):
<put_unaligned_le64>:
jmp    1030 <__put_unaligned_le64@plt>

LLVM IR (-O0):
define void @put_unaligned_le64(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 = load i8*, i8** %4
%7 = call i32 @__put_unaligned_le64(i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @put_unaligned_le64(i32 %0, i8* %1) {
%3 = tail call i32 @__put_unaligned_le64(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int f455(int *);
int f456(int *p) { return f455(p); }


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

x86 assembly (clang, -O2):
<f456>:
jmp    1030 <f455@plt>

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

LLVM IR (-O2):
define i32 @f456(i32* %0) {
%2 = tail call i32 @f455(i32* %0)
ret i32 %2
}
float *vec2(float *result, float x, float y) {
  result[0] = x;
  result[1] = y;
  return result;
}


x86 assembly (clang, -O0):
<vec2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2>:
mov    %rdi,%rax
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define float* @vec2(float* %0, float %1, float %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float, float* %6
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
%13 = load float*, float** %4
ret float* %13
}

LLVM IR (-O2):
define float* @vec2(float* returned writeonly %0, float %1, float %2) {
store float %1, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %4
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int _stub(int /*<<< orphan*/);
int fork(void) { return _stub(EAGAIN); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <_stub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_stub@plt>

LLVM IR (-O0):
@EAGAIN = global i32 0
define i32 @fork() {
%1 = load i32, i32* @EAGAIN
%2 = call i32 @_stub(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@EAGAIN = global i32 0
define i32 @fork() {
%1 = load i32, i32* @EAGAIN
%2 = tail call i32 @_stub(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ laserCleanup();
void coreCleanupLaser(void) { laserCleanup(); }


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

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

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

LLVM IR (-O2):
define void @coreCleanupLaser() {
%1 = tail call i32 (...) @laserCleanup()
ret void
}
void report_temphumidity_data(struct ssp_data *data, struct sensor_value *th) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_temphumidity_data(%struct.ssp_data* nocapture %0, %struct.sensor_value* nocapture %1) {
ret void
}