xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wbkgd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int __darwin_wbkgd(WINDOW *w, uint32_t c) { return wbkgd(w, c); }


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

x86 assembly (clang, -O2):
<__darwin_wbkgd>:
jmp    1030 <wbkgd@plt>

LLVM IR (-O0):
define i32 @__darwin_wbkgd(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 @wbkgd(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__darwin_wbkgd(i32* %0, i32 %1) {
%3 = tail call i32 @wbkgd(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_44_neg();
void z80_ed_5c_neg(void) { z80_ed_44_neg(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_5c_neg() {
%1 = tail call i32 (...) @z80_ed_44_neg()
ret void
}
int test_imm_2Buint32_mem(unsigned int *val) {
  return ((*val) & (0x2B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Buint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 43
%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_2Buint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 43
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const char *skip_trailing_backslash(const char *path) {
  while (((*path) == '/'))
    path++;
  return path;
}


x86 assembly (clang, -O0):
<skip_trailing_backslash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1129 <skip_trailing_backslash+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_trailing_backslash+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_trailing_backslash>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x2f,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <skip_trailing_backslash+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_trailing_backslash(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 47
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
void ler(int *a, int *b) {
  int x, y;
  printf("Escreva dois numeros:\n");
  scanf("%d %d", &x, &y);
  *a = x;
  *b = y;
}


x86 assembly (clang, -O0):
<ler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ler>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rbx)
mov    (%rsp),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Escreva dois numeros:\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
define void @ler(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%9 = load i32, i32* %5
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@str = [22 x i8] c"Escreva dois numeros:\00"
define void @ler(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
store i32 %9, i32* %0
%10 = load i32, i32* %4
store i32 %10, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_clr(int);
int /*<<< orphan*/ gpio_set(int);
void LCD_FontSelect(short high) {
  if (high) {
    gpio_clr(1 << 15);
  } else {
    gpio_set(1 << 15);
  }
}


x86 assembly (clang, -O0):
<LCD_FontSelect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     1149 <LCD_FontSelect+0x29>
mov    $0x8000,%edi
call   1030 <gpio_clr@plt>
jmp    1153 <LCD_FontSelect+0x33>
mov    $0x8000,%edi
call   1040 <gpio_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_FontSelect>:
test   %di,%di
je     112f <LCD_FontSelect+0xf>
mov    $0x8000,%edi
jmp    1030 <gpio_clr@plt>
mov    $0x8000,%edi
jmp    1040 <gpio_set@plt>

LLVM IR (-O0):
define void @LCD_FontSelect(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = icmp ne i16 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @gpio_clr(i32 32768)
br label %9
7: ; preds = %1
%8 = call i32 @gpio_set(i32 32768)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @LCD_FontSelect(i16 signext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @gpio_clr(i32 32768)
br label %7
5: ; preds = %1
%6 = tail call i32 @gpio_set(i32 32768)
br label %7
7: ; preds = %5, %3
ret void
}
void Dummy_Clk_Updater(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<Dummy_Clk_Updater>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Dummy_Clk_Updater+0x9>
jmp    110e <Dummy_Clk_Updater+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Dummy_Clk_Updater() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ turnOnLed(int);
void turnOnLight2(void) { turnOnLed(4); }


x86 assembly (clang, -O0):
<turnOnLight2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <turnOnLed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnOnLight2>:
mov    $0x4,%edi
jmp    1030 <turnOnLed@plt>

LLVM IR (-O0):
define void @turnOnLight2() {
%1 = call i32 @turnOnLed(i32 4)
ret void
}

LLVM IR (-O2):
define void @turnOnLight2() {
%1 = tail call i32 @turnOnLed(i32 4)
ret void
}
void main() {
  int m = 10, r;
  r = 10 ^ 2;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @env_glow() {
%1 = tail call i32 (...) @cycler_sprite()
ret void
}
/* Variables and functions */
unsigned short NumberOnly();
int /*<<< orphan*/ WriteNumber(unsigned short);
void CR_Asm(void) {
  unsigned short int nNum = NumberOnly();
  WriteNumber(nNum);
}


x86 assembly (clang, -O0):
<CR_Asm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <NumberOnly@plt>
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <WriteNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Asm>:
push   %rax
xor    %eax,%eax
call   1040 <NumberOnly@plt>
movzwl %ax,%edi
pop    %rax
jmp    1030 <WriteNumber@plt>

LLVM IR (-O0):
define void @CR_Asm() {
%1 = alloca i16
%2 = call zeroext i16 (...) @NumberOnly()
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = call i32 @WriteNumber(i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @CR_Asm() {
%1 = tail call zeroext i16 (...) @NumberOnly()
%2 = tail call i32 @WriteNumber(i16 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ boardCoordsOperationResults(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ createBoardCoord(int, int);
int /*<<< orphan*/ mulBoardCoord(int, int /*<<< orphan*/);
void boardCoordMultiplicationWorkInRange(void) {
  boardCoordsOperationResults(mulBoardCoord(3, createBoardCoord(5, 6)), 3 * 5,
                              3 * 6);
}


x86 assembly (clang, -O0):
<boardCoordMultiplicationWorkInRange>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <createBoardCoord@plt>
mov    %eax,%esi
mov    $0x3,%edi
call   1050 <mulBoardCoord@plt>
mov    %eax,%edi
mov    $0xf,%esi
mov    $0x12,%edx
call   1040 <boardCoordsOperationResults@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boardCoordMultiplicationWorkInRange>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <createBoardCoord@plt>
mov    $0x3,%edi
mov    %eax,%esi
call   1050 <mulBoardCoord@plt>
mov    %eax,%edi
mov    $0xf,%esi
mov    $0x12,%edx
pop    %rax
jmp    1040 <boardCoordsOperationResults@plt>

LLVM IR (-O0):
define void @boardCoordMultiplicationWorkInRange() {
%1 = call i32 @createBoardCoord(i32 5, i32 6)
%2 = call i32 @mulBoardCoord(i32 3, i32 %1)
%3 = call i32 @boardCoordsOperationResults(i32 %2, i32 15, i32 18)
ret void
}

LLVM IR (-O2):
define void @boardCoordMultiplicationWorkInRange() {
%1 = tail call i32 @createBoardCoord(i32 5, i32 6)
%2 = tail call i32 @mulBoardCoord(i32 3, i32 %1)
%3 = tail call i32 @boardCoordsOperationResults(i32 %2, i32 15, i32 18)
ret void
}
int get_use_bit(int address) { return ((int)address % 2); }


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

x86 assembly (clang, -O2):
<get_use_bit>:
mov    %edi,%eax
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_use_bit(i32 %0) {
%2 = srem i32 %0, 2
ret i32 %2
}
/* Variables and functions */
size_t heap_parent__(size_t idx) { return idx / 2; }


x86 assembly (clang, -O0):
<heap_parent__>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_parent__>:
mov    %rdi,%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @heap_parent__(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 2
ret i64 %4
}

LLVM IR (-O2):
define i64 @heap_parent__(i64 %0) {
%2 = lshr i64 %0, 1
ret i64 %2
}
int fossil_isspace(char c) { return c == ' ' || (c <= '\r' && c >= '\t'); }


x86 assembly (clang, -O0):
<fossil_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1141 <fossil_isspace+0x41>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x3(%rbp)
jg     113b <fossil_isspace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
setge  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fossil_isspace>:
cmp    $0x20,%dil
sete   %al
add    $0xf7,%dil
cmp    $0x5,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @fossil_isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 13
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 9
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @fossil_isspace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = add i8 %0, -9
%4 = icmp ult i8 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *pa_strerror(int error) {
  ;
  return "IT BROKE";
}


x86 assembly (clang, -O0):
<pa_strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"IT BROKE\00"
define i8* @pa_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"IT BROKE\00"
define i8* @pa_strerror(i32 %0) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
void test_alu(void) {}


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

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

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

LLVM IR (-O2):
define void @test_alu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *cmdname) {
  printf("Warning : This program will work only on Valleyview\n");
  printf("Usage: %s [addr]\n", cmdname);
  printf("\t addr : in 0xXXXX format\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefe(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Warning : This program will work only on Valleyview\0A\00"
@.str.1 = [18 x i8] c"Usage: %s [addr]\0A\00"
@.str.2 = [27 x i8] c"\09 addr : in 0xXXXX format\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"Usage: %s [addr]\0A\00"
@str = [52 x i8] c"Warning : This program will work only on Valleyview\00"
@str.3 = [26 x i8] c"\09 addr : in 0xXXXX format\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_hash_addr(uint32_t addr[8], uint32_t hash) { addr[7] = hash; }


x86 assembly (clang, -O0):
<set_hash_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_hash_addr>:
mov    %esi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @set_hash_addr(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 = getelementptr inbounds i32, i32* %6, i64 7
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @set_hash_addr(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %1, i32* %3
ret void
}
void set_ptr(int *ptr, int val) { *ptr = val; }


x86 assembly (clang, -O0):
<set_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ptr>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_ptr(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
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @set_ptr(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
void McASPPinDirOutputSet(unsigned int baseAddr, unsigned int pinMask) {
  (*((volatile unsigned int *)(baseAddr + (0x14)))) |= pinMask;
}


x86 assembly (clang, -O0):
<McASPPinDirOutputSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPPinDirOutputSet>:
add    $0x14,%edi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPPinDirOutputSet(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 = add i32 %6, 20
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, %5
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @McASPPinDirOutputSet(i32 %0, i32 %1) {
%3 = add i32 %0, 20
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, %1
store volatile i32 %7, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_walltime_(double *);
void get_walltime(double *wcTime) { get_walltime_(wcTime); }


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

x86 assembly (clang, -O2):
<get_walltime>:
jmp    1030 <get_walltime_@plt>

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

LLVM IR (-O2):
define void @get_walltime(double* %0) {
%2 = tail call i32 @get_walltime_(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setutent();
extern void _p_setutent(void) { setutent(); }


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

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

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

LLVM IR (-O2):
define void @_p_setutent() {
%1 = tail call i32 (...) @setutent()
ret void
}
/* Type definitions */
struct pollfd {
  scalar_t__ events;
  scalar_t__ fd;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct pollfd *);
struct pollfd *malloc(int);
int /*<<< orphan*/ poll(struct pollfd *, int, int);
int main(void) {
  struct pollfd *ufds = malloc(2 * sizeof(struct pollfd) - 1);
  assert(ufds);
  ufds[0].fd = 0;
  ufds[0].events = 0;
  ufds[1].events = 0;
  poll(ufds, 2, 200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0xc8,%edx
call   1050 <poll@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1f,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rbx)
movq   $0x0,0x10(%rbx)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xc8,%edx
call   1050 <poll@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pollfd = type { i64, i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.pollfd*
store i32 0, i32* %1
%3 = call %struct.pollfd* @malloc(i32 31)
store %struct.pollfd* %3, %struct.pollfd** %2
%4 = load %struct.pollfd*, %struct.pollfd** %2
%5 = call i32 @assert(%struct.pollfd* %4)
%6 = load %struct.pollfd*, %struct.pollfd** %2
%7 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %6, i64 0
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %7, i32 0, i32 1
store i64 0, i64* %8
%9 = load %struct.pollfd*, %struct.pollfd** %2
%10 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %9, i64 0
%11 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %10, i32 0, i32 0
store i64 0, i64* %11
%12 = load %struct.pollfd*, %struct.pollfd** %2
%13 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %12, i64 1
%14 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %13, i32 0, i32 0
store i64 0, i64* %14
%15 = load %struct.pollfd*, %struct.pollfd** %2
%16 = call i32 @poll(%struct.pollfd* %15, i32 2, i32 200)
ret i32 0
}

LLVM IR (-O2):
%struct.pollfd = type { i64, i64 }
define i32 @main() {
%1 = tail call %struct.pollfd* @malloc(i32 31)
%2 = tail call i32 @assert(%struct.pollfd* %1)
%3 = bitcast %struct.pollfd* %1 to i8*
%4 = tail call i32 @poll(%struct.pollfd* %1, i32 2, i32 200)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_ror_epi32(int /*<<< orphan*/, int);
__attribute__((always_)) __m256i rot12_256(__m256i x) {
  return _mm256_ror_epi32(x, 12);
}


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

x86 assembly (clang, -O2):
<rot12_256>:
mov    $0xc,%esi
jmp    1030 <_mm256_ror_epi32@plt>

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

LLVM IR (-O2):
define i32 @rot12_256(i32 %0) {
%2 = tail call i32 @_mm256_ror_epi32(i32 %0, i32 12)
ret i32 %2
}
void rd_init(void) {
  extern void rd_thread_init(void);
  extern void rd_timers_init();
  rd_thread_init();
  rd_timers_init();
}


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

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

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

LLVM IR (-O2):
define void @rd_init() {
tail call void @rd_thread_init()
tail call void (...) @rd_timers_init()
ret void
}
int test_imm_F1uint16_mem(unsigned short *val) {
  return ((*val) & (-0xF1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F1uint16_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, -241
%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_F1uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -241
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int color_offset_f1(int x, int y) {
  return ((y << 10) - (((x << 10) * 43) / 40) + (45 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x2b,%eax,%eax
mov    $0x28,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
add    $0xb400,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f1>:
shl    $0xa,%esi
imul   $0xac00,%edi,%eax
cltq
imul   $0xffffffff99999999,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xb400,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f1(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 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 43
%10 = sdiv i32 %9, 40
%11 = sub nsw i32 %6, %10
%12 = add nsw i32 %11, 46080
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f1(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 44032
%5 = sdiv i32 %4, -40
%6 = add i32 %3, 46080
%7 = add i32 %6, %5
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ GL_FALSE;
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(char *);
int /*<<< orphan*/ print_screen_info(int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *displayName = NULL;
  Display *dpy;
  dpy = XOpenDisplay(displayName);
  if (!dpy) {
    return -1;
  }
  print_screen_info(dpy, GL_FALSE);
  XCloseDisplay(dpy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <XOpenDisplay@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <main+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1194 <main+0x64>
mov    -0x20(%rbp),%rdi
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
call   1030 <print_screen_info@plt>
mov    -0x20(%rbp),%rdi
call   1050 <XCloseDisplay@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
test   %rax,%rax
je     1161 <main+0x31>
mov    %rax,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <print_screen_info@plt>
mov    %rbx,%rdi
call   1050 <XCloseDisplay@plt>
jmp    1167 <main+0x37>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@GL_FALSE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @XOpenDisplay(i8* null)
%4 = icmp eq i32* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @GL_FALSE
%7 = tail call i32 @print_screen_info(i32* %3, i32 %6)
%8 = tail call i32 @XCloseDisplay(i32* %3)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void PutPixel8(int8_t *pData, uint32_t pixel) {
  *(uint8_t *)pData = (uint8_t)pixel;
}


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

x86 assembly (clang, -O2):
<PutPixel8>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @PutPixel8(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to i64*
store i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @PutPixel8(i32* nocapture writeonly %0, i64 %1) {
%3 = bitcast i32* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int i;
  scanf("%i", &i);
  printf("%i", i >> 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
sar    $0x1,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
sar    %esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = ashr i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = ashr i32 %6, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void init_adc(void) {}


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

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

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

LLVM IR (-O2):
define void @init_adc() {
ret void
}
float maths_rad_to_deg(float i) { return (180.0f / 3.141592653589793f) * i; }


x86 assembly (clang, -O0):
<maths_rad_to_deg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @maths_rad_to_deg(float %0) {
%2 = fmul float %0, 0x404CA5DC00000000
ret float %2
}
int y2d(int yr) { return yr * 365 + yr / 4 - yr / 100 + yr / 400; }


x86 assembly (clang, -O0):
<y2d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x16d,-0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<y2d>:
imul   $0x16d,%edi,%eax
lea    0x3(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x2,%ecx
add    %eax,%ecx
movslq %edi,%rax
imul   $0xffffffffae147ae1,%rax,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
add    %ecx,%edx
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @y2d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 365
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 4
%7 = add nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 100
%10 = sub nsw i32 %7, %9
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 400
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @y2d(i32 %0) {
%2 = mul nsw i32 %0, 365
%3 = sdiv i32 %0, 4
%4 = add nsw i32 %2, %3
%5 = sdiv i32 %0, -100
%6 = add i32 %4, %5
%7 = sdiv i32 %0, 400
%8 = add nsw i32 %6, %7
ret i32 %8
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 1UL) {
      if (!(state[0UL] > local1)) {
        state[local1] += state[0UL];
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 255873917UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    1157 <RandomFunc+0x57>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
ja     1148 <RandomFunc+0x48>
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
add    -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
add    $0xf40537d,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xff660b45,%eax
add    (%rdi),%eax
sete   %cl
shl    %cl,%eax
add    $0xf40537d,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %29, %2
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %34
16: ; preds = %12
%17 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%18 = load i32, i32* %17
%19 = load i32, i32* %6
%20 = icmp ugt i32 %18, %19
br i1 %20, label %29, label %21
21: ; preds = %16
%22 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%23 = load i32, i32* %22
%24 = load i32, i32* %6
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = add i32 %27, %23
store i32 %28, i32* %26
br label %29
29: ; preds = %21, %16
%30 = load i32, i32* %6
%31 = zext i32 %30 to i64
%32 = add i64 %31, 2
%33 = trunc i64 %32 to i32
store i32 %33, i32* %6
br label %12
34: ; preds = %12
%35 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%36 = load i32, i32* %35
%37 = zext i32 %36 to i64
%38 = add i64 %37, 255873917
%39 = trunc i64 %38 to i32
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 0
store i32 %39, i32* %41
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, -10089659
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = shl i32 %4, %6
%8 = add i32 %7, 255873917
store i32 %8, i32* %1
ret void
}
/* Type definitions */
struct local_timer_ops {
  int dummy;
};

/* Variables and functions */
int ENXIO;
int local_timer_register(struct local_timer_ops *ops) { return -ENXIO; }


x86 assembly (clang, -O0):
<local_timer_register>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_timer_register>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.local_timer_ops = type { i32 }
@ENXIO = global i32 0
define i32 @local_timer_register(%struct.local_timer_ops* %0) {
%2 = alloca %struct.local_timer_ops*
store %struct.local_timer_ops* %0, %struct.local_timer_ops** %2
%3 = load i32, i32* @ENXIO
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.local_timer_ops = type { i32 }
@ENXIO = global i32 0
define i32 @local_timer_register(%struct.local_timer_ops* nocapture readnone %0) {
%2 = load i32, i32* @ENXIO
%3 = sub nsw i32 0, %2
ret i32 %3
}
char *strcpy(char *dst, const char *src) {
  char *ret;
  ret = dst;
  while ((*dst++ = *src++) != '\0')
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

LLVM IR (-O0):
define i8* @strcpy(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
store i8* %6, i8** %5
br label %7
7: ; preds = %15, %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 %10, i8* %11
%13 = sext i8 %10 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ run_timers();
int /*<<< orphan*/ sleep(int);
void *thread_proc(void *arg) {
  while (1) {
    run_timers();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<thread_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <run_timers@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <thread_proc+0xc>

x86 assembly (clang, -O2):
<thread_proc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <run_timers@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <thread_proc+0x10>

LLVM IR (-O0):
define i8* @thread_proc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @run_timers()
%5 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @thread_proc(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @run_timers()
%4 = tail call i32 @sleep(i32 1)
br label %2
}
int exynos5_bus_int_put(struct exynos5_bus_int_handle *handle) { return 0; }


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

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

LLVM IR (-O0):
%struct.exynos5_bus_int_handle = type opaque
define i32 @exynos5_bus_int_put(%struct.exynos5_bus_int_handle* %0) {
%2 = alloca %struct.exynos5_bus_int_handle*
store %struct.exynos5_bus_int_handle* %0, %struct.exynos5_bus_int_handle** %2
ret i32 0
}

LLVM IR (-O2):
%struct.exynos5_bus_int_handle = type opaque
define i32 @exynos5_bus_int_put(%struct.exynos5_bus_int_handle* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_FLASH_IN_PIN() { set_io_bit(0x34, 6); }


x86 assembly (clang, -O0):
<TOSH_SET_FLASH_IN_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x6,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_FLASH_IN_PIN>:
mov    $0x34,%edi
mov    $0x6,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_FLASH_IN_PIN() {
%1 = call i32 @set_io_bit(i32 52, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_FLASH_IN_PIN() {
%1 = tail call i32 @set_io_bit(i32 52, i32 6)
ret void
}
int h(int i) { return i >= (i + (-2)); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0xfffffffe,%ecx
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -2
%6 = icmp sge i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @h(i32 %0) {
ret i32 1
}
void SteamAPI_ISteamController_StopAnalogActionMomentum(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamController_StopAnalogActionMomentum>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamController_StopAnalogActionMomentum = [51 x i8] c"SteamAPI_ISteamController_StopAnalogActionMomentum\00"
define void @SteamAPI_ISteamController_StopAnalogActionMomentum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__func__.SteamAPI_ISteamController_StopAnalogActionMomentum, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamController_StopAnalogActionMomentum = [51 x i8] c"SteamAPI_ISteamController_StopAnalogActionMomentum\00"
define void @SteamAPI_ISteamController_StopAnalogActionMomentum(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @__func__.SteamAPI_ISteamController_StopAnalogActionMomentum, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mission();
int /*<<< orphan*/ init();
int main(int argc, char *argv[]) {
  init();
  Mission();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @Mission()
ret i32 0
}
int gpio_is_valid_port(int number) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_is_valid_port(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void add_nes_str(char *instr, char *instr2) {
  strcat(instr, " [NES] ");
  strcat(instr, instr2);
}


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

x86 assembly (clang, -O2):
<add_nes_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c" [NES] \00"
define void @add_nes_str(i8* %0, i8* %1) {
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}