xunge/DecIR huggingface dataset:
/* Type definitions */
struct mainwindow {
  int dummy;
};

/* Variables and functions */
int refresh_all(struct mainwindow *);
int handle_refresh_all(struct mainwindow *mw) { return refresh_all(mw); }


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

x86 assembly (clang, -O2):
<handle_refresh_all>:
jmp    1030 <refresh_all@plt>

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

LLVM IR (-O2):
%struct.mainwindow = type { i32 }
define i32 @handle_refresh_all(%struct.mainwindow* %0) {
%2 = tail call i32 @refresh_all(%struct.mainwindow* %0)
ret i32 %2
}
void cleanUp(int **p) {
  printf("\n %s: \n", __func__);
  printf("\n %p \n", *p);
  free(*p);
}


x86 assembly (clang, -O0):
<cleanUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanUp>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.cleanUp = [8 x i8] c"cleanUp\00"
@.str.1 = [7 x i8] c"\0A %p \0A\00"
define void @cleanUp(i32** nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.cleanUp, i64 0, i64 0))
%3 = load i32*, i32** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%5 = bitcast i32** %0 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
ret void
}
int main(void) {
  int counter;
  for (counter = 0; counter < 5; counter) {
    int a;
    counter++;
  }
  for (counter = 0; counter < 5;) {
    int b;
    counter++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1149 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <main+0x31>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
f() { return 1 << -5; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 poison
}

LLVM IR (-O2):
define i32 @f() {
ret i32 poison
}
void put_le16(unsigned short val, unsigned char *p) {
  *p++ = val;
  *p++ = val >> 8;
}


x86 assembly (clang, -O0):
<put_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_le16>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @put_le16(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = trunc i16 %5 to i8
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
store i8 %6, i8* %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
store i8 %12, i8* %13
ret void
}

LLVM IR (-O2):
define void @put_le16(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = trunc i16 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %3, i8* %1
%5 = lshr i16 %0, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
ret void
}
/* Variables and functions */
unsigned int _bzhi_u32(unsigned int, unsigned int);
unsigned int test_bzhi_u32(unsigned int __X, unsigned int __Y) {
  return _bzhi_u32(__X, __Y);
}


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

x86 assembly (clang, -O2):
<test_bzhi_u32>:
jmp    1030 <_bzhi_u32@plt>

LLVM IR (-O0):
define i32 @test_bzhi_u32(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 = call i32 @_bzhi_u32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_bzhi_u32(i32 %0, i32 %1) {
%3 = tail call i32 @_bzhi_u32(i32 %0, i32 %1)
ret i32 %3
}
int test_imm_93int16_mem(short *val) {
  return ((*val) & (0x93 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_93int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 147
%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_93int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 147
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int v_unsigned_int_func() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @v_unsigned_int_func() {
ret i32 0
}
int pq_countcols(const char *buffer, const char *delim) {
  int count;
  const char *tmp;
  count = 0;
  tmp = buffer;
  while (*tmp) {
    if (*delim == *tmp) {
      count++;
    }
    tmp++;
  }
  return count + 1;
}


x86 assembly (clang, -O0):
<pq_countcols>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <pq_countcols+0x58>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1147 <pq_countcols+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111b <pq_countcols+0x1b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pq_countcols>:
mov    (%rdi),%dl
test   %dl,%dl
je     1129 <pq_countcols+0x29>
mov    (%rsi),%cl
add    $0x1,%rdi
xor    %eax,%eax
xchg   %ax,%ax
xor    %esi,%esi
cmp    %dl,%cl
sete   %sil
add    %esi,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <pq_countcols+0x10>
add    $0x1,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @pq_countcols(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2
%6 = load i8, i8* %1
br label %7
7: ; preds = %5, %7
%8 = phi i8 [ %3, %5 ], [ %15, %7 ]
%9 = phi i8* [ %0, %5 ], [ %14, %7 ]
%10 = phi i32 [ 0, %5 ], [ %13, %7 ]
%11 = icmp eq i8 %6, %8
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %10, %12
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7
%18 = add nuw i32 %13, 1
br label %19
19: ; preds = %17, %2
%20 = phi i32 [ 1, %2 ], [ %18, %17 ]
ret i32 %20
}
int test_imm_66int8_reg(signed char val) {
  return ((val) & (-0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff9a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66int8_reg>:
test   $0x9a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_66int8_reg(i8 signext %0) {
%2 = and i8 %0, -102
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destructNode(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @destructNode(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
plt(int mode, double x, double y) {}


x86 assembly (clang, -O0):
<plt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @plt(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @plt(i32 %0, double %1, double %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help_menu(void) {
  printf("\nAvailable commands:\n"
         "  open NAME                  open card NAME\n"
         "  reset                      reset sound card to default state\n"
         "  reload                     reload configuration\n"
         "  listcards                  list available cards\n"
         "  list IDENTIFIER            list command\n"
         "  get IDENTIFIER             get string value\n"
         "  geti IDENTIFIER            get integer value\n"
         "  set IDENTIFIER VALUE       set string value\n"
         "  help                     help\n"
         "  quit                     quit\n");
}


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

x86 assembly (clang, -O2):
<print_help_menu>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [474 x i8] c"\0AAvailable commands:\0A open NAME open card NAME\0A reset reset sound card to default state\0A reload reload configuration\0A listcards list available cards\0A list IDENTIFIER list command\0A get IDENTIFIER get string value\0A geti IDENTIFIER get integer value\0A set IDENTIFIER VALUE set string value\0A help help\0A quit quit\0A\00"
define void @print_help_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([474 x i8], [474 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [473 x i8] c"\0AAvailable commands:\0A open NAME open card NAME\0A reset reset sound card to default state\0A reload reload configuration\0A listcards list available cards\0A list IDENTIFIER list command\0A get IDENTIFIER get string value\0A geti IDENTIFIER get integer value\0A set IDENTIFIER VALUE set string value\0A help help\0A quit quit\00"
define void @print_help_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([473 x i8], [473 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
int /*<<< orphan*/ padding(int);
void cuf(int pn) {
  brc(pn, 'C');
  padding(2);
}


x86 assembly (clang, -O0):
<cuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x43,%esi
call   1040 <brc@plt>
mov    $0x2,%edi
call   1030 <padding@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cuf>:
push   %rax
mov    $0x43,%esi
call   1040 <brc@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <padding@plt>

LLVM IR (-O0):
define void @cuf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @brc(i32 %3, i8 signext 67)
%5 = call i32 @padding(i32 2)
ret void
}

LLVM IR (-O2):
define void @cuf(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 67)
%3 = tail call i32 @padding(i32 2)
ret void
}
/* Variables and functions */
char *nvram_get(char *);
int /*<<< orphan*/ strcmp(char const *, char *);
int nvram_match(char *name, char *match) {
  const char *value = nvram_get(name);
  return (value && !strcmp(value, match));
}


x86 assembly (clang, -O0):
<nvram_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nvram_get@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1165 <nvram_match+0x45>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_match>:
push   %rbx
mov    %rsi,%rbx
call   1040 <nvram_get@plt>
test   %rax,%rax
je     1144 <nvram_match+0x24>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nvram_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @nvram_get(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @nvram_match(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @nvram_get(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
int main(void) {
  int fortytwo = 42;
  int twentyone = 21;
  return (fortytwo / 2) + ((twentyone + twentyone) / 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0x15,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
int bgtzInstruction(int i) { return (i > 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<bgtzInstruction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgtzInstruction>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @bgtzInstruction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @bgtzInstruction(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/, char *, char const *, unsigned int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ write_error();
void write_octal_metadata(const char *key, unsigned int value) {
  if (fprintf(stdout, "%s:\t%.7o\n", key, value) < 0) {
    write_error();
  }
}


x86 assembly (clang, -O0):
<write_octal_metadata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    115c <write_octal_metadata+0x3c>
mov    $0x0,%al
call   1040 <write_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_octal_metadata>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
test   %rax,%rax
js     1142 <write_octal_metadata+0x22>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_error@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"%s:\09%.7o\0A\00"
define void @write_octal_metadata(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i64 @fprintf(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @write_error()
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"%s:\09%.7o\0A\00"
define void @write_octal_metadata(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @write_error()
br label %8
8: ; preds = %6, %2
ret void
}
void FillChunk(unsigned char *p) {}


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

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

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

LLVM IR (-O2):
define void @FillChunk(i8* nocapture %0) {
ret void
}
void framebuffer_sync() {}


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

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

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

LLVM IR (-O2):
define void @framebuffer_sync() {
ret void
}
int symmetrized_coordinates(int i, int l) {
  int ll = 2 * l;
  i = (i + ll) % (ll);
  if (i > l - 1) {
    i = ll - 1 - i;
  }
  return i;
}


x86 assembly (clang, -O0):
<symmetrized_coordinates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    113d <symmetrized_coordinates+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symmetrized_coordinates>:
lea    (%rsi,%rsi,1),%ecx
lea    (%rdi,%rsi,2),%eax
cltd
idiv   %ecx
cmp    %esi,%edx
mov    %edx,%eax
not    %eax
lea    (%rax,%rsi,2),%eax
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @symmetrized_coordinates(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = add nsw i32 %3, %0
%5 = srem i32 %4, %3
%6 = icmp slt i32 %5, %1
%7 = xor i32 %5, -1
%8 = add i32 %3, %7
%9 = select i1 %6, i32 %5, i32 %8
ret i32 %9
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
int ceph_frag_mask(int);
int ceph_frag_value(int);
int ceph_frag_contains_value(__u32 f, __u32 v) {
  return (v & ceph_frag_mask(f)) == ceph_frag_value(f);
}


x86 assembly (clang, -O0):
<ceph_frag_contains_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ceph_frag_mask@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_value@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_frag_contains_value>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <ceph_frag_mask@plt>
mov    %eax,%ebx
and    %r14d,%ebx
mov    %ebp,%edi
call   1030 <ceph_frag_value@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ceph_frag_contains_value(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @ceph_frag_mask(i32 %6)
%8 = and i32 %5, %7
%9 = load i32, i32* %3
%10 = call i32 @ceph_frag_value(i32 %9)
%11 = icmp eq i32 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ceph_frag_contains_value(i32 %0, i32 %1) {
%3 = tail call i32 @ceph_frag_mask(i32 %0)
%4 = and i32 %3, %1
%5 = tail call i32 @ceph_frag_value(i32 %0)
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int dwarf_get_INL_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_INL_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_INL_name(val_in, &v);
  return ellipname(res, val_in, v, "INL", printonerr);
}


x86 assembly (clang, -O0):
<get_INL_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <dwarf_get_INL_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1030 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_INL_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1040 <dwarf_get_INL_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1030 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"INL\00"
define i8* @get_INL_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_INL_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"INL\00"
define i8* @get_INL_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_INL_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetHorizontalKeystone(void *,
                                                                       int);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_GetHorizontalKeystone(void *upnptoken,
                                                unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_GetHorizontalKeystone(%u);\r\n",
         InstanceID);
  UPnPResponse_RenderingControl_GetHorizontalKeystone(upnptoken, 25000);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetHorizontalKeystone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x61a8,%esi
call   1040 <UPnPResponse_RenderingControl_GetHorizontalKeystone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetHorizontalKeystone>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61a8,%esi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_GetHorizontalKeystone@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Invoke: UPnPRenderingControl_GetHorizontalKeystone(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetHorizontalKeystone(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_RenderingControl_GetHorizontalKeystone(i8* %7, i32 25000)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Invoke: UPnPRenderingControl_GetHorizontalKeystone(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetHorizontalKeystone(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_RenderingControl_GetHorizontalKeystone(i8* %0, i32 25000)
ret void
}
void set_exclusive_use(fd) int fd;
{}


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

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

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

LLVM IR (-O2):
define void @set_exclusive_use(i32 %0) {
ret void
}
/* Variables and functions */
int nrf_read_register(int, char *, char *);
int nrf_get_payload_length(int *length, char *retstatus) {
  char reg;
  int ret;
  ret = nrf_read_register(0x60, &reg, retstatus);
  *length = reg & 0x3F;
  return ret;
}


x86 assembly (clang, -O0):
<nrf_get_payload_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x60,%edi
lea    -0x11(%rbp),%rsi
call   1030 <nrf_read_register@plt>
mov    %eax,-0x18(%rbp)
movsbl -0x11(%rbp),%ecx
and    $0x3f,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_get_payload_length>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xf(%rsp),%rsi
mov    $0x60,%edi
call   1030 <nrf_read_register@plt>
movzbl 0xf(%rsp),%ecx
and    $0x3f,%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrf_get_payload_length(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @nrf_read_register(i32 96, i8* %5, i8* %7)
store i32 %8, i32* %6
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = and i32 %10, 63
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @nrf_get_payload_length(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i8
%4 = call i32 @nrf_read_register(i32 96, i8* %3, i8* %1)
%5 = load i8, i8* %3
%6 = and i8 %5, 63
%7 = zext i8 %6 to i32
store i32 %7, i32* %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ is_space(int);
int check_space(int t, int *spc) {
  if (is_space(t)) {
    if (*spc)
      return 1;
    *spc = 1;
  } else
    *spc = 0;
  return 0;
}


x86 assembly (clang, -O0):
<check_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <is_space@plt>
cmp    $0x0,%rax
je     1159 <check_space+0x49>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     114a <check_space+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    116a <check_space+0x5a>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1163 <check_space+0x53>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_space>:
push   %rbx
mov    %rsi,%rbx
call   1030 <is_space@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112f <check_space+0x1f>
mov    $0x1,%eax
cmpl   $0x0,(%rbx)
je     112f <check_space+0x1f>
pop    %rbx
ret
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_space(i32 %0, i32* nocapture %1) {
%3 = tail call i64 @is_space(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
store i32 %9, i32* %1
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void uxmi_multiuser() { printf("\nMultiuser\n"); }


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

x86 assembly (clang, -O2):
<uxmi_multiuser>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [11 x i8] c"\0AMultiuser\00"
define void @uxmi_multiuser() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float fmaxf(float, float);
void test_fmaxf(float *__restrict__ r, float *__restrict__ a,
                float *__restrict__ b) {
  int i;
  for (i = 0; i < (16 / sizeof(float)); i++)
    r[i] = fmaxf(a[i], b[i]);
}


x86 assembly (clang, -O0):
<test_fmaxf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    1178 <test_fmaxf+0x78>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_fmaxf+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmaxf>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
movaps %xmm1,%xmm2
maxps  %xmm0,%xmm2
cmpunordps %xmm0,%xmm0
andps  %xmm0,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @test_fmaxf(float* noalias %0, float* noalias %1, float* noalias %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
store i32 0, i32* %7
br label %8
8: ; preds = %28, %3
%9 = load i32, i32* %7
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %10, 4
br i1 %11, label %12, label %31
12: ; preds = %8
%13 = load float*, float** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
%18 = load float*, float** %6
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
%22 = load float, float* %21
%23 = call float @llvm.maxnum.f32(float %17, float %22)
%24 = load float*, float** %4
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
store float %23, float* %27
br label %28
28: ; preds = %12
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %8
31: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @test_fmaxf(float* noalias nocapture writeonly %0, float* noalias nocapture %1, float* noalias nocapture %2) {
%4 = bitcast float* %1 to <4 x float>*
%5 = load <4 x float>, <4 x float>* %4
%6 = bitcast float* %2 to <4 x float>*
%7 = load <4 x float>, <4 x float>* %6
%8 = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %5, <4 x float> %7)
%9 = bitcast float* %0 to <4 x float>*
store <4 x float> %8, <4 x float>* %9
ret void
}
/* Variables and functions */
int ds1621_read_value(int, int);
int read_CONF(int dev_fd) { return (ds1621_read_value(dev_fd, 0xAC)); }


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

x86 assembly (clang, -O2):
<read_CONF>:
mov    $0xac,%esi
jmp    1030 <ds1621_read_value@plt>

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

LLVM IR (-O2):
define i32 @read_CONF(i32 %0) {
%2 = tail call i32 @ds1621_read_value(i32 %0, i32 172)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char j;
part1:
  printf("\x1b[31m"
         "%x",
         j);
  printf("\x1b[32m"
         "%c",
         j);
  printf("\x1b[35m"
         "%o",
         j);
  j++;
  goto part1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
mov    %al,-0x5(%rbp)
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xee2(%rip),%r14
lea    0xee3(%rip),%r15
lea    0xee4(%rip),%rbx
nopl   0x0(%rax)
movsbl %bpl,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%bpl
jmp    1130 <main+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[31m%x\00"
@.str.1 = [8 x i8] c"\1B[32m%c\00"
@.str.2 = [8 x i8] c"\1B[35m%o\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext %6)
%8 = load i8, i8* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8 signext %8)
%10 = load i8, i8* %2
%11 = add i8 %10, 1
store i8 %11, i8* %2
br label %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[31m%x\00"
@.str.1 = [8 x i8] c"\1B[32m%c\00"
@.str.2 = [8 x i8] c"\1B[35m%o\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ undef, %0 ], [ %6, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8 signext %2)
%6 = add i8 %2, 1
br label %1
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *str, size_t n) {
  size_t len;
  char *copy;
  len = strnlen(str, n);
  if ((copy = malloc(len + 1)) == NULL)
    return (NULL);
  memcpy(copy, str, len);
  copy[len] = '\0';
  return (copy);
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1179 <strndup+0x49>
movq   $0x0,-0x8(%rbp)
jmp    119e <strndup+0x6e>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %2, %7
ret i8* %5
}
void test15(void) {
  enum colour { red = 3, blue, yellow, green = 5 };
  enum anotherset { black, grey, white };
  enum yetanotherset { pink = 7, purple, magenta, maroon };
  enum loco { verrueckt, crazy = 3, divune };
  enum primeevil { diablo = 2, mephisto = 3, baal = 4 };
}


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

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

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

LLVM IR (-O2):
define void @test15() {
ret void
}
void INT_Excep_IRQ10(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_IRQ10() {
ret void
}
int greater_value(int maior, int num) {
  if (maior <= num)
    maior = num;
  return maior;
}


x86 assembly (clang, -O0):
<greater_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     111c <greater_value+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater_value>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @greater_value(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @greater_value(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
_Bool QuietGreaterEqual(float f1, float f2) {
  return __builtin_isgreaterequal(f1, f2);
}


x86 assembly (clang, -O0):
<QuietGreaterEqual>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuietGreaterEqual>:
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define zeroext i1 @QuietGreaterEqual(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @QuietGreaterEqual(float %0, float %1) {
%3 = fcmp oge float %0, %1
ret i1 %3
}
int my_strlen(char *str) {
  int i;
  i = 0;
  while (str[i])
    ++i;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <my_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_container_to_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(288, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_container_to_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x120,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_container_to_start_solutions>:
mov    $0x120,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_multprec_container_to_start_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 288, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_container_to_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 288, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}