xunge/DecIR huggingface dataset:
/* Variables and functions */
int read(int, char *, int);
int read_bool(int fd) {
  char b;
  int len = read(fd, &b, 1);
  return (len == 1) && (b != '0');
}


x86 assembly (clang, -O0):
<read_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    114b <read_bool+0x3b>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bool>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
sete   %al
cmpb   $0x30,0x7(%rsp)
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_bool(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @read(i32 %5, i8* %3, i32 1)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 48
br label %13
13: ; preds = %9, %1
%14 = phi i1 [ false, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_bool(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 48
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
int match(char *s1, char *s2) {
  while (*s1 == *s2)
    if (*s1++ == '\0')
      return (1);
    else
      s2++;
  return (0);
}


x86 assembly (clang, -O0):
<match>:
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    115a <match+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1149 <match+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1161 <match+0x61>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <match+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <match+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <match+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <match+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}
int IsDigital(char n) {
  int ret = 0;
  if ((n >= '0') && (n <= '9')) {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<IsDigital>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1132 <IsDigital+0x32>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1132 <IsDigital+0x32>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigital>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDigital(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
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %3
br label %12
12: ; preds = %11, %7, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @IsDigital(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned char tm_i2c_slot2addr(unsigned char slot) {
  if (slot < 0 || slot > 31)
    return 0;
  return ((0xC0 >> 1) + slot);
}


x86 assembly (clang, -O0):
<tm_i2c_slot2addr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     1124 <tm_i2c_slot2addr+0x24>
movzbl -0x2(%rbp),%eax
cmp    $0x1f,%eax
jle    112d <tm_i2c_slot2addr+0x2d>
movb   $0x0,-0x1(%rbp)
jmp    1137 <tm_i2c_slot2addr+0x37>
movzbl -0x2(%rbp),%eax
add    $0x60,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_i2c_slot2addr>:
lea    0x60(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x20,%dil
movzbl %al,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @tm_i2c_slot2addr(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 31
%3 = add i8 %0, 96
%4 = select i1 %2, i8 0, i8 %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int foo1(int i) {
  (void)i;
  putchar('a');
  return 0;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @putchar(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @foo1(i32 %0) {
%2 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
/* Variables and functions */
double exp(double);
double humidex(double tempC, double DewPoint) {
  double e = 19.833625 - 5417.753 / (273.16 + DewPoint);
  double h = tempC + 3.3941 * exp(e) - 5.555;
  return h;
}


x86 assembly (clang, -O0):
<humidex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xee1(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x28(%rbp),%xmm1
movsd  0xe9b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe83(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<humidex>:
push   %rax
movsd  %xmm0,(%rsp)
addsd  0xee2(%rip),%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xede(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xed9(%rip),%xmm0
addsd  (%rsp),%xmm0
addsd  0xed4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @humidex(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = fadd double 2.731600e+02, %7
%9 = fdiv double 0x40B529C0C49BA5E3, %8
%10 = fsub double 0x4033D56872B020C5, %9
store double %10, double* %5
%11 = load double, double* %3
%12 = load double, double* %5
%13 = call double @exp(double %12)
%14 = call double @llvm.fmuladd.f64(double 3.394100e+00, double %13, double %11)
%15 = fsub double %14, 5.555000e+00
store double %15, double* %6
%16 = load double, double* %6
ret double %16
}

LLVM IR (-O2):
define double @humidex(double %0, double %1) {
%3 = fadd double %1, 2.731600e+02
%4 = fdiv double 0x40B529C0C49BA5E3, %3
%5 = fsub double 0x4033D56872B020C5, %4
%6 = tail call double @exp(double %5)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 3.394100e+00, double %0)
%8 = fadd double %7, -5.555000e+00
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ log_msg(char *, char *);
void _msgout(char *msg) { log_msg("%s", msg); }


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

x86 assembly (clang, -O2):
<_msgout>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <log_msg@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @_msgout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @_msgout(i8* %0) {
%2 = tail call i32 @log_msg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  unsigned char port = 0x5a;
  unsigned char result_8 = (~port) >> 4;
  if (result_8 == 0xfa) {
    printf("UNSAFE\n");
    goto ERROR;
  }
  printf("SAFE\n");
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x5a,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
xor    $0xffffffff,%eax
sar    $0x4,%eax
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0xfa,%eax
jne    1150 <main+0x40>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x58>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <main+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"UNSAFE\0A\00"
@.str.1 = [6 x i8] c"SAFE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 90, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = ashr i32 %6, 4
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 250
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %17
16: ; preds = %12
store i32 -1, i32* %1
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@str = [7 x i8] c"UNSAFE\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
ecmp(a, b, count) char *a, *b;
{
  while (count--)
    if (*a++ != *b++)
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<ecmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1160 <ecmp+0x60>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115b <ecmp+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1167 <ecmp+0x67>
jmp    110f <ecmp+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecmp>:
mov    %edx,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %ecx,%r8d
je     1128 <ecmp+0x28>
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <ecmp+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ecmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(int argc, const char *argv[]) {
  int feet, fathoms;
  fathoms = 2;
  feet = 6 * fathoms;
  printf("There are %d feet in %d fathoms!\n", feet, fathoms);
  printf("Yes, I said %d feet!\n", 6 * fathoms);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x18(%rbp)
imul   $0x6,-0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x6,-0x18(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"There are %d feet in %d fathoms!\0A\00"
@.str.1 = [22 x i8] c"Yes, I said %d feet!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %7
%8 = load i32, i32* %7
%9 = mul nsw i32 6, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* %7
%14 = mul nsw i32 6, %13
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"There are %d feet in %d fathoms!\0A\00"
@.str.1 = [22 x i8] c"Yes, I said %d feet!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 12, i32 2)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 12)
ret i32 0
}
/* Variables and functions */
float __nv_exp10f(float);
float exp10f(float __a) { return __nv_exp10f(__a); }


x86 assembly (clang, -O0):
<exp10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_exp10f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp10f>:
jmp    1030 <__nv_exp10f@plt>

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

LLVM IR (-O2):
define float @exp10f(float %0) {
%2 = tail call float @__nv_exp10f(float %0)
ret float %2
}
unsigned long elf_hash(const char *name) {
  unsigned long hash = 0;
  unsigned long tmp;
  unsigned char c;
  while ((c = *name++)) {
    hash = (hash << 4) + c;
    if ((tmp = hash & 0xf0000000)) {
      hash ^= tmp | (tmp >> 24);
    }
  }
  return hash;
}


x86 assembly (clang, -O0):
<elf_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
cmp    $0x0,%al
je     1177 <elf_hash+0x77>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
movzbl -0x19(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1172 <elf_hash+0x72>
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <elf_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1142 <elf_hash+0x42>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movzbl %cl,%ecx
add    %rax,%rcx
mov    %ecx,%edx
and    $0xf0000000,%edx
mov    %rdx,%rax
shr    $0x18,%rax
or     %rdx,%rax
test   %rdx,%rdx
cmove  %rdx,%rax
xor    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <elf_hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @elf_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8
store i8* %0, i8** %2
store i64 0, i64* %3
br label %6
6: ; preds = %27, %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
%9 = load i8, i8* %7
store i8 %9, i8* %5
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %28
11: ; preds = %6
%12 = load i64, i64* %3
%13 = shl i64 %12, 4
%14 = load i8, i8* %5
%15 = zext i8 %14 to i64
%16 = add i64 %13, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = and i64 %17, 4026531840
store i64 %18, i64* %4
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %11
%21 = load i64, i64* %4
%22 = load i64, i64* %4
%23 = lshr i64 %22, 24
%24 = or i64 %21, %23
%25 = load i64, i64* %3
%26 = xor i64 %25, %24
store i64 %26, i64* %3
br label %27
27: ; preds = %20, %11
br label %6
28: ; preds = %6
%29 = load i64, i64* %3
ret i64 %29
}

LLVM IR (-O2):
define i64 @elf_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %18, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %17, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = shl i64 %7, 4
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = and i64 %11, 4026531840
%13 = icmp eq i64 %12, 0
%14 = lshr exact i64 %12, 24
%15 = or i64 %14, %12
%16 = select i1 %13, i64 0, i64 %15
%17 = xor i64 %16, %11
%18 = load i8, i8* %8
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %4
20: ; preds = %4, %1
%21 = phi i64 [ 0, %1 ], [ %17, %4 ]
ret i64 %21
}
void cvmx_dprintf(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @cvmx_dprintf(i8* nocapture %0, ...) {
ret void
}
unsigned int fake_sysoff_block_onkey(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fake_sysoff_block_onkey() {
ret i32 0
}
void copy_taint(struct taint *dst, struct taint *src) {}


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

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

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

LLVM IR (-O2):
%struct.taint = type opaque
define void @copy_taint(%struct.taint* nocapture %0, %struct.taint* nocapture %1) {
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SysCtlDeepSleepClockSet(uint32_t ui32Config) {
  (*((volatile unsigned long *)(0x400FE144))) = ui32Config;
}


x86 assembly (clang, -O0):
<SysCtlDeepSleepClockSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe144,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlDeepSleepClockSet>:
mov    %rdi,0x400fe144
40
ret

LLVM IR (-O0):
define void @SysCtlDeepSleepClockSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782532 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlDeepSleepClockSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782532 to i64*)
ret void
}
int main() {
  int i;
  int res = 12;
  goto L1;
  for (i = 0; i < 100; i++) {
  L3:
    res = res + 1;
    goto L2;
    if (i > 100) {
    L1:
      res = 0;
      goto L3;
    }
  }
L2:
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0xc(%rbp)
jmp    1125 <main+0x25>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <main+0x31>
movl   $0x0,-0xc(%rbp)
jmp    1117 <main+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void test1(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  FILE *fp;
  int x, x1;
  scanf("%d%d", &x, &x1);
  fp = fopen("abc.txt", "w");
  fprintf(fp, "%d %d", x, x1);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
lea    0xea2(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe8b(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
lea    0xea3(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0xe8f(%rip),%rsi
mov    %rax,%rdi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [8 x i8] c"abc.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [6 x i8] c"%d %d\00"
define void @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %5, i32** %1
%6 = load i32*, i32** %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32*, i32** %1
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [8 x i8] c"abc.txt\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [6 x i8] c"%d %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 @fclose(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ usleep(int);
int main() {
  char t[4] = "\\-/|";
  long i = 0;
  while (1) {
    printf("%c\n", t[i]);
    i = (i + 1) % 4;
    usleep(250000);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xeb9(%rip),%rdi
movsbl -0x8(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    $0x4,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
mov    $0x3d090,%edi
call   1040 <usleep@plt>
jmp    1140 <main+0x20>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xed2(%rip),%r15
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rbx,%r15,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x1(%rbx),%rax
lea    0x4(%rbx),%rcx
test   %rax,%rax
cmovns %rax,%rcx
and    $0xfffffffffffffffc,%rcx
neg    %rcx
add    %rcx,%rbx
add    $0x1,%rbx
mov    $0x3d090,%edi
call   1040 <usleep@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@__const.main.t = [4 x i8] c"\\-/|"
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [4 x i8]* %2 to i8*
store i64 0, i64* %3
br label %5
5: ; preds = %0, %5
%6 = load i64, i64* %3
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = load i64, i64* %3
%11 = add nsw i64 %10, 1
%12 = srem i64 %11, 4
store i64 %12, i64* %3
%13 = call i32 @usleep(i32 250000)
br label %5
}

LLVM IR (-O2):
@__const.main.t = [4 x i8] c"\\-/|"
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %7, %1 ]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* @__const.main.t, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = add nsw i64 %2, 1
%7 = srem i64 %6, 4
%8 = tail call i32 @usleep(i32 250000)
br label %1
}
int equal(char c) { return c == '='; }


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
xor    %eax,%eax
cmp    $0x3d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @equal(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 61
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @equal(i8 signext %0) {
%2 = icmp eq i8 %0, 61
%3 = zext i1 %2 to i32
ret i32 %3
}
_Bool f1(void) {
  return (_Bool)({
    void (*x)();
    x = 0;
  });
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @f1() {
%1 = alloca void (...)*
%2 = alloca void (...)*
store void (...)* null, void (...)** %1
store void (...)* null, void (...)** %2
%3 = load void (...)*, void (...)** %2
%4 = icmp ne void (...)* %3, null
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @f1() {
ret i1 false
}
double rad_deg(double ang) {
  return ang / (3.14159265358979323846264338327950288 / 180.0);
}


x86 assembly (clang, -O0):
<rad_deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad_deg>:
divsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @rad_deg(double %0) {
%2 = fdiv double %0, 0x3F91DF46A2529D39
ret double %2
}
void fild_RestoreModemPowerControl(void) {}


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

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

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

LLVM IR (-O2):
define void @fild_RestoreModemPowerControl() {
ret void
}
/* Variables and functions */
int I2C_write(int, unsigned short *, int);
int aic3204_rset(unsigned int regnum, unsigned int regval) {
  unsigned short cmd[2];
  cmd[0] = regnum & 0x007F;
  cmd[1] = regval;
  return I2C_write(0x18, cmd, 2);
}


x86 assembly (clang, -O0):
<aic3204_rset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
lea    -0xc(%rbp),%rsi
mov    $0x18,%edi
mov    $0x2,%edx
call   1030 <I2C_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aic3204_rset>:
push   %rax
and    $0x7f,%edi
mov    %di,0x4(%rsp)
mov    %si,0x6(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x18,%edi
mov    $0x2,%edx
call   1030 <I2C_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @aic3204_rset(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i16]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = and i32 %6, 127
%8 = trunc i32 %7 to i16
%9 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
store i16 %8, i16* %9
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i16
%12 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 1
store i16 %11, i16* %12
%13 = getelementptr inbounds [2 x i16], [2 x i16]* %5, i64 0, i64 0
%14 = call i32 @I2C_write(i32 24, i16* %13, i32 2)
ret i32 %14
}

LLVM IR (-O2):
define i32 @aic3204_rset(i32 %0, i32 %1) {
%3 = alloca [2 x i16]
%4 = bitcast [2 x i16]* %3 to i8*
%5 = trunc i32 %0 to i16
%6 = and i16 %5, 127
%7 = getelementptr inbounds [2 x i16], [2 x i16]* %3, i64 0, i64 0
store i16 %6, i16* %7
%8 = trunc i32 %1 to i16
%9 = getelementptr inbounds [2 x i16], [2 x i16]* %3, i64 0, i64 1
store i16 %8, i16* %9
%10 = call i32 @I2C_write(i32 24, i16* %7, i32 2)
ret i32 %10
}
void morefds(void) {}


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

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

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

LLVM IR (-O2):
define void @morefds() {
ret void
}
void PERDummyNothing(void) {}


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

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

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

LLVM IR (-O2):
define void @PERDummyNothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("argv[%d]: %s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"argv[%d]: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int _write_sysfs_string(char *, char *, char *, int /*<<< orphan*/);
int write_sysfs_string(char *filename, char *basedir, char *val) {
  return _write_sysfs_string(filename, basedir, val, 0);
}


x86 assembly (clang, -O0):
<write_sysfs_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <_write_sysfs_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_string>:
xor    %ecx,%ecx
jmp    1030 <_write_sysfs_string@plt>

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

LLVM IR (-O2):
define i32 @write_sysfs_string(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_write_sysfs_string(i8* %0, i8* %1, i8* %2, i32 0)
ret i32 %4
}
void gtk_tool_button_set_stock_id() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_button_set_stock_id() {
ret void
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec4_lerp(float *, float *, float *, float);
__attribute__((always_)) struct vec4 *
psvec4_lerp(struct vec4 *result, struct vec4 *a, struct vec4 *b, float p) {
  vec4_lerp((float *)result, (float *)a, (float *)b, p);
  return result;
}


x86 assembly (clang, -O0):
<psvec4_lerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
call   1030 <vec4_lerp@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4_lerp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4_lerp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_lerp(%struct.vec4* %0, %struct.vec4* %1, %struct.vec4* %2, float %3) {
%5 = alloca %struct.vec4*
%6 = alloca %struct.vec4*
%7 = alloca %struct.vec4*
%8 = alloca float
store %struct.vec4* %0, %struct.vec4** %5
store %struct.vec4* %1, %struct.vec4** %6
store %struct.vec4* %2, %struct.vec4** %7
store float %3, float* %8
%9 = load %struct.vec4*, %struct.vec4** %5
%10 = bitcast %struct.vec4* %9 to float*
%11 = load %struct.vec4*, %struct.vec4** %6
%12 = bitcast %struct.vec4* %11 to float*
%13 = load %struct.vec4*, %struct.vec4** %7
%14 = bitcast %struct.vec4* %13 to float*
%15 = load float, float* %8
%16 = call i32 @vec4_lerp(float* %10, float* %12, float* %14, float %15)
%17 = load %struct.vec4*, %struct.vec4** %5
ret %struct.vec4* %17
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_lerp(%struct.vec4* returned %0, %struct.vec4* %1, %struct.vec4* %2, float %3) {
%5 = bitcast %struct.vec4* %0 to float*
%6 = bitcast %struct.vec4* %1 to float*
%7 = bitcast %struct.vec4* %2 to float*
%8 = tail call i32 @vec4_lerp(float* %5, float* %6, float* %7, float %3)
ret %struct.vec4* %0
}
testbit(unsigned c, char *map) {
  if (c >= *(unsigned *)map)
    return 0;
  map += sizeof(unsigned);
  return (map[c >> 3] & (1 << (c & 0x07)));
}


x86 assembly (clang, -O0):
<testbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jb     1126 <testbit+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1156 <testbit+0x56>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testbit>:
xor    %eax,%eax
cmp    %edi,(%rsi)
jbe    1120 <testbit+0x20>
mov    %edi,%eax
shr    $0x3,%rax
movzbl 0x4(%rsi,%rax,1),%edx
and    $0x7,%dil
mov    $0x1,%eax
mov    %edi,%ecx
shl    %cl,%eax
and    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @testbit(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = icmp ugt i32 %4, %0
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %1, i64 4
%8 = lshr i32 %0, 3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = and i32 %0, 7
%14 = shl nuw nsw i32 1, %13
%15 = and i32 %14, %12
br label %16
16: ; preds = %2, %6
%17 = phi i32 [ %15, %6 ], [ 0, %2 ]
ret i32 %17
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int bit_test(const uint32_t *dword, unsigned int n) {
  return (*dword & (1 << n));
}


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bit_test(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bit_test(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
ret i32 %5
}
int test_imm_91uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x91 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_91uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 145
%7 = icmp ne i64 %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_91uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9502720
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int timer_milliseconds(unsigned int);
bool timer_elapsed_seconds(unsigned index, uint32_t seconds) {
  return ((timer_milliseconds(index) / 1000) >= seconds);
}


x86 assembly (clang, -O0):
<timer_elapsed_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <timer_milliseconds@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_elapsed_seconds>:
push   %rbx
mov    %esi,%ebx
call   1030 <timer_milliseconds@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x26,%rcx
add    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setge  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @timer_elapsed_seconds(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 = call i32 @timer_milliseconds(i32 %5)
%7 = sdiv i32 %6, 1000
%8 = load i32, i32* %4
%9 = icmp sge i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @timer_elapsed_seconds(i32 %0, i32 %1) {
%3 = tail call i32 @timer_milliseconds(i32 %0)
%4 = sdiv i32 %3, 1000
%5 = icmp sge i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uart_deinit_boot_phase(void) {
  *(volatile uint32_t *)0xA0210310 = 0x100000;
}


x86 assembly (clang, -O0):
<uart_deinit_boot_phase>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa0210310,%eax
movl   $0x100000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_deinit_boot_phase>:
mov    $0xa0210310,%eax
movl   $0x100000,(%rax)
ret

LLVM IR (-O0):
define void @uart_deinit_boot_phase() {
store volatile i32 1048576, i32* inttoptr (i64 2686518032 to i32*)
ret void
}

LLVM IR (-O2):
define void @uart_deinit_boot_phase() {
store volatile i32 1048576, i32* inttoptr (i64 2686518032 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *);
void drawPerson(int x, int y) {
  mvprintw(y - 1, x, "o");
  mvprintw(y, x, "X");
}


x86 assembly (clang, -O0):
<drawPerson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdx
call   1030 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawPerson>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    -0x1(%rbx),%edi
lea    0xedf(%rip),%rdx
mov    %ebp,%esi
call   1030 <mvprintw@plt>
lea    0xed3(%rip),%rdx
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mvprintw@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"o\00"
@.str.1 = [2 x i8] c"X\00"
define void @drawPerson(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
%7 = load i32, i32* %3
%8 = call i32 @mvprintw(i32 %6, i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @mvprintw(i32 %9, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"o\00"
@.str.1 = [2 x i8] c"X\00"
define void @drawPerson(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @mvprintw(i32 %3, i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mvprintw(i32 %1, i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}