xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_hardware_revision();
int get_pigpio_version();
int /*<<< orphan*/ printf(char *, ...);
void t0() {
  printf("Version.\n");
  printf("pigpio version %d.\n", get_pigpio_version());
  printf("Hardware revision %d.\n", get_hardware_revision());
}


x86 assembly (clang, -O0):
<t0>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <get_pigpio_version@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <get_hardware_revision@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t0>:
push   %rax
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <get_pigpio_version@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <get_hardware_revision@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Version.\0A\00"
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
define void @t0() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @get_pigpio_version()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @get_hardware_revision()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
@str = [9 x i8] c"Version.\00"
define void @t0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @get_pigpio_version()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @get_hardware_revision()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}
void STARTUP_shell() {}


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

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

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

LLVM IR (-O2):
define void @STARTUP_shell() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpeereid();
void main() { getpeereid(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @getpeereid()
ret void
}
unsigned int foo(unsigned int *bar) {
  if (bar != 0) {
    return *bar;
  }
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1121 <foo+0x21>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <foo+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %rdi,%rdi
je     1108 <foo+0x8>
mov    (%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* %0
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
char *strrchr(char const *, char);
char *getfname(const char *path) {
  const char *fname;
  const char *bslash;
  fname = strrchr(path, '/');
  bslash = strrchr(path, '\\');
  if (bslash > fname)
    fname = bslash;
  if (fname != NULL)
    fname++;
  else
    fname = (char *)path;
  return ((char *)fname);
}


x86 assembly (clang, -O0):
<getfname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1156 <getfname+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <getfname+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    117a <getfname+0x6a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfname>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
cmp    %rbx,%rax
cmova  %rax,%rbx
lea    0x1(%rbx),%rax
test   %rbx,%rbx
cmove  %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @getfname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
%4 = icmp ugt i8* %3, %2
%5 = select i1 %4, i8* %3, i8* %2
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = select i1 %6, i8* %0, i8* %7
ret i8* %8
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tvgt(struct timeval const *, struct timeval const *);
int tvle(const struct timeval *a, const struct timeval *b) {
  return !tvgt(a, b);
}


x86 assembly (clang, -O0):
<tvle>:
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 <tvgt@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @tvle(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = call i32 @tvgt(%struct.timeval* %5, %struct.timeval* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @tvle(%struct.timeval* %0, %struct.timeval* %1) {
%3 = tail call i32 @tvgt(%struct.timeval* %0, %struct.timeval* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ err;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int write(int, int *, int);
void error(int fd, int err) {
  if (write(fd, &err, sizeof(err)) != sizeof(err)) {
    exit(0x80 + err);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cltq
cmp    $0x4,%rax
je     1159 <error+0x39>
mov    -0x8(%rbp),%edi
add    $0x80,%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x4,%eax
jne    1149 <error+0x29>
mov    $0x1,%edi
call   1040 <exit@plt>
sub    $0xffffff80,%ebx
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error(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 @write(i32 %5, i32* %4, i32 4)
%7 = sext i32 %6 to i64
%8 = icmp ne i64 %7, 4
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = add nsw i32 128, %10
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
%5 = icmp eq i32 %4, 4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = add nsw i32 %1, 128
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = tail call i32 @exit(i32 1)
unreachable
}
int Section2Minutes(int seconds) { return seconds % 3600 / 60; }


x86 assembly (clang, -O0):
<Section2Minutes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section2Minutes>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x5,%ecx
add    %eax,%ecx
movswl %cx,%eax
ret

LLVM IR (-O0):
define i32 @Section2Minutes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 3600
%5 = sdiv i32 %4, 60
ret i32 %5
}

LLVM IR (-O2):
define i32 @Section2Minutes(i32 %0) {
%2 = srem i32 %0, 3600
%3 = trunc i32 %2 to i16
%4 = sdiv i16 %3, 60
%5 = sext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo7();
void foo8(void) { foo7(); }


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

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

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

LLVM IR (-O2):
define void @foo8() {
%1 = tail call i32 (...) @foo7()
ret void
}
int clamp(int x, int minval, int maxval) {
  if (x < minval)
    return minval;
  if (x > maxval)
    return maxval;
  return x;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
int doubleSize() {
  double doubArray[10];
  double *doubPtr1;
  double *doubPtr2;
  doubPtr1 = &doubArray[0];
  doubPtr2 = &doubArray[1];
  return (long int)doubPtr2 - (long int)doubPtr1;
}


x86 assembly (clang, -O0):
<doubleSize>:
push   %rbp
mov    %rsp,%rbp
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @doubleSize() {
%1 = alloca [10 x double]
%2 = alloca double*
%3 = alloca double*
%4 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
store double* %4, double** %2
%5 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 1
store double* %5, double** %3
%6 = load double*, double** %3
%7 = ptrtoint double* %6 to i64
%8 = load double*, double** %2
%9 = ptrtoint double* %8 to i64
%10 = sub nsw i64 %7, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @doubleSize() {
ret i32 8
}
int test_imm_69int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x69 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_69int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 105
%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_69int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 450971566080
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char tolower(char);
char *strtolower(char *string) {
  char *cp;
  cp = string;
  while (*cp) {
    *cp = tolower(*cp);
    cp++;
  }
  return (string);
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strtolower+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strtolower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strtolower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strtolower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ parse_debug_tags(char const *);
void parse_env_debug_tags(void) {
  const char *env = getenv("ANDROID_DEBUG");
  parse_debug_tags(env);
}


x86 assembly (clang, -O0):
<parse_env_debug_tags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <parse_debug_tags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_env_debug_tags>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <parse_debug_tags@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"ANDROID_DEBUG\00"
define void @parse_env_debug_tags() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @parse_debug_tags(i8* %1)
ret void
}
int charToDigit(char intwannabe) {
  if (intwannabe >= 48 && intwannabe <= 57) {
    return intwannabe - 48;
  }
  return -1;
}


x86 assembly (clang, -O0):
<charToDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <charToDigit+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <charToDigit+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <charToDigit+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToDigit>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @charToDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
void pthread_cond_timedwait() {}


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

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

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

LLVM IR (-O2):
define void @pthread_cond_timedwait() {
ret void
}
/* Variables and functions */
int other_func(unsigned long long);
int test_00(unsigned long long a, unsigned long long b) {
  if ((a - b) > 0xFFFFFFFFLL)
    return other_func(a - b);
  return 20;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
jbe    114b <test_00+0x3b>
mov    -0x10(%rbp),%rdi
sub    -0x18(%rbp),%rdi
call   1030 <other_func@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <test_00+0x42>
movl   $0x14,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
sub    %rsi,%rdi
mov    %rdi,%rax
shr    $0x20,%rax
je     1121 <test_00+0x11>
jmp    1030 <other_func@plt>
mov    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @test_00(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sub i64 %6, %7
%9 = icmp ugt i64 %8, 4294967295
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = sub i64 %11, %12
%14 = call i32 @other_func(i64 %13)
store i32 %14, i32* %3
br label %16
15: ; preds = %2
store i32 20, i32* %3
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_00(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = icmp ugt i64 %3, 4294967295
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @other_func(i64 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 20, %2 ]
ret i32 %8
}
int gui_init() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @gui_init() {
ret i32 -1
}
void ExttAuthorizeAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttAuthorizeAuxTable() {
ret void
}
void led_init(void) {
  *((volatile unsigned char *)0xfffff400) = 0x0000000f;
  *((volatile unsigned char *)0xfffff410) = 0x0000000f;
}


x86 assembly (clang, -O0):
<led_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff400,%eax
movb   $0xf,(%rax)
mov    $0xfffff410,%eax
movb   $0xf,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_init>:
mov    $0xfffff400,%eax
movb   $0xf,(%rax)
movb   $0xf,0x10(%rax)
ret

LLVM IR (-O0):
define void @led_init() {
store volatile i8 15, i8* inttoptr (i64 4294964224 to i8*)
store volatile i8 15, i8* inttoptr (i64 4294964240 to i8*)
ret void
}

LLVM IR (-O2):
define void @led_init() {
store volatile i8 15, i8* inttoptr (i64 4294964224 to i8*)
store volatile i8 15, i8* inttoptr (i64 4294964240 to i8*)
ret void
}
void out_double(double a) {}


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

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

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

LLVM IR (-O2):
define void @out_double(double %0) {
ret void
}
void SteamAPI_ISteamGameServer_SetGameTags(void *self,
                                           const char *pchGameTags) {
  xlogf("%s(self = %p, pchGameTags = %s)\n", __func__, self, pchGameTags);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamGameServer_SetGameTags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetGameTags>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"%s(self = %p, pchGameTags = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetGameTags = [38 x i8] c"SteamAPI_ISteamGameServer_SetGameTags\00"
define void @SteamAPI_ISteamGameServer_SetGameTags(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 i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamGameServer_SetGameTags, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s(self = %p, pchGameTags = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetGameTags = [38 x i8] c"SteamAPI_ISteamGameServer_SetGameTags\00"
define void @SteamAPI_ISteamGameServer_SetGameTags(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @__func__.SteamAPI_ISteamGameServer_SetGameTags, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct option_w {
  int dummy;
};

/* Variables and functions */
int _getopt_internal_w(int, int /*<<< orphan*/ *const *,
                       int /*<<< orphan*/ const *, struct option_w const *,
                       int *, int /*<<< orphan*/, int /*<<< orphan*/);
int getopt_long_w(int argc, wchar_t *const *argv, const wchar_t *options,
                  const struct option_w *long_options, int *opt_index) {
  return _getopt_internal_w(argc, argv, options, long_options, opt_index, 0, 0);
}


x86 assembly (clang, -O0):
<getopt_long_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <_getopt_internal_w@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long_w>:
push   %rax
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <_getopt_internal_w@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option_w = type { i32 }
define i32 @getopt_long_w(i32 %0, i32** %1, i32* %2, %struct.option_w* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32*
%9 = alloca %struct.option_w*
%10 = alloca i32*
store i32 %0, i32* %6
store i32** %1, i32*** %7
store i32* %2, i32** %8
store %struct.option_w* %3, %struct.option_w** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32**, i32*** %7
%13 = load i32*, i32** %8
%14 = load %struct.option_w*, %struct.option_w** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal_w(i32 %11, i32** %12, i32* %13, %struct.option_w* %14, i32* %15, i32 0, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option_w = type { i32 }
define i32 @getopt_long_w(i32 %0, i32** %1, i32* %2, %struct.option_w* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal_w(i32 %0, i32** %1, i32* %2, %struct.option_w* %3, i32* %4, i32 0, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
float read_float() {
  float ret = 0.0f;
  printf("Enter a floating point number: ");
  scanf("%f", &ret);
  return ret;
}


x86 assembly (clang, -O0):
<read_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_float>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter a floating point number: \00"
@.str.1 = [3 x i8] c"%f\00"
define float @read_float() {
%1 = alloca float
store float 0.000000e+00, float* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = load float, float* %1
ret float %4
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter a floating point number: \00"
@.str.1 = [3 x i8] c"%f\00"
define float @read_float() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
ret float %5
}
/* Variables and functions */
size_t av_strnlen(const char *s, size_t len) {
  size_t i;
  for (i = 0; i < len && s[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<av_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <av_strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <av_strnlen+0x4c>
jmp    1162 <av_strnlen+0x62>
jmp    1151 <av_strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <av_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <av_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <av_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <av_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @av_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal3(char const *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void fatal1x(const char *a) { fatal3(a, ": ", strerror(errno)); }


x86 assembly (clang, -O0):
<fatal1x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
lea    0xeb1(%rip),%rsi
call   1030 <fatal3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal1x>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fatal3@plt>

LLVM IR (-O0):
@.str = [3 x i8] c": \00"
@errno = global i32 0
define void @fatal1x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @fatal3(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
@errno = global i32 0
define void @fatal1x(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @fatal3(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dwarf(int);
int main(void) { dwarf(2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <dwarf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @dwarf(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dwarf(i32 2)
ret i32 0
}
void hashTableFree() {}


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

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

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

LLVM IR (-O2):
define void @hashTableFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tmpl(char *);
void main() {
  int n;
  int i = 0;
  int k = 0;
  while (i < n) {
    tmpl("(le(i,j,k,n),le(i,j,k,n))");
    i++;
    k = k + 2;
  }
  int j = 0;
  while (j < n) {
    tmpl("(le(i,j,k,n),le(i,j,k,n))");
    if (k <= 0)
    ERROR:;
      j++;
    k--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1155 <main+0x45>
lea    0xec7(%rip),%rdi
call   1030 <tmpl@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119f <main+0x8f>
lea    0xe91(%rip),%rdi
call   1030 <tmpl@plt>
cmpl   $0x0,-0xc(%rbp)
jg     1188 <main+0x78>
jmp    1183 <main+0x73>
jmp    1188 <main+0x78>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <main+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"(le(i,j,k,n),le(i,j,k,n))\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 2
store i32 %14, i32* %3
br label %5
15: ; preds = %5
store i32 0, i32* %4
br label %16
16: ; preds = %26, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %1
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = icmp sle i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
%29 = load i32, i32* %3
%30 = add nsw i32 %29, -1
store i32 %30, i32* %3
br label %16
31: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
scalar_t__ log10(int);
int count_digits(int n) {
  if (n == 0) {
    return 1;
  } else {
    return (int)log10(n) + 1;
  }
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <count_digits+0x21>
movl   $0x1,-0x4(%rbp)
jmp    113f <count_digits+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <log10@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
test   %edi,%edi
je     1122 <count_digits+0x12>
push   %rax
call   1030 <log10@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @count_digits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @log10(i32 %8)
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @count_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @log10(i32 %0)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 1, %1 ]
ret i32 %8
}
void wm_signal_handler(int signal) {}


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

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

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

LLVM IR (-O2):
define void @wm_signal_handler(i32 %0) {
ret void
}
int sumOfNaturalNumbers(int number) {
  if (number != 0) {
    return number + sumOfNaturalNumbers(number - 1);
  } else {
    return number;
  }
}


x86 assembly (clang, -O0):
<sumOfNaturalNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1145 <sumOfNaturalNumbers+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sumOfNaturalNumbers@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <sumOfNaturalNumbers+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOfNaturalNumbers>:
test   %edi,%edi
je     1119 <sumOfNaturalNumbers+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumOfNaturalNumbers(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int const, long, int /*<<< orphan*/);
void recoverpos(const int fd, long save_pos) { lseek(fd, save_pos, SEEK_SET); }


x86 assembly (clang, -O0):
<recoverpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recoverpos>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @recoverpos(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @lseek(i32 %5, i64 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @recoverpos(i32 %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i64 %1, i32 %3)
ret void
}
int start_remote_job(argv, stdin_fd, is_remote, id_ptr, used_stdin)
char **argv;
int stdin_fd;
int *is_remote;
int *id_ptr;
int *used_stdin;
{ return -1; }


x86 assembly (clang, -O0):
<start_remote_job>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @start_remote_job(i8** nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int n;

/* Variables and functions */
long C_flonum(long **, double);
long C_long_to_num(long **ptr, long n) {
  if ((((n)&0x8000000000000000L) == (((n)&0x4000000000000000L) << 1)))
    return (((long)(n) << 1) | 0x00000001);
  else
    return C_flonum(ptr, (double)n);
}


x86 assembly (clang, -O0):
<C_long_to_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movabs $0x8000000000000000,%rax
and    -0x18(%rbp),%rax
movabs $0x4000000000000000,%rcx
and    -0x18(%rbp),%rcx
shl    $0x1,%rcx
cmp    %rcx,%rax
jne    115e <C_long_to_num+0x4e>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
or     $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <C_long_to_num+0x61>
mov    -0x10(%rbp),%rdi
cvtsi2sdq -0x18(%rbp),%xmm0
call   1030 <C_flonum@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_long_to_num>:
lea    (%rsi,%rsi,1),%rax
mov    %rax,%rcx
xor    %rsi,%rcx
js     1121 <C_long_to_num+0x11>
or     $0x1,%rax
ret
cvtsi2sd %rsi,%xmm0
jmp    1030 <C_flonum@plt>

LLVM IR (-O0):
define i64 @C_long_to_num(i64** %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64**
%5 = alloca i64
store i64** %0, i64*** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = and i64 %6, -9223372036854775808
%8 = load i64, i64* %5
%9 = and i64 %8, 4611686018427387904
%10 = shl i64 %9, 1
%11 = icmp eq i64 %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i64, i64* %5
%14 = shl i64 %13, 1
%15 = or i64 %14, 1
store i64 %15, i64* %3
br label %21
16: ; preds = %2
%17 = load i64**, i64*** %4
%18 = load i64, i64* %5
%19 = sitofp i64 %18 to double
%20 = call i64 @C_flonum(i64** %17, double %19)
store i64 %20, i64* %3
br label %21
21: ; preds = %16, %12
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @C_long_to_num(i64** %0, i64 %1) {
%3 = shl i64 %1, 1
%4 = xor i64 %3, %1
%5 = icmp sgt i64 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = or i64 %3, 1
br label %11
8: ; preds = %2
%9 = sitofp i64 %1 to double
%10 = tail call i64 @C_flonum(i64** %0, double %9)
br label %11
11: ; preds = %8, %6
%12 = phi i64 [ %7, %6 ], [ %10, %8 ]
ret i64 %12
}
void XFreeFontPath() {}


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

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

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

LLVM IR (-O2):
define void @XFreeFontPath() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ one();
void two() { one(); }


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

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

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

LLVM IR (-O2):
define void @two() {
%1 = tail call i32 (...) @one()
ret void
}
double dmax(double a, double b) { return ((a) > (b)) ? (a) : (b); }


x86 assembly (clang, -O0):
<dmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <dmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <dmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmax>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @dmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int utf8clen(const char *s) {
  unsigned char c = *s;
  return 1 + (c >= 0xC0) + (c >= 0xE0) + (c >= 0xF0);
}


x86 assembly (clang, -O0):
<utf8clen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xc0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x1,%eax
movzbl -0x9(%rbp),%ecx
cmp    $0xe0,%ecx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
movzbl -0x9(%rbp),%ecx
cmp    $0xf0,%ecx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8clen>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0xc0,%cl
setae  %al
cmp    $0xe0,%cl
sbb    $0xffffffff,%eax
cmp    $0xf0,%cl
sbb    $0xffffffff,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @utf8clen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ugt i8 %2, -65
%4 = select i1 %3, i32 2, i32 1
%5 = icmp ugt i8 %2, -33
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %4, %6
%8 = icmp ugt i8 %2, -17
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %7, %9
ret i32 %10
}