xunge/DecIR huggingface dataset:
/* Variables and functions */
int factoring(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("the factoring of %d is: %d\n", 5, factoring(5));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"the factoring of %d is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @factoring(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *,
                          char const *);
void fatalErrorResp(const char *message, const char *status) {
  if (status == NULL)
    status = "500 Internal Server Error";
  printf("Content-Type: text/html\nStatus: %s\n\n"
         "<!DOCTYPE html><html><head>\n<title>%s</title>\n</head>\n"
         "<body><h3>%s</h3>\n%s\n</body></html>",
         status, status, status, message);
  exit(1);
}


x86 assembly (clang, -O0):
<fatalErrorResp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <fatalErrorResp+0x26>
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatalErrorResp>:
push   %rax
mov    %rdi,%r8
test   %rsi,%rsi
lea    0xed2(%rip),%rcx
cmovne %rsi,%rcx
lea    0xee1(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"500 Internal Server Error\00"
@.str.1 = [126 x i8] c"Content-Type: text/html\0AStatus: %s\0A\0A<!DOCTYPE html><html><head>\0A<title>%s</title>\0A</head>\0A<body><h3>%s</h3>\0A%s\0A</body></html>\00"
define void @fatalErrorResp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %4
br label %8
8: ; preds = %7, %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"500 Internal Server Error\00"
@.str.1 = [126 x i8] c"Content-Type: text/html\0AStatus: %s\0A\0A<!DOCTYPE html><html><head>\0A<title>%s</title>\0A</head>\0A<body><h3>%s</h3>\0A%s\0A</body></html>\00"
define void @fatalErrorResp(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %4, i8* %4, i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_1Euint16_mem(unsigned short *val) {
  return ((*val) & (-0x1E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Euint16_mem>:
movzwl (%rdi),%eax
test   $0xffe2,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Euint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -30
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_1Euint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -30
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
adrx0adrreg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((((int *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
jg     1140 <adrx0adrreg1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <adrx0adrreg1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrreg1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %5, i64 277777
%11 = load i32, i32* %10
%12 = icmp sle i32 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
void RTLockValidatorQueryBlocking(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorQueryBlocking() {
ret void
}
int security_inode_unlink(struct inode *dir, struct dentry *dentry) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.dentry = type opaque
define i32 @security_inode_unlink(%struct.inode* %0, %struct.dentry* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.dentry*
store %struct.inode* %0, %struct.inode** %3
store %struct.dentry* %1, %struct.dentry** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.dentry = type opaque
define i32 @security_inode_unlink(%struct.inode* nocapture readnone %0, %struct.dentry* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
short highestSample(int);
short lowestSample(int);
short alternateHighestLowestSample(int n) {
  return (n % 2 == 0) ? highestSample(n) : lowestSample(n);
}


x86 assembly (clang, -O0):
<alternateHighestLowestSample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1150 <alternateHighestLowestSample+0x30>
mov    -0x4(%rbp),%edi
call   1030 <highestSample@plt>
cwtl
mov    %eax,-0x8(%rbp)
jmp    115c <alternateHighestLowestSample+0x3c>
mov    -0x4(%rbp),%edi
call   1040 <lowestSample@plt>
cwtl
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alternateHighestLowestSample>:
test   $0x1,%dil
jne    112b <alternateHighestLowestSample+0xb>
jmp    1030 <highestSample@plt>
jmp    1040 <lowestSample@plt>

LLVM IR (-O0):
define signext i16 @alternateHighestLowestSample(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call signext i16 @highestSample(i32 %7)
%9 = sext i16 %8 to i32
br label %14
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call signext i16 @lowestSample(i32 %11)
%13 = sext i16 %12 to i32
br label %14
14: ; preds = %10, %6
%15 = phi i32 [ %9, %6 ], [ %13, %10 ]
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @alternateHighestLowestSample(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call signext i16 @highestSample(i32 %0)
br label %8
6: ; preds = %1
%7 = tail call signext i16 @lowestSample(i32 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i16 [ %5, %4 ], [ %7, %6 ]
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ find_data();
int /*<<< orphan*/ hash_data();
int /*<<< orphan*/ output_result();
int main(int argc, char *argv[]) {
  find_data();
  hash_data();
  output_result();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <find_data@plt>
mov    $0x0,%al
call   1050 <hash_data@plt>
mov    $0x0,%al
call   1030 <output_result@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @find_data()
%7 = call i32 (...) @hash_data()
%8 = call i32 (...) @output_result()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @find_data()
%4 = tail call i32 (...) @hash_data()
%5 = tail call i32 (...) @output_result()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ jeu();
int /*<<< orphan*/ recupererInformationPersonnage(char const *);
void chargerSauvegarde(const char *nomSauvegarde) {
  recupererInformationPersonnage(nomSauvegarde);
  jeu();
}


x86 assembly (clang, -O0):
<chargerSauvegarde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <recupererInformationPersonnage@plt>
mov    $0x0,%al
call   1030 <jeu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chargerSauvegarde>:
push   %rax
call   1040 <recupererInformationPersonnage@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <jeu@plt>

LLVM IR (-O0):
define void @chargerSauvegarde(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @recupererInformationPersonnage(i8* %3)
%5 = call i32 (...) @jeu()
ret void
}

LLVM IR (-O2):
define void @chargerSauvegarde(i8* %0) {
%2 = tail call i32 @recupererInformationPersonnage(i8* %0)
%3 = tail call i32 (...) @jeu()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RFM69_WriteWord(int, int);
void RFM69_ClearIrqFlags(void) { RFM69_WriteWord(0x0010 | 0x0800, 0x27); }


x86 assembly (clang, -O0):
<RFM69_ClearIrqFlags>:
push   %rbp
mov    %rsp,%rbp
mov    $0x810,%edi
mov    $0x27,%esi
call   1030 <RFM69_WriteWord@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFM69_ClearIrqFlags>:
mov    $0x810,%edi
mov    $0x27,%esi
jmp    1030 <RFM69_WriteWord@plt>

LLVM IR (-O0):
define void @RFM69_ClearIrqFlags() {
%1 = call i32 @RFM69_WriteWord(i32 2064, i32 39)
ret void
}

LLVM IR (-O2):
define void @RFM69_ClearIrqFlags() {
%1 = tail call i32 @RFM69_WriteWord(i32 2064, i32 39)
ret void
}
/* Variables and functions */
unsigned char _utf8_shiftpos(unsigned int, int /*<<< orphan*/);
unsigned long _utf8_header_value(unsigned char header, unsigned w) {
  return (header & ((unsigned char)~0 >> (7 - w))) << _utf8_shiftpos(w, 0);
}


x86 assembly (clang, -O0):
<_utf8_header_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x7,%ecx
sub    -0x8(%rbp),%ecx
mov    $0xff,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <_utf8_shiftpos@plt>
mov    %al,%cl
mov    -0xc(%rbp),%eax
movzbl %cl,%ecx
shl    %cl,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_utf8_header_value>:
push   %rbx
mov    $0x7,%cl
sub    %sil,%cl
mov    $0xff,%ebx
shr    %cl,%ebx
and    %edi,%ebx
mov    %esi,%edi
xor    %esi,%esi
call   1030 <_utf8_shiftpos@plt>
mov    %eax,%ecx
shl    %cl,%ebx
movslq %ebx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @_utf8_header_value(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 7, %7
%9 = ashr i32 255, %8
%10 = and i32 %6, %9
%11 = load i32, i32* %4
%12 = call zeroext i8 @_utf8_shiftpos(i32 %11, i32 0)
%13 = zext i8 %12 to i32
%14 = shl i32 %10, %13
%15 = sext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @_utf8_header_value(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 7, %1
%5 = lshr i32 255, %4
%6 = and i32 %5, %3
%7 = tail call zeroext i8 @_utf8_shiftpos(i32 %1, i32 0)
%8 = zext i8 %7 to i32
%9 = shl i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
int Lexeme_estKey(char const *);
int verifier_nom_var(const char *nom) {
  if (Lexeme_estKey(nom) == 1)
    return 0;
  if (*nom <= '0' && *nom <= '9')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verifier_nom_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Lexeme_estKey@plt>
cmp    $0x1,%eax
jne    113a <verifier_nom_var+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    116d <verifier_nom_var+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jg     1166 <verifier_nom_var+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1166 <verifier_nom_var+0x56>
movl   $0x0,-0x4(%rbp)
jmp    116d <verifier_nom_var+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifier_nom_var>:
push   %rbx
mov    %rdi,%rbx
call   1030 <Lexeme_estKey@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
je     112a <verifier_nom_var+0x1a>
xor    %eax,%eax
cmpb   $0x31,(%rbx)
setge  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @verifier_nom_var(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @Lexeme_estKey(i8* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 48
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 57
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %2
br label %20
19: ; preds = %13, %8
store i32 1, i32* %2
br label %20
20: ; preds = %19, %18, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @verifier_nom_var(i8* %0) {
%2 = tail call i32 @Lexeme_estKey(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp sgt i8 %5, 48
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EOF;
int EXIT_SUCCESS;
int main(void) {
  (void)EOF;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EOF
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int _execve(char *name, char **argv, char **env) {
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_execve>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(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 i32, i32* @ENOMEM
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int M_PI;
float fixAnglef(float angle) {
  if (angle < 0)
    angle += 2 * M_PI;
  else if (angle > 2 * M_PI)
    angle -= 2 * M_PI;
  return angle;
}


x86 assembly (clang, -O0):
<fixAnglef>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1135 <fixAnglef+0x35>
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1176 <fixAnglef+0x76>
movss  -0x4(%rbp),%xmm0
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jbe    1171 <fixAnglef+0x71>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1176 <fixAnglef+0x76>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixAnglef>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
jbe    111f <fixAnglef+0x1f>
addss  %xmm1,%xmm0
ret
ucomiss %xmm1,%xmm0
jbe    1128 <fixAnglef+0x28>
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @fixAnglef(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* @M_PI
%7 = mul nsw i32 2, %6
%8 = sitofp i32 %7 to float
%9 = load float, float* %2
%10 = fadd float %9, %8
store float %10, float* %2
br label %24
11: ; preds = %1
%12 = load float, float* %2
%13 = load i32, i32* @M_PI
%14 = mul nsw i32 2, %13
%15 = sitofp i32 %14 to float
%16 = fcmp ogt float %12, %15
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load i32, i32* @M_PI
%19 = mul nsw i32 2, %18
%20 = sitofp i32 %19 to float
%21 = load float, float* %2
%22 = fsub float %21, %20
store float %22, float* %2
br label %23
23: ; preds = %17, %11
br label %24
24: ; preds = %23, %5
%25 = load float, float* %2
ret float %25
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @fixAnglef(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = load i32, i32* @M_PI
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to float
br i1 %2, label %6, label %8
6: ; preds = %1
%7 = fadd float %5, %0
br label %12
8: ; preds = %1
%9 = fcmp olt float %5, %0
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = fsub float %0, %5
br label %12
12: ; preds = %8, %10, %6
%13 = phi float [ %7, %6 ], [ %11, %10 ], [ %0, %8 ]
ret float %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int bcm2835_read(int);
int /*<<< orphan*/ bcm2835_write(int, int);
int timer_init(void) {
  uint32_t old;
  old = bcm2835_read((0 + 0x00b000 + 0x408));
  old &= ~((1 << 7) | (1 << 5));
  bcm2835_write((0 + 0x00b000 + 0x408), old);
  bcm2835_write((0 + 0x00b000 + 0x41c), 0xf9);
  bcm2835_write((0 + 0x00b000 + 0x400), 61);
  bcm2835_write((0 + 0x00b000 + 0x408),
                (1 << 1) | (1 << 7) | (1 << 5) | (2 << 2));
  bcm2835_write((0 + 0x00b000 + 0x218), (1 << 0));
  return 0;
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb408,%edi
call   1030 <bcm2835_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff5f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xb408,%edi
call   1040 <bcm2835_write@plt>
mov    $0xb41c,%edi
mov    $0xf9,%esi
call   1040 <bcm2835_write@plt>
mov    $0xb400,%edi
mov    $0x3d,%esi
call   1040 <bcm2835_write@plt>
mov    $0xb408,%edi
mov    $0xaa,%esi
call   1040 <bcm2835_write@plt>
mov    $0xb218,%edi
mov    $0x1,%esi
call   1040 <bcm2835_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
push   %rax
mov    $0xb408,%edi
call   1030 <bcm2835_read@plt>
and    $0xffffff5f,%eax
mov    $0xb408,%edi
mov    %eax,%esi
call   1040 <bcm2835_write@plt>
mov    $0xb41c,%edi
mov    $0xf9,%esi
call   1040 <bcm2835_write@plt>
mov    $0xb400,%edi
mov    $0x3d,%esi
call   1040 <bcm2835_write@plt>
mov    $0xb408,%edi
mov    $0xaa,%esi
call   1040 <bcm2835_write@plt>
mov    $0xb218,%edi
mov    $0x1,%esi
call   1040 <bcm2835_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @timer_init() {
%1 = alloca i32
%2 = call i32 @bcm2835_read(i32 46088)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -161
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @bcm2835_write(i32 46088, i32 %5)
%7 = call i32 @bcm2835_write(i32 46108, i32 249)
%8 = call i32 @bcm2835_write(i32 46080, i32 61)
%9 = call i32 @bcm2835_write(i32 46088, i32 170)
%10 = call i32 @bcm2835_write(i32 45592, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @timer_init() {
%1 = tail call i32 @bcm2835_read(i32 46088)
%2 = and i32 %1, -161
%3 = tail call i32 @bcm2835_write(i32 46088, i32 %2)
%4 = tail call i32 @bcm2835_write(i32 46108, i32 249)
%5 = tail call i32 @bcm2835_write(i32 46080, i32 61)
%6 = tail call i32 @bcm2835_write(i32 46088, i32 170)
%7 = tail call i32 @bcm2835_write(i32 45592, i32 1)
ret i32 0
}
double ident(double x) { return (x); }


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

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

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

LLVM IR (-O2):
define double @ident(double returned %0) {
ret double %0
}
char *next_delim(char *str) {
  while (*str != '\t' && *str != '\n' && *str != '\r' && *str != '\0')
    str++;
  return str;
}


x86 assembly (clang, -O0):
<next_delim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1157 <next_delim+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1157 <next_delim+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     1157 <next_delim+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <next_delim+0x67>
jmp    1178 <next_delim+0x78>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <next_delim+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_delim>:
mov    %rdi,%rax
mov    $0x2601,%ecx
jmp    1114 <next_delim+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0xd,%rdx
ja     1110 <next_delim+0x10>
bt     %rdx,%rcx
jae    1110 <next_delim+0x10>
ret

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

LLVM IR (-O2):
define i8* @next_delim(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 9, label %7
i8 10, label %7
i8 13, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
ret i8* %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 < 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
int f1t(int x1, int x2, int x3, int x4, int x5, int x6) {
  return 3 * x1 + 4 * ((x2 - x3) * x5 + 5) * x6 - 4 * x4;
}


x86 assembly (clang, -O0):
<f1t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    $0x5,%ecx
shl    $0x2,%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1t>:
lea    (%rdi,%rdi,2),%eax
sub    %edx,%esi
imul   %r8d,%esi
lea    0x14(,%rsi,4),%edx
imul   %r9d,%edx
shl    $0x2,%ecx
sub    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f1t(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = mul nsw i32 3, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = sub nsw i32 %15, %16
%18 = load i32, i32* %11
%19 = mul nsw i32 %17, %18
%20 = add nsw i32 %19, 5
%21 = mul nsw i32 4, %20
%22 = load i32, i32* %12
%23 = mul nsw i32 %21, %22
%24 = add nsw i32 %14, %23
%25 = load i32, i32* %10
%26 = mul nsw i32 4, %25
%27 = sub nsw i32 %24, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @f1t(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %0, 3
%8 = sub nsw i32 %1, %2
%9 = shl i32 %8, 2
%10 = mul i32 %9, %4
%11 = add i32 %10, 20
%12 = mul nsw i32 %11, %5
%13 = mul i32 %3, -4
%14 = add i32 %13, %7
%15 = add i32 %14, %12
ret i32 %15
}
int test24(int flag) {
  unsigned val;
  if (flag)
    val = 1;
  if (!flag)
    val = 1;
  return val;
}


x86 assembly (clang, -O0):
<test24>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1118 <test24+0x18>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1129 <test24+0x29>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test24(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void checkedFGets(char *s, int size, FILE *stream) {
  if (fgets(s, size, stream) == NULL) {
    fprintf(stderr, "fgets failed\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkedFGets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1180 <checkedFGets+0x50>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkedFGets>:
push   %rax
call   1030 <fgets@plt>
test   %rax,%rax
je     113d <checkedFGets+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"fgets failed\0A\00"
@EXIT_FAILURE = global i32 0
define void @checkedFGets(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"fgets failed\0A\00"
@EXIT_FAILURE = global i32 0
define void @checkedFGets(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float to_real2f(uint32_t v) {
  v = 0x3f800000 | (v >> 9);
  return (*(float *)&v) - 1.0f;
}


x86 assembly (clang, -O0):
<to_real2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x9,%eax
or     $0x3f800000,%eax
mov    %eax,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xede(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_real2f>:
sar    $0x9,%edi
or     $0x3f800000,%edi
movd   %edi,%xmm0
addss  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define float @to_real2f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 9
%5 = or i32 1065353216, %4
store i32 %5, i32* %2
%6 = bitcast i32* %2 to float*
%7 = load float, float* %6
%8 = fsub float %7, 1.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @to_real2f(i32 %0) {
%2 = ashr i32 %0, 9
%3 = or i32 %2, 1065353216
%4 = bitcast i32 %3 to float
%5 = fadd float %4, -1.000000e+00
ret float %5
}
MAIN__() {}


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

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

LLVM IR (-O0):
define i32 @MAIN__() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @MAIN__() {
ret i32 undef
}
double metresToMillimetres(double metres) { return metres * 1000.0; }


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

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

LLVM IR (-O0):
define double @metresToMillimetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @metresToMillimetres(double %0) {
%2 = fmul double %0, 1.000000e+03
ret double %2
}
unsigned int __attribute__((const)) __eloop_threshold(void) { return 32; }


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

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

LLVM IR (-O0):
define i32 @__eloop_threshold() {
ret i32 32
}

LLVM IR (-O2):
define i32 @__eloop_threshold() {
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned long plusccla(unsigned long a, unsigned long b) {
  unsigned long sum = a + b;
  if (sum < a)
    abort();
  return sum;
}


x86 assembly (clang, -O0):
<plusccla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1141 <plusccla+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plusccla>:
add    %rsi,%rdi
jb     1119 <plusccla+0x9>
mov    %rdi,%rax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i64 @plusccla(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ult i64 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i64 %3
}
void XDisplayWidth() {}


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

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

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

LLVM IR (-O2):
define void @XDisplayWidth() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
bool is_dir(const char *filename) {
  struct stat st;
  if (stat(filename, &st) < 0)
    return false;
  return S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    114f <is_dir+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_dir+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1138 <is_dir+0x18>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
double dt2epb(date, time)
double date;
double time;
{
  double dj;
  double epoch;
  dj = dt2jd(date, time);
  if (date == 0.0)
    epoch = dj / 365.242198781;
  else
    epoch = jd2epb(dj);
  return (epoch);
}


x86 assembly (clang, -O0):
<dt2epb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117f <dt2epb+0x5f>
jp     117f <dt2epb+0x5f>
movsd  -0x18(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1194 <dt2epb+0x74>
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2epb@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt2epb>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%al
call   1030 <dt2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorpd  %xmm1,%xmm1
movsd  (%rsp),%xmm2
ucomisd %xmm1,%xmm2
jne    114f <dt2epb+0x2f>
jp     114f <dt2epb+0x2f>
divsd  0xeb3(%rip),%xmm0
pop    %rax
ret
mov    $0x1,%al
call   1040 <jd2epb@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dt2epb(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* %3
%8 = load double, double* %4
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %7, double %8)
%10 = sitofp i32 %9 to double
store double %10, double* %5
%11 = load double, double* %3
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load double, double* %5
%15 = fdiv double %14, 0x4076D3E00BD4386B
store double %15, double* %6
br label %20
16: ; preds = %2
%17 = load double, double* %5
%18 = call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %17)
%19 = sitofp i32 %18 to double
store double %19, double* %6
br label %20
20: ; preds = %16, %13
%21 = load double, double* %6
ret double %21
}

LLVM IR (-O2):
define double @dt2epb(double %0, double %1) {
%3 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dt2jd to i32 (double, double, ...)*)(double %0, double %1)
%4 = sitofp i32 %3 to double
%5 = fcmp oeq double %0, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = fdiv double %4, 0x4076D3E00BD4386B
br label %11
8: ; preds = %2
%9 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %4)
%10 = sitofp i32 %9 to double
br label %11
11: ; preds = %8, %6
%12 = phi double [ %7, %6 ], [ %10, %8 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ zwave_sendClassCommand(unsigned int, int, int,
                                          unsigned char *, int);
void zwavecmd_indicator_set(unsigned int id, unsigned char v) {
  unsigned char buf[1];
  buf[0] = v;
  zwave_sendClassCommand(id, 0x87, 0x01, buf, 1);
}


x86 assembly (clang, -O0):
<zwavecmd_indicator_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rcx
mov    $0x87,%esi
mov    $0x1,%r8d
mov    %r8d,%edx
call   1030 <zwave_sendClassCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_indicator_set>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rcx
mov    $0x87,%esi
mov    $0x1,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @zwavecmd_indicator_set(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [1 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i32, i32* %3
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%10 = call i32 @zwave_sendClassCommand(i32 %8, i32 135, i32 1, i8* %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @zwavecmd_indicator_set(i32 %0, i8 zeroext %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = call i32 @zwave_sendClassCommand(i32 %0, i32 135, i32 1, i8* %4, i32 1)
ret void
}
int middle(int *list, int low, int high) { return (low + high) / 2; }


x86 assembly (clang, -O0):
<middle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle>:
lea    (%rsi,%rdx,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @middle(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = add nsw i32 %7, %8
%10 = sdiv i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @middle(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = sdiv i32 %4, 2
ret i32 %5
}
void XSetAuthorization() {}


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

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

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

LLVM IR (-O2):
define void @XSetAuthorization() {
ret void
}
void BatteryMeasure_term() {}


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

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

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

LLVM IR (-O2):
define void @BatteryMeasure_term() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t get_bit(uint8_t src, uint8_t bit_i) { return (src & (1 << bit_i)) > 0; }


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edi,%edx
setg   %al
ret

LLVM IR (-O0):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, char const *);
int xsfprintf(FILE *stream, const char *text) {
  return fprintf(stream, "%s", text);
}


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

x86 assembly (clang, -O2):
<xsfprintf>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @xsfprintf(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @xsfprintf(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ free_bgEntries();
void bi_exit(char *line) {
  free(line);
  free_bgEntries();
  exit(0);
}


x86 assembly (clang, -O0):
<bi_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <free_bgEntries@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<bi_exit>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <free_bgEntries@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @bi_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
%5 = call i32 (...) @free_bgEntries()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @bi_exit(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
%3 = tail call i32 (...) @free_bgEntries()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int O_NOCTTY;
int O_NONBLOCK;
int O_RDWR;
int open(char const *, int);
int uart_open(const char *fn) {
  return open(fn, O_RDWR | O_NOCTTY | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<uart_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_open>:
mov    0x2ed1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eb7(%rip),%rax
or     (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @uart_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_NOCTTY
%6 = or i32 %4, %5
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %6, %7
%9 = call i32 @open(i8* %3, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @uart_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6)
ret i32 %7
}